public class FontFormatter
extends javax.swing.text.DefaultFormatter
FontFormatter is used to format fonts into a textual representation
which can be edited in an entry field.
| Constructor and Description |
|---|
FontFormatter() |
FontFormatter(boolean allowsNullValue) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearGenericFontFamilies()
Clears the generic font families map.
|
static javax.swing.JFormattedTextField.AbstractFormatterFactory |
createFormatterFactory()
Convenience method for creating a formatter factory with a
FontFormatter. |
static javax.swing.JFormattedTextField.AbstractFormatterFactory |
createFormatterFactory(boolean allowsNullValue)
Convenience method for creating a formatter factory with a
8@code FontFormatter}.
|
boolean |
getAllowsNullValue()
Returns true, if null value is allowed.
|
boolean |
getAllowsUnknownFont()
Returns true, if unknown font names are allowed.
|
void |
putGenericFontFamily(java.lang.String familyName,
java.awt.Font font)
Adds a generic font family.
|
void |
setAllowsNullValue(boolean newValue)
Sets whether a null value is allowed.
|
void |
setAllowsUnknownFont(boolean newValue)
Sets whether unknown font names are allowed.
|
java.lang.Object |
stringToValue(java.lang.String str) |
java.lang.String |
valueToString(java.lang.Object value) |
clone, getAllowsInvalid, getCommitsOnValidEdit, getDocumentFilter, getNavigationFilter, getOverwriteMode, getValueClass, install, setAllowsInvalid, setCommitsOnValidEdit, setOverwriteMode, setValueClasspublic FontFormatter()
public FontFormatter(boolean allowsNullValue)
public void setAllowsNullValue(boolean newValue)
newValue - public boolean getAllowsNullValue()
public void setAllowsUnknownFont(boolean newValue)
newValue - public boolean getAllowsUnknownFont()
public void clearGenericFontFamilies()
public void putGenericFontFamily(java.lang.String familyName,
java.awt.Font font)
public java.lang.Object stringToValue(java.lang.String str)
throws java.text.ParseException
stringToValue in class javax.swing.text.DefaultFormatterjava.text.ParseExceptionpublic java.lang.String valueToString(java.lang.Object value)
throws java.text.ParseException
valueToString in class javax.swing.text.DefaultFormatterjava.text.ParseExceptionpublic static javax.swing.JFormattedTextField.AbstractFormatterFactory createFormatterFactory()
FontFormatter.
Uses the RGB_INTEGER format and disallows null values.public static javax.swing.JFormattedTextField.AbstractFormatterFactory createFormatterFactory(boolean allowsNullValue)