Search this API

y.option
Class ColorOptionItem

java.lang.Object
  extended by y.option.OptionItem
      extended by y.option.ObjectOptionItem
          extended by y.option.ColorOptionItem
All Implemented Interfaces:
AttributeOwner, BackupValueOwner, PropertyChangeReporter, VetoableChangeReporter

public class ColorOptionItem
extends ObjectOptionItem

An option item for Color values.

 

Field Summary
static java.lang.String ATTRIBUTE_ALLOW_TEXT_INPUT
          Attribute key used to store an editor hint specifying whether or not a text input component is made available in addition to the default popup menu.
static java.lang.String ATTRIBUTE_DISPLAY_HEX_VALUES
          Attribute key used to store an editor hint specifying whether colors are displayed as hexadecimal values instead of decimal tuples.
static java.lang.String ATTRIBUTE_SHOW_ALPHA
          Attribute key used to store an editor hint specifying whether alpha values should be editable.
static java.lang.String ATTRIBUTE_SHOW_MORE_COLORS
          Attribute key used to store an editor hint specifying whether a chooser for all color values should be provided.
static java.lang.String ATTRIBUTE_SHOW_MRU_COLORS
          Attribute key used to store an editor hint specifying whether a chooser for most recently used colors should be provided.
static java.lang.String ATTRIBUTE_SHOW_NO_COLOR
          Attribute key used to store an editor hint specifying whether a null color (e.g. to be interpreted as transparency) should be provided.
static java.lang.String ATTRIBUTE_SHOW_SOME_COLORS
          Attribute key used to store an editor hint specifying whether a chooser a for small subset of frequently used colors should be provided.
static java.lang.String ATTRIBUTE_USE_ICON_AS_TRIGGER
          Attribute key used to store an editor hint specifying whether or not the color display icon used with text input serves to open the default popup menu.
 
Fields inherited from class y.option.OptionItem
ATTRIBUTE_CONTEXT, ATTRIBUTE_GROUPS, ATTRIBUTE_LONG_DESCRIPTION, COLOR_UNDEFINED, name, PROPERTY_CLASS_TYPE, PROPERTY_ENABLED, PROPERTY_TIP_TEXT, PROPERTY_VALUE, PROPERTY_VALUE_UNDEFINED, UNDEFINED
 
Constructor Summary
ColorOptionItem(java.lang.String name, java.awt.Color value)
          Creates a new instance of ColorOptionItem.
ColorOptionItem(java.lang.String name, java.awt.Color value, boolean showNoColor, boolean showSomeColors, boolean showMostRecentlyUsedColors, boolean showMoreColors)
          Creates a new instance of ColorOptionItem.
 
Method Summary
 java.lang.String getType()
          Returns "Color".
 boolean isShowMoreColors()
          Returns true, if the editor will provide a color chooser for all colors.
 boolean isShowMostRecentlyUsedColors()
          Returns true, if the editor will provide a color chooser popup for the most recently used colors.
 boolean isShowNoColor()
          Returns true, if the editor will allow to specify a null color.
 boolean isShowSomeColors()
          Returns true, if the editor will provide a color chooser popup for some colors.
 void setValue(java.lang.Object value)
          Sets the value of this option item.
 
Methods inherited from class y.option.ObjectOptionItem
getBackupValue, getValue, resetValue
 
Methods inherited from class y.option.OptionItem
addEditor, addEditorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, adoptEditorValue, checkEditorValue, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getAttribute, getClassType, getEditor, getEditor, getEditors, getName, getStringValue, getTipText, isEnabled, isValueUndefined, publishEnabled, publishValue, publishValueUndefined, removeAttribute, removeEditor, removeEditorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener, setAttribute, setClassType, setEnabled, setStringValue, setTipText, setValueUndefined, wantsVisibleName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_SHOW_ALPHA

public static final java.lang.String ATTRIBUTE_SHOW_ALPHA
Attribute key used to store an editor hint specifying whether alpha values should be editable. Values have to be of type Boolean. By default this attribute is set to false.

See Also:
Constant Field Values

