org.netbeans.core/2 3.32

org.netbeans.beaninfo.editors
Class ColorEditor

java.lang.Object
  extended by org.netbeans.beaninfo.editors.ColorEditor
All Implemented Interfaces:
PropertyEditor, XMLPropertyEditor

public final class ColorEditor
extends Object
implements PropertyEditor, XMLPropertyEditor

A property editor for Color class. (Final only for performance, can be unfinaled if desired).


Field Summary
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 Summary
ColorEditor()
          Creates color editor.
 
Method Summary
 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()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AWT_PALETTE

public static final int AWT_PALETTE
AWT Palette mode.

See Also:
Constant Field Values

SYSTEM_PALETTE

public static final int SYSTEM_PALETTE
System Palette mode.

See Also:
Constant Field Values

SWING_PALETTE

public static final int SWING_PALETTE
Swing Palette mode.

See Also:
Constant Field Values

XML_COLOR

public static final String XML_COLOR
Name of color element.

See Also:
Constant Field Values

ATTR_TYPE

public static final String ATTR_TYPE
Name of type attribute.

See Also:
Constant Field Values

ATTR_RED

public static final String ATTR_RED
Name of red attribute.

See Also:
Constant Field Values

ATTR_GREEN

public static final String ATTR_GREEN
Name of green attribute.

See Also:
Constant Field Values

ATTR_BLUE

public static final String ATTR_BLUE
Name of blue attribute.

See Also:
Constant Field Values

ATTR_ID

public static final String ATTR_ID
Name of id attribute.

See Also:
Constant Field Values

ATTR_PALETTE

public static final String ATTR_PALETTE
Name of palette attribute.

See Also:
Constant Field Values

VALUE_PALETTE

public static final String VALUE_PALETTE
Value of palette.

See Also:
Constant Field Values

VALUE_RGB

public static final String VALUE_RGB
Value of rgb.

See Also:
Constant Field Values

VALUE_NULL

public static final String VALUE_NULL
Null value.

See Also:
Constant Field Values
Constructor Detail

ColorEditor

public ColorEditor()
Creates color editor.

Method Detail

getStaticChooser

public static JColorChooser getStaticChooser(ColorEditor ce)
Gets staticChooser instance.


getValue

public Object getValue()
Gets value. Implements PropertyEditor interface.

Specified by:
getValue in interface PropertyEditor
Returns:
Color value or null

setValue

public void setValue(Object object)
Sets value. Implements PropertyEditor interface.

Specified by:
setValue in interface PropertyEditor
Parameters:
object - object to set, accepts Color or SuperColor types

getAsText

public String getAsText()
Gets value as text. Implements PropertyEditor interface.

Specified by:
getAsText in interface PropertyEditor

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Sets value ad text. Implements PropertyEditor interface.

Specified by:
setAsText in interface PropertyEditor
Throws:
IllegalArgumentException

getJavaInitializationString

public String getJavaInitializationString()
Gets java inititalization string. Implements PropertyEditor interface.

Specified by:
getJavaInitializationString in interface PropertyEditor

getTags

public String[] getTags()
Get tags possible for choosing value. Implements PropertyEditor interface.

Specified by:
getTags in interface PropertyEditor

isPaintable

public boolean isPaintable()
Insicates whether this editor is paintable. Implements PropertyEditor interface.

Specified by:
isPaintable in interface PropertyEditor
Returns:
true

paintValue

public void paintValue(Graphics g,
                       Rectangle rectangle)
Paints the current value. Implements ProepertyEditor interface.

Specified by:
paintValue in interface PropertyEditor

supportsCustomEditor

public boolean supportsCustomEditor()
Indicates whether this editor supports custom editing. Implements PropertyEditor interface.

Specified by:
supportsCustomEditor in interface PropertyEditor
Returns:
true

getCustomEditor

public Component getCustomEditor()
Gets custom editor. Implements PropertyEditor interface. *return NbColorChooser instance

Specified by:
getCustomEditor in interface PropertyEditor

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
Adds property change listener.

Specified by:
addPropertyChangeListener in interface PropertyEditor

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
Removes property change listner.

Specified by:
removePropertyChangeListener in interface PropertyEditor

readFromXML

public void readFromXML(Node element)
                 throws IOException
Called to load property value from specified XML subtree. If succesfully loaded, Implements 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 element

Specified by:
readFromXML in interface XMLPropertyEditor
Parameters:
element - the XML DOM element representing a subtree of XML from which the value should be loaded
Throws:
IOException - thrown when the value cannot be restored from the specified XML element

storeToXML

public Node storeToXML(Document doc)
Called to store current property value into XML subtree. The property value should be set using the Implemtns XMLPropertyEdtitor interface. setValue method prior to calling this method.

Specified by:
storeToXML in interface XMLPropertyEditor
Parameters:
doc - The XML document to store the XML in - should be used for creating nodes only
Returns:
the XML DOM element representing a subtree of XML from which the value should be loaded

gtkShouldAntialias

public static final boolean gtkShouldAntialias()

org.netbeans.core/2 3.32

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.