com.togethersoft.openapi.ide.inspector.util.editors.color
Class SwingColorEditor

java.lang.Object
  |
  +--java.beans.PropertyEditorSupport
        |
        +--com.togethersoft.openapi.ide.inspector.util.editors.SwingEditorSupport
              |
              +--com.togethersoft.openapi.ide.inspector.util.editors.color.SwingColorEditor

public class SwingColorEditor
extends SwingEditorSupport

Represents editor which allows to select color.

Author:
TogetherSoft

Fields inherited from class com.togethersoft.openapi.ide.inspector.util.editors.SwingEditorSupport
MEDIUM_DIMENSION, panel, SMALL_DIMENSION

Constructor Summary
SwingColorEditor()
           Creates this editor.

Method Summary
 voideditorChangeValue(Object obj)
           Changes value of this editor.
 StringgetAsText()
           Returns color in a String representation.
 StringgetJavaInitializationString()
           
 SwingColorEditorgetSwingColorEditor()
           Returns this editor.
 booleanisPaintable()
           Checks whether this editor is paintable.
 voidpaintValue(Graphics g, Rectangle rectangle)
           Paints color chooser as the small colored rectangle.
 voidsetAsText(String s)
           Sets RGB color value as a number string.
 voidsetValue(Object obj)
           Sets value to this editor as an Object.
 static ColorshowColorChooserDialog(Color color)
           Shows dialog with this editor and buttons.

Methods inherited from class com.togethersoft.openapi.ide.inspector.util.editors.SwingEditorSupport
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCustomEditor, init, removeCellEditorListener, setAlignment, supportsCustomEditor

Methods inherited from class java.beans.PropertyEditorSupport
getValue, getTags, addPropertyChangeListener, removePropertyChangeListener, firePropertyChange

Methods inherited from class java.lang.Object
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize

Constructor Detail

SwingColorEditor

public SwingColorEditor()
Creates this editor.
Method Detail

editorChangeValue

public void editorChangeValue(Object obj)
Changes value of this editor.
Parameters:
obj - has to be instance of the Color, if null then sets empty value

getAsText

public String getAsText()
Returns color in a String representation. This string contains RGB numbers.

getJavaInitializationString

public String getJavaInitializationString()

getSwingColorEditor

public SwingColorEditor getSwingColorEditor()
Returns this editor.

isPaintable

public boolean isPaintable()
Checks whether this editor is paintable.
Returns: Always true

paintValue

public void paintValue(Graphics g, Rectangle rectangle)
Paints color chooser as the small colored rectangle.

setAsText

public void setAsText(String s)
throws java.lang.IllegalArgumentException
Sets RGB color value as a number string.

setValue

public void setValue(Object obj)
Sets value to this editor as an Object.

showColorChooserDialog

public static Color showColorChooserDialog(Color color)
Shows dialog with this editor and buttons.
Parameters:
color - initial color value for this editor

Association Links

to Class java.awt.Color

to Class javax.swing.JTextField

to Class javax.swing.JButton

to Class java.awt.Color

to Class com.togethersoft.openapi.ide.inspector.util.editors.color.SwingColorEditor.ChooserComboButton