Package javascript.swing
Class JSColorChooser
- java.lang.Object
-
- javascript.swing.JSComponent
-
- javascript.swing.JSDropDown
-
- javascript.swing.JSColorChooser
-
public class JSColorChooser extends JSDropDown
The javax.swing.JColorChooser clone- Author:
- gianpiero.diblasi
-
-
Constructor Summary
Constructors Constructor Description JSColorChooser()
Creates the object
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChangeListener(ChangeListener listener)
Adds a change listenervoid
addExtraTab(java.lang.String title, JSAbstractColorExtraTabPanel panel)
Adds an extra tabColor
getSelectedColor()
Returns the selected colorboolean
getValueIsAdjusting()
Returns if the selected color is "adjusting"void
setCloseOnChange(boolean b)
Sets if the combobox has to be closed on changevoid
setEnabled(boolean b)
Clone of javax.swing.JComponent.setEnabledvoid
setOpacityVisible(boolean b)
Sets the visibility of the opacity selectorsvoid
setSelectedColor(Color color)
Sets the selected colorstatic void
showDialog(java.lang.String title, Color color, boolean opacityVisible, def.js.Array<JSAbstractColorExtraTabPanel> extraTabs, simulation.js.$Apply_1_Void<Color> response)
Shows a dialog to select the color-
Methods inherited from class javascript.swing.JSDropDown
computePopupPosition
-
Methods inherited from class javascript.swing.JSComponent
addChildEventListenerByQuery, addEventListener, appendChild, appendChildInTree, appendInBody, appendNodeChild, appendNodeChildInTree, clearChildContentByQuery, clearContent, cssAddClass, cssClassList, cssRemoveClass, cssToggleClass, getAttribute, getChildAttributeByIndex, getChildAttributeByQuery, getChildCount, getChildPropertyByQuery, getChilStyleByIndex, getChilStyleByQuery, getID, getProperty, getStyle, insertBefore, insertBeforeInTree, insertNodeBefore, insertNodeBeforeInTree, invoke, invokeInTree, prependChild, prependChildInTree, prependNodeChild, prependNodeChildInTree, removeAttribute, removeChildAttributeByQuery, removeFromBody, setAttribute, setBackground, setChildAttributeByIndex, setChildAttributeByQuery, setChildPropertyByQuery, setContent, setID, setProperty
-
-
-
-
Method Detail
-
addExtraTab
public void addExtraTab(java.lang.String title, JSAbstractColorExtraTabPanel panel)
Adds an extra tab- Parameters:
title
- The titlepanel
- The extra tab
-
getSelectedColor
public Color getSelectedColor()
Returns the selected color- Returns:
- The selected color
-
setSelectedColor
public void setSelectedColor(Color color)
Sets the selected color- Parameters:
color
- The selected color
-
setOpacityVisible
public void setOpacityVisible(boolean b)
Sets the visibility of the opacity selectors- Parameters:
b
- true to make the opacity selectors visible, false otherwise
-
getValueIsAdjusting
public boolean getValueIsAdjusting()
Returns if the selected color is "adjusting"- Returns:
- true if the selected color is adjusting, false otherwise
-
addChangeListener
public void addChangeListener(ChangeListener listener)
Adds a change listener- Parameters:
listener
- The listener
-
setEnabled
public void setEnabled(boolean b)
Description copied from class:JSComponent
Clone of javax.swing.JComponent.setEnabled- Overrides:
setEnabled
in classJSComponent
- Parameters:
b
- true to enable the button, false otherwise
-
setCloseOnChange
public void setCloseOnChange(boolean b)
Sets if the combobox has to be closed on change- Parameters:
b
- true to close the combobox on change, false otherwise
-
showDialog
public static void showDialog(java.lang.String title, Color color, boolean opacityVisible, def.js.Array<JSAbstractColorExtraTabPanel> extraTabs, simulation.js.$Apply_1_Void<Color> response)
Shows a dialog to select the color- Parameters:
title
- The titlecolor
- The initial color (it can be null)opacityVisible
- true to make the opacity selectors visible, false otherwiseextraTabs
- An associative key/value array of extra tabs (it can be null), key = title, value = the extra tabresponse
- The function to call on close
-
-