|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Dialog javax.swing.JDialog jwo.utils.gui.JWDialogue jwo.utils.gui.JWColourSelect
Creates a graphic colour selector. Colours can be chosen by (i) giving decimal RGB values; (ii) decimal HSV values; (iii) graphic selection of HSV.
Nested Class Summary |
Nested classes inherited from class javax.swing.JDialog |
JDialog.AccessibleJDialog |
Nested classes inherited from class java.awt.Dialog |
Dialog.AccessibleAWTDialog |
Nested classes inherited from class java.awt.Window |
Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class jwo.utils.gui.JWDialogue |
DIALOGUE, MONOLOGUE |
Fields inherited from class javax.swing.JDialog |
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JWColourSelect(Frame parentFrame)
Creates the dialogue layout for the colour selector with default (red) initial colour. |
|
JWColourSelect(Frame parentFrame,
Color initCol)
Creates the dialogue layout for the colour selector with the given initial colour. |
|
JWColourSelect(Frame parentFrame,
Color initCol,
JWColourListener colourListener)
Creates the dialogue layout for the colour selector with the given initial colour and colour listener. |
Method Summary | |
void |
actionPerformed(ActionEvent event)
Dynamically updates all colour text when return pressed in any text fields so that RGB and HSB values are consistent. |
void |
addColourListener(JWColourListener colourListener)
Adds a colour listener to be informed of user changes in colour. |
void |
focusGained(FocusEvent event)
Invoked when a text field gains the keyboard focus. |
void |
focusLost(FocusEvent event)
Invoked when a text field loses the keyboard focus. |
Color |
getColour()
Reports the currently selected colour. |
boolean |
removeColourListener(JWColourListener colourListener)
Removes a colour listener from those to be informed of changes in colour. |
void |
setColour(Color newColour)
Sets the currently selected colour to a given value. |
void |
stateChanged(ChangeEvent e)
Responds to a change in a slider by updating the alpha value. |
Methods inherited from class jwo.utils.gui.JWDialogue |
addDialogueListener, checkInput, closedown, getContentPane, isChanged, removeDialogueListener, setFullBackground |
Methods inherited from class java.awt.Dialog |
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JWColourSelect(Frame parentFrame)
parentFrame
- Frame that calls this selector.public JWColourSelect(Frame parentFrame, Color initCol)
parentFrame
- Frame that calls this selector.initCol
- Initial colour to be displayed in chooser.public JWColourSelect(Frame parentFrame, Color initCol, JWColourListener colourListener)
parentFrame
- Frame that calls this selector.initCol
- Initial colour to be displayed in chooser.colourListener
- Listener to be informed if colour is changed.Method Detail |
public void addColourListener(JWColourListener colourListener)
colourListener
- Colour listener to be informed of colour changes.public boolean removeColourListener(JWColourListener colourListener)
colourListener
- Colour listener to be removed.
public Color getColour()
public void setColour(Color newColour)
newColour
- New colour to store.public void actionPerformed(ActionEvent event)
actionPerformed
in interface ActionListener
event
- Event representing a change in a text field.public void focusLost(FocusEvent event)
focusLost
in interface FocusListener
event
- Focus event.public void focusGained(FocusEvent event)
focusGained
in interface FocusListener
event
- Focus event.public void stateChanged(ChangeEvent e)
stateChanged
in interface ChangeListener
e
- Slider change event.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |