NextApp Echo2 Extras
v2.1.0

nextapp.echo2.extras.app
Class ColorSelect

java.lang.Object
  extended by nextapp.echo2.app.Component
      extended by nextapp.echo2.extras.app.ColorSelect
All Implemented Interfaces:
java.io.Serializable, nextapp.echo2.app.RenderIdSupport

public class ColorSelect
extends nextapp.echo2.app.Component

A visual hue/saturation/value-based color selection component to select RGB colors.

See Also:
Serialized Form

Field Summary
static java.lang.String COLOR_CHANGED_PROPERTY
           
static java.lang.String PROPERTY_DISPLAY_VALUE
           
static java.lang.String PROPERTY_HUE_WIDTH
           
static java.lang.String PROPERTY_SATURATION_HEIGHT
           
static java.lang.String PROPERTY_VALUE_WIDTH
           
 
Fields inherited from class nextapp.echo2.app.Component
CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
ColorSelect()
          Creates a new ColorSelect with an initially selected color of Color.WHITE.
ColorSelect(nextapp.echo2.app.Color color)
          Creates a new ColorSelect with the specified color initially selected.
 
Method Summary
 nextapp.echo2.app.Color getColor()
          Retrieves the selected color.
 nextapp.echo2.app.Extent getHueWidth()
          Retrieves the width of the hue selector (the spectrum gradient drawn on the right side of the ColorSelector).
 nextapp.echo2.app.Extent getSaturationHeight()
          Retrieves the height of the saturation/value selector (the saturation axis is vertical).
 nextapp.echo2.app.Extent getValueWidth()
          Retrieves the width of the saturation/value selector (the value axis is horizontal).
 boolean isDisplayValue()
          Sets whether the hex-triplet value, e.g., '#123abc' is displayed at the bottom of the ColorSelect.
 void processInput(java.lang.String inputName, java.lang.Object inputValue)
           
 void setColor(nextapp.echo2.app.Color newValue)
          Sets the selected color.
 void setDisplayValue(boolean newValue)
          Sets whether the hex-triplet value, e.g., '#123abc' is displayed at the bottom of the ColorSelect.
 void setHueWidth(nextapp.echo2.app.Extent newValue)
          Sets the width of the hue selector (the spectrum gradient drawn on the right side of the ColorSelector).
 void setSaturationHeight(nextapp.echo2.app.Extent newValue)
          Sets the height of the saturation/value selector (the saturation axis is vertical).
 void setValueWidth(nextapp.echo2.app.Extent newValue)
          Sets the width of the saturation/value selector (the value axis is horizontal).
 
Methods inherited from class nextapp.echo2.app.Component
add, add, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLOR_CHANGED_PROPERTY

public static final java.lang.String COLOR_CHANGED_PROPERTY
See Also:
Constant Field Values

PROPERTY_HUE_WIDTH

public static final java.lang.String PROPERTY_HUE_WIDTH
See Also:
Constant Field Values

PROPERTY_SATURATION_HEIGHT

public static final java.lang.String PROPERTY_SATURATION_HEIGHT
See Also:
Constant Field Values

PROPERTY_VALUE_WIDTH

public static final java.lang.String PROPERTY_VALUE_WIDTH
See Also:
Constant Field Values

PROPERTY_DISPLAY_VALUE

public static final java.lang.String PROPERTY_DISPLAY_VALUE
See Also:
Constant Field Values
Constructor Detail

ColorSelect

public ColorSelect()
Creates a new ColorSelect with an initially selected color of Color.WHITE.


ColorSelect

public ColorSelect(nextapp.echo2.app.Color color)
Creates a new ColorSelect with the specified color initially selected.

Parameters:
color - the initially selected color
Method Detail

getColor

public nextapp.echo2.app.Color getColor()
Retrieves the selected color.

Returns:
the selected color

getHueWidth

public nextapp.echo2.app.Extent getHueWidth()
Retrieves the width of the hue selector (the spectrum gradient drawn on the right side of the ColorSelector). Note that the height of the hue selector is determined by the height of the value selector. Values may only be specified in pixels. The default value is 20 pixels.

Returns:
the width

getSaturationHeight

public nextapp.echo2.app.Extent getSaturationHeight()
Retrieves the height of the saturation/value selector (the saturation axis is vertical). Values may only be specified in pixels. The default value is 150 pixels.

Returns:
the height

getValueWidth

public nextapp.echo2.app.Extent getValueWidth()
Retrieves the width of the saturation/value selector (the value axis is horizontal). Values may only be specified in pixels. The default value is 150 pixels.

Returns:
the width

isDisplayValue

public boolean isDisplayValue()
Sets whether the hex-triplet value, e.g., '#123abc' is displayed at the bottom of the ColorSelect. Default value is true.

Returns:
true if the hex-triplet value should be displayed

processInput

public void processInput(java.lang.String inputName,
                         java.lang.Object inputValue)
Overrides:
processInput in class nextapp.echo2.app.Component
See Also:
Component.processInput(java.lang.String, java.lang.Object)

setColor

public void setColor(nextapp.echo2.app.Color newValue)
Sets the selected color.

Parameters:
newValue - the new color

setDisplayValue

public void setDisplayValue(boolean newValue)
Sets whether the hex-triplet value, e.g., '#123abc' is displayed at the bottom of the ColorSelect. Default value is true.

Parameters:
newValue - true if the hex-triplet value should be displayed

setHueWidth

public void setHueWidth(nextapp.echo2.app.Extent newValue)
Sets the width of the hue selector (the spectrum gradient drawn on the right side of the ColorSelector). Note that the height of the hue selector is determined by the height of the value selector. Values may only be specified in pixels. The default value is 20 pixels.

Parameters:
newValue - the new width

setSaturationHeight

public void setSaturationHeight(nextapp.echo2.app.Extent newValue)
Sets the height of the saturation/value selector (the saturation axis is vertical). Values may only be specified in pixels. The default value is 150 pixels.

Parameters:
newValue - the new height

setValueWidth

public void setValueWidth(nextapp.echo2.app.Extent newValue)
Sets the width of the saturation/value selector (the value axis is horizontal). Values may only be specified in pixels. The default value is 150 pixels.

Parameters:
newValue - the new width

NextApp Echo2 Extras
v2.1.0