public class PaintEditor extends java.beans.PropertyEditorSupport implements java.beans.PropertyChangeListener
Paint
instances. Obviously, we
can't provide editing for every type of Paint
, but we'll try
to cover Paint
and GradientPaint
.Constructor and Description |
---|
PaintEditor()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Component |
getCustomEditor()
Returns a component for editing a
Paint instance. |
java.lang.String |
getJavaInitializationString()
Returns a string for the property value.
|
java.lang.Object |
getValue() |
boolean |
isPaintable() |
void |
paintValue(java.awt.Graphics g,
java.awt.Rectangle clipRect) |
void |
propertyChange(java.beans.PropertyChangeEvent evt) |
void |
setValue(java.lang.Object value) |
boolean |
supportsCustomEditor()
Returns
true to indicate that we provide a custom editor
via the getCustomEditor() method. |
public PaintEditor()
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public boolean isPaintable()
isPaintable
in interface java.beans.PropertyEditor
isPaintable
in class java.beans.PropertyEditorSupport
public void paintValue(java.awt.Graphics g, java.awt.Rectangle clipRect)
paintValue
in interface java.beans.PropertyEditor
paintValue
in class java.beans.PropertyEditorSupport
public java.lang.Object getValue()
getValue
in interface java.beans.PropertyEditor
getValue
in class java.beans.PropertyEditorSupport
public void setValue(java.lang.Object value)
setValue
in interface java.beans.PropertyEditor
setValue
in class java.beans.PropertyEditorSupport
public java.lang.String getJavaInitializationString()
getJavaInitializationString
in interface java.beans.PropertyEditor
getJavaInitializationString
in class java.beans.PropertyEditorSupport
public java.awt.Component getCustomEditor()
Paint
instance.getCustomEditor
in interface java.beans.PropertyEditor
getCustomEditor
in class java.beans.PropertyEditorSupport
public boolean supportsCustomEditor()
true
to indicate that we provide a custom editor
via the getCustomEditor()
method.supportsCustomEditor
in interface java.beans.PropertyEditor
supportsCustomEditor
in class java.beans.PropertyEditorSupport
true
.