|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
dsto.dfc.swing.forms.AbstractFormEditorComponent
dsto.dfc.swing.controls.ColorChooserPanel
public class ColorChooserPanel
This is the main Panel. Contains a ColorSchemePanel and other components. It is the User Interface for the Color Scheme Chooser that displays different schemes of color as ToolButtons. It can be placed inside any Frame or other Panel to be used. Whenever a color is selected a propertyChangeEvent is fired with the property name "color".
ColorScheme
,
ColorSchemePanel
,
ColorChooserCombo
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected ToolButton |
BackwardToolButton
|
protected BorderLayout |
borderLayout1
|
protected List |
colorschemeList
|
protected JLabel |
colorSchemeName
|
protected ToolButton |
colorsToolButton
|
protected int |
currentScheme
|
protected ToolButton |
ForwardToolButton
|
protected GridBagLayout |
gridBagLayout1
|
protected Color |
selectedColor
|
protected ColorSchemePanel |
selectorPanel
|
protected JPanel |
titlePanel
|
Fields inherited from class dsto.dfc.swing.forms.AbstractFormEditorComponent |
---|
description |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ColorChooserPanel()
Initializes variables and creates the predefined color schemes. |
|
ColorChooserPanel(List colorschemeList)
Uses a user defined List of colorschemeList instead of the predefined ones. |
Method Summary | |
---|---|
void |
commitEdits()
Implements abstract method in dsto.dfc.swing.forms.AbstractFormEditor. |
protected void |
disarm()
Disarms the "Other..." button and calls disarm () on the ColorSchemePanel. |
void |
displayNextScheme(String direction)
Determines if the next or previous scheme should be displayed, and Calls displayScheme (currentScheme) on the ColorSchemePanel. |
Color |
getColor()
Return the chosen color. |
List |
getColorSchemeList()
Return the List of colorschemeList. |
ColorSchemePanel |
getColorSchemePanel()
Returns the instance of ColorSchemePanel. |
Object |
getEditorValue()
Implements abstract method in dsto.dfc.swing.forms.AbstractFormEditor. |
boolean |
isDirectEdit()
Implements abstract method in dsto.dfc.swing.forms.AbstractFormEditor. |
void |
propertyChange(PropertyChangeEvent evt)
Assigns the event new value to selectedColor. |
void |
setColor(Color c)
Sets the selected color to c. |
protected void |
setColorButton()
Sets the "More Colors..." button's icon to the color chosen in the JColorChooser. |
void |
setEditorValue(Object value)
Implements abstract method in dsto.dfc.swing.forms.AbstractFormEditor. |
void |
setScheme(int current)
Sets the scheme to be loaded as the scheme the current color belongs to. |
void |
setSelectedButton(Color color)
Calls the ColorSchemePanel to set the selected color button. |
Methods inherited from class dsto.dfc.swing.forms.AbstractFormEditorComponent |
---|
addFormEditorListener, fireEditComitted, fireEditCommitRequested, fireEditCommitted, getEditorComponent, getEditorDescription, getPreferredValueType, removeFormEditorListener, setEditorDescription, setObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.beans.Customizer |
---|
addPropertyChangeListener, removePropertyChangeListener |
Field Detail |
---|
protected int currentScheme
protected ToolButton colorsToolButton
protected JPanel titlePanel
protected ToolButton BackwardToolButton
protected ToolButton ForwardToolButton
protected JLabel colorSchemeName
protected ColorSchemePanel selectorPanel
protected GridBagLayout gridBagLayout1
protected BorderLayout borderLayout1
protected Color selectedColor
protected List colorschemeList
Constructor Detail |
---|
public ColorChooserPanel()
public ColorChooserPanel(List colorschemeList)
Method Detail |
---|
public List getColorSchemeList()
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public Color getColor()
public void setColor(Color c)
public void setScheme(int current)
public void setSelectedButton(Color color)
public boolean isDirectEdit()
isDirectEdit
in interface FormEditor
isDirectEdit
in class AbstractFormEditorComponent
public void setEditorValue(Object value) throws IllegalFormatException
setEditorValue
in interface FormEditor
setEditorValue
in class AbstractFormEditorComponent
value
- The value to display.
IllegalFormatException
- if the value was not in the
correct format for display by this editor. The source specified
by the exception should be this FormEditor instance or a child.public Object getEditorValue() throws IllegalFormatException
getEditorValue
in interface FormEditor
getEditorValue
in class AbstractFormEditorComponent
IllegalFormatException
public void commitEdits() throws IllegalFormatException
commitEdits
in interface FormEditor
commitEdits
in class AbstractFormEditorComponent
IllegalFormatException
- if the commit failed because of
an illegal input or other error. The source specified by the
exception should be the FormEditor instance that caused the error
(ie either this editor or a child).public ColorSchemePanel getColorSchemePanel()
public void displayNextScheme(String direction)
direction
- Can be backward or forward.protected void setColorButton()
protected void disarm()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |