Class JSColorChooser


  • public class JSColorChooser
    extends JSDropDown
    The javax.swing.JColorChooser clone
    Author:
    gianpiero.diblasi
    • Constructor Detail

      • JSColorChooser

        public JSColorChooser()
        Creates the object
    • Method Detail

      • addExtraTab

        public void addExtraTab​(java.lang.String title,
                                JSAbstractColorExtraTabPanel panel)
        Adds an extra tab
        Parameters:
        title - The title
        panel - 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 class JSComponent
        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 title
        color - The initial color (it can be null)
        opacityVisible - true to make the opacity selectors visible, false otherwise
        extraTabs - An associative key/value array of extra tabs (it can be null), key = title, value = the extra tab
        response - The function to call on close