Class JaxoColorButton

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants

public class JaxoColorButton extends JButton
Button displaying a color selection - typically used in such a way that clicking it opens a color chooser to change the color.
Since:
2.0
See Also:
  • Constructor Details

    • JaxoColorButton

      public JaxoColorButton()
      with Color.black.
    • JaxoColorButton

      public JaxoColorButton(Color c)
      with the given color.
      Parameters:
      c - The color of the button.
  • Method Details

    • isOptional

      public final boolean isOptional()
      Current optional property.
      Returns:
      The current optional value.
    • setOptional

      public void setOptional(boolean value)
      Sets the optional property.
      Parameters:
      value - The value to set.
    • getColor

      public final Color getColor()
      Current color property.
      Returns:
      The current color.
    • setColor

      public void setColor(Color value)
      Sets the button color.
      Parameters:
      value - The color to set.
    • getChooserMode

      public final int getChooserMode()
      Returns the current chooser mode.
      Returns:
      The chooser mode.
      See Also:
    • setChooserMode

      public void setChooserMode(int value)
      Sets the current chooser mode.
      Parameters:
      value - The mode to set.
    • getChooserTitle

      public final String getChooserTitle()
      The title of the dialog.
      Returns:
      The title.
      See Also:
    • setChooserTitle

      public void setChooserTitle(String value)
      Sets the current chooser title.
      Parameters:
      value - The title.
    • getChooser

      public final JaxoColorChooser getChooser()
      Chooser to be shown to change the current color automatically on ActionEvents. The default is 'null'.
      Returns:
      The chooser.
    • setChooser

      public void setChooser(JaxoColorChooser value)
      Sets the chooser.
      Parameters:
      value - The chooser to set.
    • showChooser

      public void showChooser()
      Show the (existing) chooser programmatically, as if the button were clicked.
    • fireActionPerformed

      protected void fireActionPerformed(ActionEvent e)
      Apply an action event.
      Overrides:
      fireActionPerformed in class AbstractButton
      Parameters:
      e - the action event.