public class JaxoColorChooser extends java.lang.Object implements JaxoLocalized
Constructor and Description |
---|
JaxoColorChooser(java.awt.Component parentc)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener l)
ChangeEvents will be fired everytime the selected color
is changed when the color chooser is on the screen.
|
protected void |
createComponents()
Sets up all components of this color chooser.
|
void |
dispose()
Dispose existing cached components.
|
protected void |
fireStateChanged()
Notifies all listeners of a state change.
|
java.awt.Color |
getColor()
The currently selected color (or null) - updated while
the chooser is shown.
|
java.lang.String |
getDialogTitle()
Dialog title - if null (default), a default title will be chosen.
|
int |
getMode()
The colors that can be chosen.
|
boolean |
hasChanged()
Determines if the color was changed the last time it was shown.
|
boolean |
isAdjusting()
Determines if the color change is temporary.
|
boolean |
isCancelled()
Determines if the chooser was cancelled the last time it was shown.
|
boolean |
isOptional()
Current optional property.
|
boolean |
isPermanent()
Whether the chooser stays alive after showing for further requests.
|
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Removes a change listener.
|
void |
setColor(java.awt.Color value)
Set color to be displayed.
|
void |
setDialogTitle(java.lang.String value)
Sets the dialog title.
|
void |
setMode(int value)
Sets the current mode.
|
void |
setOptional(boolean value)
Sets the optional property.
|
void |
setOptionalColor(java.awt.Color value)
Sets the optional and color properties.
|
void |
setPermanent(boolean value)
Whether the chooser stays alive after showing for further requests.
|
void |
show()
See the variant that takes a Location argument, which here
is taken to be JaxoUtils.RelativeTo('parent').
|
void |
show(Location l)
Brings up a color chooser menu to select the color of the
specified JaxoObject.
|
void |
updateLanguage()
Updates the component with the current language as set in the
preferences (
JaxoPrefs.PREF_LANGUAGE ). |
public JaxoColorChooser(java.awt.Component parentc)
parentc
- Component to take as context for the dialog.public void dispose()
isPermanent()
public void addChangeListener(javax.swing.event.ChangeListener l)
l
- The listener to add.public void removeChangeListener(javax.swing.event.ChangeListener l)
l
- The listener to remove.protected void fireStateChanged()
public void setColor(java.awt.Color value)
value
- color to set.public java.awt.Color getColor()
public final boolean isOptional()
public void setOptional(boolean value)
value
- The value to set.public void setOptionalColor(java.awt.Color value)
value
- The color to set.public final boolean isAdjusting()
public boolean isCancelled()
public boolean hasChanged()
public final int getMode()
JaxoColor.JAXO_COLORS_MODE
.public void setMode(int value)
value
- The mode to set.public void updateLanguage()
JaxoPrefs.PREF_LANGUAGE
).updateLanguage
in interface JaxoLocalized
public final boolean isPermanent()
dispose()
public void setPermanent(boolean value)
value
- True if the chooser is permanent.public final java.lang.String getDialogTitle()
public void setDialogTitle(java.lang.String value)
value
- The dialog title to set.protected void createComponents()
public void show()
public void show(Location l)
l
- The location of the dialog.Licensed under GPL. For more information, see http://jaxodraw.sourceforge.net/license.html or the LICENSE file in the jaxodraw distribution.