|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echo.Component nextapp.echo.Container echopoint.EchoPointComponent echopoint.ColorChooser
The ColorChooser class can be used to allow the user to select colors from a series of sample color cells.
The class uses the ColorSelectionModel
interface to keep
track of the currently selected color. If no color is provided on the
the constructor, then Color.WHITE is used.
The class provides a default Color Preview Pane. A new Component can be
used. It should implement the ChangeListener
interface in order
to be notified when the ColorSelectionModel
has changed.
Nested Class Summary | |
static class |
ColorChooser.NestedStyleInfo
Nested public static StyleInfo class. |
Field Summary | |
static java.lang.String |
BORDER_COLOR_CHANGED_PROPERTY
|
static java.lang.String |
BORDER_SIZE_CHANGED_PROPERTY
|
protected nextapp.echo.Color |
borderColor
|
protected int |
borderSize
|
static java.lang.String |
CELL_HEIGHT_CHANGED_PROPERTY
|
static java.lang.String |
CELL_SPACING_CHANGED_PROPERTY
|
static java.lang.String |
CELL_SPACING_COLOR_CHANGED_PROPERTY
|
static java.lang.String |
CELL_WIDTH_CHANGED_PROPERTY
|
protected int |
cellHeight
|
static java.lang.String |
CELLS_PER_ROW_CHANGED_PROPERTY
|
protected int |
cellSpacing
|
protected nextapp.echo.Color |
cellSpacingColor
|
protected int |
cellsPerRow
|
protected int |
cellWidth
|
static java.lang.String |
COLOR_ARRAY_CHANGED_PROPERTY
|
protected nextapp.echo.Color[] |
colorArray
|
static int |
defaultCellHeight
Default cell height is 17 |
static int |
defaultCellSpacing
Default cell spacing is 2 |
static nextapp.echo.Color |
defaultCellSpacingColor
Default cell spacing color is Color.WHITE |
static int |
defaultCellsPerRow
Default number of cells per row is 8 |
static int |
defaultCellWidth
Default cell width is 17 |
static nextapp.echo.Color[] |
defaultColorArray
the default color array used by ColorChooser |
static nextapp.echo.Insets |
defaultInsets
Default Insets are 0 wide |
static int |
defaultWebSafeCellsPerRow
Default number of cells per row for the web safe color array is 18 |
protected nextapp.echo.Insets |
insets
|
static java.lang.String |
INSETS_CHANGED_PROPERTY
|
static java.lang.String |
PREVIEW_PANEL_CHANGED_PROPERTY
|
protected nextapp.echo.Component |
previewPanel
|
static java.lang.String |
SELECTION_MODEL_CHANGED_PROPERTY
|
protected ColorSelectionModel |
selectionModel
|
static java.lang.String |
STYLE_BORDER_COLOR
A style constant for the Border Color property. |
static java.lang.String |
STYLE_BORDER_SIZE
A style constant for the Border Size property. |
static java.lang.String |
STYLE_CELL_HEIGHT
A style constant for the Cell Height property. |
static java.lang.String |
STYLE_CELL_SPACING
A style constant for the Cell Spacing property. |
static java.lang.String |
STYLE_CELL_SPACING_COLOR
A style constant for the Cell Spacing Color property. |
static java.lang.String |
STYLE_CELL_WIDTH
A style constant for the Cell Width property. |
static java.lang.String |
STYLE_CELLS_PER_ROW
A style constant for the Cells Per Row property. |
static java.lang.String |
STYLE_INSETS
A style constant for the Insets property. |
static java.lang.String |
STYLE_SELECTED_COLOR
A style constant for the Selected Color property. |
static java.lang.String |
TITLE_CHANGED_PROPERTY
|
protected TitleBar |
titleBar
|
static nextapp.echo.Color[] |
web216ColorArray
This Color array consists of the web safe 216 colors in a table 18 cells by 13 rows. |
Fields inherited from class echopoint.EchoPointComponent |
STYLE_TOOL_TIP_TEXT, TOOL_TIP_TEXT_CHANGED_PROPERTY, toolTipPopUp |
Fields inherited from class nextapp.echo.Component |
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY |
Fields inherited from interface echopoint.positionable.MouseCursorable |
borderStyleSymbolics, CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, STYLE_MOUSE_CURSOR, STYLE_MOUSE_CURSOR_URI |
Constructor Summary | |
ColorChooser()
Constructs a ColorChooser with Color.WHITE selected |
|
ColorChooser(nextapp.echo.Color newSelectedColor)
Constructs a ColorChooser with newSelectedColor selected
using the ColorChooser.defaultColorArray color array. |
|
ColorChooser(nextapp.echo.Color newSelectedColor,
nextapp.echo.Color[] newColorArray)
Constructs a ColorChooser with newSelectedColor selected
and uses newColorArray to display sample color cells. |
Method Summary | |
void |
addChangeListener(nextapp.echo.event.ChangeListener l)
Adds a ChangeListener to the color chooser. |
void |
applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. |
protected nextapp.echo.event.ChangeListener |
createChangeListener()
Subclasses that want to handle ChangeEvents differently can override this to return a subclass of ModelListener or another ChangeListener implementation. |
nextapp.echo.Color |
getBorderColor()
|
int |
getBorderSize()
|
int |
getCellHeight()
|
int |
getCellSpacing()
|
nextapp.echo.Color |
getCellSpacingColor()
|
int |
getCellsPerRow()
|
int |
getCellWidth()
|
nextapp.echo.Color[] |
getColorArray()
|
nextapp.echo.Insets |
getInsets()
|
nextapp.echo.Component |
getPreviewPanel()
|
nextapp.echo.Color |
getSelectedColor()
|
ColorSelectionModel |
getSelectionModel()
|
TitleBar |
getTitle()
|
void |
removeChangeListener(nextapp.echo.event.ChangeListener l)
Removes a ChangeListener from this component. |
protected void |
reRegisterComponents(nextapp.echo.Component oldValue,
nextapp.echo.Component newValue)
|
java.lang.Object |
set(java.lang.reflect.Field field,
java.lang.Object newValue)
Called to save the old value of a field, set in a new value and return the old value of a field. |
void |
setBorderColor(nextapp.echo.Color newBorderColor)
Sets the border Color of the ColorChooser .
|
void |
setBorderSize(int newBorderSize)
Sets the border size of the ColorChooser .
|
void |
setCellHeight(int newHeight)
Sets the height of the ColorChooser sample color cells.
|
void |
setCellSpacing(int newSpacing)
Sets the spacing between the ColorChooser sample color cells.
|
void |
setCellSpacingColor(nextapp.echo.Color newCellSpacingColor)
Sets the Color of the ColorChooser sample color cells.
|
void |
setCellsPerRow(int newCellsPerRow)
Sets the number of cells per row of the ColorChooser sample color cells.
|
void |
setCellWidth(int newWidth)
Sets the width of the ColorChooser sample color cells.
|
void |
setColorArray(nextapp.echo.Color[] newColorArray)
Sets the Color[] array used by the ColorChooser to
display sample color cells.
|
void |
setInsets(nextapp.echo.Insets newValue)
Sets the Insets used by the ColorChooser
This methods fires a PropertyChangeEvent with a
getPropertyName() value of
ColorChooser.INSETS_CHANGED_PROPERTY |
void |
setPreviewPane(nextapp.echo.Component newPreviewPanel)
Sets the Component used by the ColorChooser as a preview panel.
|
void |
setSelectedColor(nextapp.echo.Color newSelectedColor)
Sets the currently selected Color of the ColorChooser
This methods causes the underlying ColorSelectionModel to
change. |
void |
setSelectedColor(int red,
int green,
int blue)
Sets the currently selected Color of the ColorChooser in RGB format.
|
void |
setSelectionModel(ColorSelectionModel newModel)
Sets the ColorSelectionModel model used by the ColorChooser .
|
void |
setTitle(java.lang.String newTitleText)
Sets the text of the title TitleBar used by the ColorChooser .
|
void |
setTitle(TitleBar newTitle)
Sets the title used by the ColorChooser .
|
void |
useDefaultColorArray()
Resets the Color array used by then ColorChooser to
ColorChooser.defaultColorArray and also changes the cells
per row settings to the default values. |
void |
useWebSafeDefaultColorArray()
Resets the Color array used by then ColorChooser to
ColorChooser.web216ColorArray and also changes the cells
per row settings to an appropriate value |
Methods inherited from class echopoint.EchoPointComponent |
getMouseCursor, getMouseCursorURI, getToolTipPopUp, getToolTipText, set, set, set, set, set, set, set, set, set, setEnabledAllChildren, setMouseCursor, setMouseCursorURI, setToolTipText, validate |
Methods inherited from class nextapp.echo.Component |
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String STYLE_BORDER_COLOR
nextapp.echo.Color.
public static final java.lang.String STYLE_BORDER_SIZE
Integer.
public static final java.lang.String STYLE_INSETS
nextapp.echo.Insets.
public static final java.lang.String STYLE_CELL_HEIGHT
Integer.
public static final java.lang.String STYLE_CELL_WIDTH
Integer.
public static final java.lang.String STYLE_CELL_SPACING
Integer.
public static final java.lang.String STYLE_CELL_SPACING_COLOR
nextapp.echo.Color.
public static final java.lang.String STYLE_CELLS_PER_ROW
Integer.
public static final java.lang.String STYLE_SELECTED_COLOR
nextapp.echo.Color.
public static final java.lang.String SELECTION_MODEL_CHANGED_PROPERTY
public static final java.lang.String PREVIEW_PANEL_CHANGED_PROPERTY
public static final java.lang.String COLOR_ARRAY_CHANGED_PROPERTY
public static final java.lang.String TITLE_CHANGED_PROPERTY
public static final java.lang.String BORDER_COLOR_CHANGED_PROPERTY
public static final java.lang.String BORDER_SIZE_CHANGED_PROPERTY
public static final java.lang.String INSETS_CHANGED_PROPERTY
public static final java.lang.String CELL_SPACING_COLOR_CHANGED_PROPERTY
public static final java.lang.String CELL_WIDTH_CHANGED_PROPERTY
public static final java.lang.String CELL_HEIGHT_CHANGED_PROPERTY
public static final java.lang.String CELL_SPACING_CHANGED_PROPERTY
public static final java.lang.String CELLS_PER_ROW_CHANGED_PROPERTY
public static final int defaultCellsPerRow
public static final int defaultWebSafeCellsPerRow
public static final int defaultCellWidth
public static final int defaultCellHeight
public static final int defaultCellSpacing
public static final nextapp.echo.Color defaultCellSpacingColor
public static final nextapp.echo.Insets defaultInsets
protected nextapp.echo.Color borderColor
protected int borderSize
protected nextapp.echo.Insets insets
protected int cellsPerRow
protected int cellWidth
protected int cellHeight
protected int cellSpacing
protected nextapp.echo.Color cellSpacingColor
protected nextapp.echo.Component previewPanel
protected nextapp.echo.Color[] colorArray
protected ColorSelectionModel selectionModel
public static final nextapp.echo.Color[] defaultColorArray
public static final nextapp.echo.Color[] web216ColorArray
The the last row is 9 white fillers followed by 9 white through grey to black colors.
protected TitleBar titleBar
Constructor Detail |
public ColorChooser()
ColorChooser
with Color.WHITE
selected
public ColorChooser(nextapp.echo.Color newSelectedColor)
ColorChooser
with newSelectedColor
selected
using the ColorChooser.defaultColorArray color array.
public ColorChooser(nextapp.echo.Color newSelectedColor, nextapp.echo.Color[] newColorArray)
ColorChooser
with newSelectedColor
selected
and uses newColorArray
to display sample color cells.
Method Detail |
public void addChangeListener(nextapp.echo.event.ChangeListener l)
ChangeListener
to the color chooser.
l
- The ChangeListener
to be added.public void applyStyle(nextapp.echo.Style style)
nextapp.echo.Component
style names can be used as well.
applyStyle
in interface MouseCursorable
applyStyle
in class EchoPointComponent
Component.applyStyle(nextapp.echo.Style)
protected nextapp.echo.event.ChangeListener createChangeListener()
public nextapp.echo.Color getBorderColor()
Color
of the ColorChooser's
border.public int getBorderSize()
ColorChooser's
border.public int getCellHeight()
ColorChooser's
sample color cells.public int getCellSpacing()
ColorChooser's
sample color cells.public nextapp.echo.Color getCellSpacingColor()
Color
of the ColorChooser's
sample color cells.public int getCellsPerRow()
ColorChooser's
sample color cells.public int getCellWidth()
ColorChooser's
sample color cells.public nextapp.echo.Color[] getColorArray()
Color[]
array used to display the ColorChooser's
sample color cells.public nextapp.echo.Insets getInsets()
Insets
(margins) of the ColorChooser
.public nextapp.echo.Component getPreviewPanel()
Component
currently used by the ColorChooser
.public nextapp.echo.Color getSelectedColor()
Color
of the ColorChooser
.public ColorSelectionModel getSelectionModel()
ColorSelectionModel
model of the ColorChooser
.public TitleBar getTitle()
ColorChooser
.public void removeChangeListener(nextapp.echo.event.ChangeListener l)
l
- the ChangeListener to removeprotected void reRegisterComponents(nextapp.echo.Component oldValue, nextapp.echo.Component newValue)
public void setBorderColor(nextapp.echo.Color newBorderColor)
Color
of the ColorChooser
.
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.BORDER_COLOR_CHANGED_PROPERTY
public void setBorderSize(int newBorderSize)
ColorChooser
.
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.BORDER_SIZE_CHANGED_PROPERTY
public void setCellHeight(int newHeight)
ColorChooser
sample color cells.
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.CELL_HEIGHT_CHANGED_PROPERTY
public void setCellSpacing(int newSpacing)
ColorChooser
sample color cells.
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.CELL_SPACING_CHANGED_PROPERTY
public void setCellSpacingColor(nextapp.echo.Color newCellSpacingColor)
Color
of the ColorChooser
sample color cells.
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.CELL_SPACING_COLOR_CHANGED_PROPERTY
public void setCellsPerRow(int newCellsPerRow)
ColorChooser
sample color cells.
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.CELLS_PER_ROW_CHANGED_PROPERTY
public void setCellWidth(int newWidth)
ColorChooser
sample color cells.
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.CELL_WIDTH_CHANGED_PROPERTY
public void setColorArray(nextapp.echo.Color[] newColorArray)
Color[]
array used by the ColorChooser
to
display sample color cells.
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.COLOR_ARRAY_CHANGED_PROPERTY
public void setInsets(nextapp.echo.Insets newValue)
Insets
used by the ColorChooser
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.INSETS_CHANGED_PROPERTY
public void setPreviewPane(nextapp.echo.Component newPreviewPanel)
Component
used by the ColorChooser
as a preview panel.
Component
should implement ChangeEventListener
and
then call addChangeListener
to ensure it is notified of changes to the
underlying ColorSelectionModel
model.
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.PREVIEW_PANEL_CHANGED_PROPERTY
public void setSelectedColor(int red, int green, int blue)
Color
of the ColorChooser
in RGB format.
ColorSelectionModel
to
change.
public void setSelectedColor(nextapp.echo.Color newSelectedColor)
Color
of the ColorChooser
ColorSelectionModel
to
change.
public void setSelectionModel(ColorSelectionModel newModel)
ColorSelectionModel
model used by the ColorChooser
.
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.SELECTION_MODEL_CHANGED_PROPERTY
public void setTitle(TitleBar newTitle)
ColorChooser
.
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.TITLE_CHANGED_PROPERTY
public void setTitle(java.lang.String newTitleText)
ColorChooser
.
PropertyChangeEvent
with a
getPropertyName()
value of
ColorChooser.TITLE_CHANGED_PROPERTY
public void useDefaultColorArray()
ColorChooser
to
ColorChooser.defaultColorArray and also changes the cells
per row settings to the default values.
public void useWebSafeDefaultColorArray()
ColorChooser
to
ColorChooser.web216ColorArray and also changes the cells
per row settings to an appropriate value
public java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue) throws java.lang.Exception
ReflectionSetter
public Object set(Field f, Object newValue) throws Exception { Object oldValue = f.get(this); f.set(this,newValue); return oldValue; }
field
- - the field to be setnewValue
- - the new value to be set
java.lang.Exception
ReflectionSetter.set(Field, Object)
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |