public final class ColorEditor extends Object implements PropertyEditor, XMLPropertyEditor
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_BLUE
Name of blue attribute.
|
static String |
ATTR_GREEN
Name of green attribute.
|
static String |
ATTR_ID
Name of id attribute.
|
static String |
ATTR_PALETTE
Name of palette attribute.
|
static String |
ATTR_RED
Name of red attribute.
|
static String |
ATTR_TYPE
Name of type attribute.
|
static int |
AWT_PALETTE
AWT Palette mode.
|
static int |
SWING_PALETTE
Swing Palette mode.
|
static int |
SYSTEM_PALETTE
System Palette mode.
|
static String |
VALUE_NULL
Null value.
|
static String |
VALUE_PALETTE
Value of palette.
|
static String |
VALUE_RGB
Value of rgb.
|
static String |
XML_COLOR
Name of color element.
|
Constructor and Description |
---|
ColorEditor()
Creates color editor.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
Adds property change listener.
|
String |
getAsText()
Gets value as text.
|
Component |
getCustomEditor()
Gets custom editor.
|
String |
getJavaInitializationString()
Gets java inititalization string.
|
static JColorChooser |
getStaticChooser(ColorEditor ce)
Gets
staticChooser instance. |
String[] |
getTags()
Get tags possible for choosing value.
|
Object |
getValue()
Gets value.
|
static boolean |
gtkShouldAntialias()
Deprecated.
|
boolean |
isPaintable()
Insicates whether this editor is paintable.
|
void |
paintValue(Graphics g,
Rectangle rectangle)
Paints the current value.
|
void |
readFromXML(Node element)
Called to load property value from specified XML subtree.
|
void |
removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
Removes property change listner.
|
void |
setAsText(String text)
Sets value ad text.
|
void |
setValue(Object object)
Sets value.
|
Node |
storeToXML(Document doc)
Called to store current property value into XML subtree.
|
boolean |
supportsCustomEditor()
Indicates whether this editor supports custom editing.
|
public static final int AWT_PALETTE
public static final int SYSTEM_PALETTE
public static final int SWING_PALETTE
public static final String XML_COLOR
public static final String ATTR_TYPE
public static final String ATTR_RED
public static final String ATTR_GREEN
public static final String ATTR_BLUE
public static final String ATTR_ID
public static final String ATTR_PALETTE
public static final String VALUE_PALETTE
public static final String VALUE_RGB
public static final String VALUE_NULL
public static JColorChooser getStaticChooser(ColorEditor ce)
staticChooser
instance.public Object getValue()
PropertyEditor
interface.getValue
in interface PropertyEditor
Color
value or null
public void setValue(Object object)
PropertyEditor
interface.setValue
in interface PropertyEditor
object
- object to set, accepts Color
or SuperColor
typespublic String getAsText()
PropertyEditor
interface.getAsText
in interface PropertyEditor
public void setAsText(String text) throws IllegalArgumentException
PropertyEditor
interface.setAsText
in interface PropertyEditor
IllegalArgumentException
public String getJavaInitializationString()
PropertyEditor
interface.getJavaInitializationString
in interface PropertyEditor
public String[] getTags()
PropertyEditor
interface.getTags
in interface PropertyEditor
public boolean isPaintable()
PropertyEditor
interface.isPaintable
in interface PropertyEditor
true
public void paintValue(Graphics g, Rectangle rectangle)
ProepertyEditor
interface.paintValue
in interface PropertyEditor
public boolean supportsCustomEditor()
PropertyEditor
interface.supportsCustomEditor
in interface PropertyEditor
true
public Component getCustomEditor()
PropertyEditor
interface.
*return NbColorChooser
instancegetCustomEditor
in interface PropertyEditor
public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
addPropertyChangeListener
in interface PropertyEditor
public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
removePropertyChangeListener
in interface PropertyEditor
public void readFromXML(Node element) throws IOException
XMLPropertyEditor
interface.
the value should be available via the getValue method.
An IOException should be thrown when the value cannot be restored from the specified XML elementreadFromXML
in interface XMLPropertyEditor
element
- the XML DOM element representing a subtree of XML from which the value should be loadedIOException
- thrown when the value cannot be restored from the specified XML elementpublic Node storeToXML(Document doc)
XMLPropertyEdtitor
interface.
setValue method prior to calling this method.storeToXML
in interface XMLPropertyEditor
doc
- The XML document to store the XML in - should be used for creating nodes only@Deprecated public static final boolean gtkShouldAntialias()
GraphicsUtils.configureDefaultRenderingHints(java.awt.Graphics)
instead