|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| 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.ColorChooserCombo
public class ColorChooserCombo
A JPanel that contains a MetalComboBoxButton which when clicked opens up a ColorChooserPanel. When a color is chosen a property change is fired to alert the parent of a new color.
ColorScheme,
ColorSchemePanel,
ColorChooserPanel,
Serialized Form| Nested 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 ColorChooserPanel |
colorChooser
|
protected JPopupMenu |
colorPopup
|
protected MetalComboBoxButton |
comboButton
|
protected GridBagLayout |
gridBagLayout1
|
protected boolean |
initialize
|
protected boolean |
popupShown
|
protected Color |
selectedColor
|
protected String |
selectedColorName
|
| 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 | |
|---|---|
ColorChooserCombo()
Initializes variables. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
When Someone chooses a color on the ColorSchemePanel hide the ColorChooserPanel. |
void |
commitEdits()
Implements abstract method in dsto.dfc.swing.forms.AbstractFormEditor. |
Color |
getColor()
Get the currently selected Color. |
String |
getColorName()
Get the currently selected Color's Name. |
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 |
removeNotify()
Overrides JComponents method and hides this component first. |
void |
setBackground(Color bg)
Sets the background color for comboButton. |
void |
setColor(Color c)
Set the selected color to c. |
void |
setColorName(String n)
Set the selected color's name. |
void |
setEditorValue(Object value)
Implements abstract method in dsto.dfc.swing.forms.AbstractFormEditor. |
void |
setEnabled(boolean aFlag)
Overrides JComponents method, so that we can enable/disable the comboButton. |
void |
setFont(Font font)
Sets the font for comboButton. |
void |
setForeground(Color fg)
Sets the foreground color for comboButton. |
void |
setOpaque(boolean isOpaque)
Sets the opaque property for comboButton. |
void |
setToolTipText(String text)
Sets the ToolTipText for comboButton. |
void |
setVisible(boolean aFlag)
Overrides JComponents method and hides this component first. |
| 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 boolean popupShown
protected boolean initialize
protected JPopupMenu colorPopup
protected GridBagLayout gridBagLayout1
protected ColorChooserPanel colorChooser
protected Color selectedColor
protected String selectedColorName
protected MetalComboBoxButton comboButton
| Constructor Detail |
|---|
public ColorChooserCombo()
| Method Detail |
|---|
public void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic Color getColor()
public void setColor(Color c)
public String getColorName()
public void setColorName(String n)
public boolean isDirectEdit()
isDirectEdit in interface FormEditorisDirectEdit in class AbstractFormEditorComponent
public void setEditorValue(Object value)
throws IllegalFormatException
setEditorValue in interface FormEditorsetEditorValue in class AbstractFormEditorComponentvalue - 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 FormEditorgetEditorValue in class AbstractFormEditorComponentIllegalFormatException
public void commitEdits()
throws IllegalFormatException
commitEdits in interface FormEditorcommitEdits in class AbstractFormEditorComponentIllegalFormatException - 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 void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic void setBackground(Color bg)
setBackground in class JComponentpublic void setForeground(Color fg)
setForeground in class JComponentpublic void setFont(Font font)
setFont in class JComponentpublic void setOpaque(boolean isOpaque)
setOpaque in class JComponentpublic void setToolTipText(String text)
setToolTipText in class JComponentpublic void setEnabled(boolean aFlag)
setEnabled in class JComponentpublic void setVisible(boolean aFlag)
setVisible in class JComponentpublic void removeNotify()
removeNotify in class JComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||