|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.beans.PropertyEditorSupport
org.jdesktop.swingx.editors.PaintPropertyEditor
public class PaintPropertyEditor
Two parts to this property editor. The first part is a simple dropdown. The second part is a complicated UI for constructing multiple "layers" of various different Painters, including gradient paints.
Constructor Summary | |
---|---|
PaintPropertyEditor()
Creates a new instance of PainterPropertyEditor |
Method Summary | |
---|---|
String |
getAsText()
Gets the property value as a string suitable for presentation to a human to edit. |
String |
getJavaInitializationString()
This method is intended for use when generating Java code to set the value of the property. |
String[] |
getTags()
If the property value must be one of a set of known tagged values, then this method should return an array of the tag values. |
Paint |
getValue()
Gets the value of the property. |
boolean |
isPaintable()
Determines whether the class will honor the painValue method. |
void |
paintValue(Graphics gfx,
Rectangle box)
Paint a representation of the value into a given area of screen real estate. |
void |
setAsText(String text)
Sets the property value by parsing a given String. |
Methods inherited from class java.beans.PropertyEditorSupport |
---|
addPropertyChangeListener, firePropertyChange, getCustomEditor, getSource, removePropertyChangeListener, setSource, setValue, supportsCustomEditor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PaintPropertyEditor()
Method Detail |
---|
public String[] getTags()
java.beans.PropertyEditorSupport
getTags
in interface PropertyEditor
getTags
in class PropertyEditorSupport
public Paint getValue()
java.beans.PropertyEditorSupport
getValue
in interface PropertyEditor
getValue
in class PropertyEditorSupport
public String getJavaInitializationString()
java.beans.PropertyEditorSupport
Example results are "2", "new Color(127,127,34)", "Color.orange", etc.
getJavaInitializationString
in interface PropertyEditor
getJavaInitializationString
in class PropertyEditorSupport
public void setAsText(String text) throws IllegalArgumentException
java.beans.PropertyEditorSupport
setAsText
in interface PropertyEditor
setAsText
in class PropertyEditorSupport
text
- The string to be parsed.
IllegalArgumentException
public String getAsText()
java.beans.PropertyEditorSupport
getAsText
in interface PropertyEditor
getAsText
in class PropertyEditorSupport
Returns "null" is the value can't be expressed as a string.
If a non-null value is returned, then the PropertyEditor should be prepared to parse that string back in setAsText().
public void paintValue(Graphics gfx, Rectangle box)
java.beans.PropertyEditorSupport
If the PropertyEditor doesn't honor paint requests (see isPaintable) this method should be a silent noop.
paintValue
in interface PropertyEditor
paintValue
in class PropertyEditorSupport
gfx
- Graphics object to paint into.box
- Rectangle within graphics object into which we should paint.public boolean isPaintable()
java.beans.PropertyEditorSupport
isPaintable
in interface PropertyEditor
isPaintable
in class PropertyEditorSupport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |