public class SwingColorWidget extends SwingInputWidget<ColorRGB> implements ActionListener, ColorWidget<JPanel>
| Modifier and Type | Field and Description |
|---|---|
protected static String |
RGB_CLASS_NAME |
protected static String |
SWATCHES_CLASS_NAME |
| Constructor and Description |
|---|
SwingColorWidget() |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e) |
void |
doRefresh()
Performs the intended
AbstractUIInputWidget.refreshWidget() operation. |
ColorRGB |
getValue()
Gets the current widget value.
|
void |
set(WidgetModel model)
Associates the given data object with this plugin.
|
static Color |
showColorDialog(Component component,
String title,
Color initialColor)
This method is identical to
JColorChooser.showDialog(Component, String, Color) except that it
reorders the panels of the color chooser to be more desirable. |
boolean |
supports(WidgetModel model)
Gets whether this object is compatible with the given data object.
|
getComponent, getComponentType, setToolTip, uirefreshWidget, uiget, updateModelgetInfo, getPriority, setInfo, setPriority, toStringcontext, getContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitget, getType, isLabeled, isMessage, refreshWidget, updateModelgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersiongetComponent, getComponentTypeprotected static final String RGB_CLASS_NAME
protected static final String SWATCHES_CLASS_NAME
public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic ColorRGB getValue()
InputWidgetgetValue in interface InputWidget<ColorRGB,JPanel>public void set(WidgetModel model)
WrapperPluginTyped.supports(T) must return true).set in interface WrapperPlugin<WidgetModel>set in interface InputWidget<ColorRGB,JPanel>set in class SwingInputWidget<ColorRGB>model - The data object to associate with the plugin.public boolean supports(WidgetModel model)
Typed
By default, this method will return true iff the data is assignable
to the associated type given by Typed.getType(). But individual
implementations may have other requirements beyond class assignability.
supports in interface Typed<WidgetModel>supports in interface InputWidget<ColorRGB,JPanel>supports in class AbstractInputWidget<ColorRGB,JPanel>public static Color showColorDialog(Component component, String title, Color initialColor) throws HeadlessException
JColorChooser.showDialog(Component, String, Color) except that it
reorders the panels of the color chooser to be more desirable. It uses
(HSB, RGB, Swatches) rather than the default of (Swatches, HSB, RGB).HeadlessExceptionpublic void doRefresh()
AbstractUIInputWidgetAbstractUIInputWidget.refreshWidget() operation.doRefresh in class AbstractUIInputWidget<ColorRGB,JPanel>Copyright © 2015–2022 SciJava. All rights reserved.