ATTRIBUTE_SHOW_SOME_COLORS

public static final java.lang.String ATTRIBUTE_SHOW_SOME_COLORS
Attribute key used to store an editor hint specifying whether a chooser a for small subset of frequently used colors should be provided. Values have to be of type Boolean. By default this attribute is set to false.

See Also:
Constant Field Values

ATTRIBUTE_SHOW_MRU_COLORS

public static final java.lang.String ATTRIBUTE_SHOW_MRU_COLORS
Attribute key used to store an editor hint specifying whether a chooser for most recently used colors should be provided. Values have to be of type Boolean. By default this attribute is set to false.

See Also:
Constant Field Values

ATTRIBUTE_SHOW_MORE_COLORS

public static final java.lang.String ATTRIBUTE_SHOW_MORE_COLORS
Attribute key used to store an editor hint specifying whether a chooser for all color values should be provided. Values have to be of type Boolean. By default this attribute is set to true.

See Also:
Constant Field Values

ATTRIBUTE_SHOW_NO_COLOR

public static final java.lang.String ATTRIBUTE_SHOW_NO_COLOR
Attribute key used to store an editor hint specifying whether a null color (e.g. to be interpreted as transparency) should be provided. Values have to be of type Boolean. By default this attribute is set to false.

See Also:
Constant Field Values

ATTRIBUTE_DISPLAY_HEX_VALUES

public static final java.lang.String ATTRIBUTE_DISPLAY_HEX_VALUES
Attribute key used to store an editor hint specifying whether colors are displayed as hexadecimal values instead of decimal tuples. Values have to be of type Boolean. By default this attribute is set to false.

See Also:
Constant Field Values

ATTRIBUTE_ALLOW_TEXT_INPUT

public static final java.lang.String ATTRIBUTE_ALLOW_TEXT_INPUT
Attribute key used to store an editor hint specifying whether or not a text input component is made available in addition to the default popup menu. Values have to be of type Boolean. By default this attribute is set to false.

See Also:
Constant Field Values

ATTRIBUTE_USE_ICON_AS_TRIGGER

public static final java.lang.String ATTRIBUTE_USE_ICON_AS_TRIGGER
Attribute key used to store an editor hint specifying whether or not the color display icon used with text input serves to open the default popup menu. Values have to be of type Boolean. By default this attribute is set to false.

See Also:
Constant Field Values
Constructor Detail

ColorOptionItem

public ColorOptionItem(java.lang.String name,
                       java.awt.Color value)
Creates a new instance of ColorOptionItem.

Parameters:
name - the name of this item
value - the initial Color value

ColorOptionItem

public ColorOptionItem(java.lang.String name,
                       java.awt.Color value,
                       boolean showNoColor,
                       boolean showSomeColors,
                       boolean showMostRecentlyUsedColors,
                       boolean showMoreColors)
Creates a new instance of ColorOptionItem.

Parameters:
name - the name of this item
value - the initial Color value
showNoColor - the editor will allow to specify a null color.
showSomeColors - the editor will provide a color chooser popup for some colors
showMostRecentlyUsedColors - the editor will provide a color chooser popup for the most recently used colors
showMoreColors - the editor will provide a color chooser for all colors
Method Detail

getType

public java.lang.String getType()
Returns "Color".

Overrides:
getType in class ObjectOptionItem

setValue

public void setValue(java.lang.Object value)
Sets the value of this option item.

Overrides:
setValue in class ObjectOptionItem
Throws:
java.lang.IllegalArgumentException - if the specified value is not of type Color
See Also:
OptionItem.publishValue(Object)

isShowNoColor

public boolean isShowNoColor()
Returns true, if the editor will allow to specify a null color.


isShowSomeColors

public boolean isShowSomeColors()
Returns true, if the editor will provide a color chooser popup for some colors.


isShowMostRecentlyUsedColors

public boolean isShowMostRecentlyUsedColors()
Returns true, if the editor will provide a color chooser popup for the most recently used colors.


isShowMoreColors

public boolean isShowMoreColors()
Returns true, if the editor will provide a color chooser for all colors.


© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.