org.jhotdraw.text
Class FontFormatter
- java.lang.Object
-
- javax.swing.JFormattedTextField.AbstractFormatter
-
- javax.swing.text.DefaultFormatter
-
- org.jhotdraw.text.FontFormatter
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class FontFormatter extends javax.swing.text.DefaultFormatterFontFormatteris used to format fonts into a textual representation which can be edited in an entry field.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description FontFormatter()FontFormatter(boolean allowsNullValue)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclearGenericFontFamilies()Clears the generic font families map.static javax.swing.JFormattedTextField.AbstractFormatterFactorycreateFormatterFactory()Convenience method for creating a formatter factory with aFontFormatter.static javax.swing.JFormattedTextField.AbstractFormatterFactorycreateFormatterFactory(boolean allowsNullValue)Convenience method for creating a formatter factory with a 8@code FontFormatter}.booleangetAllowsNullValue()Returns true, if null value is allowed.booleangetAllowsUnknownFont()Returns true, if unknown font names are allowed.voidputGenericFontFamily(java.lang.String familyName, java.awt.Font font)Adds a generic font family.voidsetAllowsNullValue(boolean newValue)Sets whether a null value is allowed.voidsetAllowsUnknownFont(boolean newValue)Sets whether unknown font names are allowed.java.lang.ObjectstringToValue(java.lang.String str)java.lang.StringvalueToString(java.lang.Object value)
-
-
-
Constructor Detail
-
FontFormatter
public FontFormatter()
-
FontFormatter
public FontFormatter(boolean allowsNullValue)
-
-
Method Detail
-
setAllowsNullValue
public void setAllowsNullValue(boolean newValue)
Sets whether a null value is allowed.- Parameters:
newValue-
-
getAllowsNullValue
public boolean getAllowsNullValue()
Returns true, if null value is allowed.
-
setAllowsUnknownFont
public void setAllowsUnknownFont(boolean newValue)
Sets whether unknown font names are allowed.- Parameters:
newValue-
-
getAllowsUnknownFont
public boolean getAllowsUnknownFont()
Returns true, if unknown font names are allowed.
-
clearGenericFontFamilies
public void clearGenericFontFamilies()
Clears the generic font families map.
-
putGenericFontFamily
public void putGenericFontFamily(java.lang.String familyName, java.awt.Font font)Adds a generic font family.
-
stringToValue
public java.lang.Object stringToValue(java.lang.String str) throws java.text.ParseException- Overrides:
stringToValuein classjavax.swing.text.DefaultFormatter- Throws:
java.text.ParseException
-
valueToString
public java.lang.String valueToString(java.lang.Object value) throws java.text.ParseException- Overrides:
valueToStringin classjavax.swing.text.DefaultFormatter- Throws:
java.text.ParseException
-
createFormatterFactory
public static javax.swing.JFormattedTextField.AbstractFormatterFactory createFormatterFactory()
Convenience method for creating a formatter factory with aFontFormatter. Uses the RGB_INTEGER format and disallows null values.
-
createFormatterFactory
public static javax.swing.JFormattedTextField.AbstractFormatterFactory createFormatterFactory(boolean allowsNullValue)
Convenience method for creating a formatter factory with a 8@code FontFormatter}.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG