java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.pushingpixels.radiance.theming.internal.contrib.randelshofer.quaqua.colorchooser.Crayons
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class Crayons extends JPanel
A panel which displays a selection of color crayons. The user can click at a crayon to pick a color.
Version:
1.2 2006-04-23 Retrieve labels directly from UIManager.
1.1.1 2005-11-07 Get "labels" resource bundle from UIManager.
1.1 2005-08-30 Rearranged code to ease the creation of derived look and feels.
1.0 August 28, 2005 Created.
See Also:
  • Field Details

    • crayonsImage

      private BufferedImage crayonsImage
      Shared crayons image.
    • crayonXPoints

      private static final int[] crayonXPoints
      Coordinates of crayon shaped polygon.
    • crayonYPoints

      private static final int[] crayonYPoints
    • color

      private Color color
      Current color.
    • selectedCrayon

      private Crayons.Crayon selectedCrayon
      Selected crayon.
    • mouseHandler

      private Crayons.MouseHandler mouseHandler
    • crayons

      private Crayons.Crayon[] crayons
      Crayons.
  • Constructor Details

    • Crayons

      public Crayons()
      Creates a new instance.
  • Method Details

    • createCrayonsImage

      protected BufferedImage createCrayonsImage()
    • createCrayons

      protected Crayons.Crayon[] createCrayons()
      Creates the crayons.
      Returns:
      Array of crayons in z-order from bottom to top.
    • setColor

      public void setColor(Color newValue)
      Sets the current color. This results in a selection of a crayon, if a crayon with the same RGB values exists.
    • getColor

      public Color getColor()
      Returns the current color.
    • paintComponent

      public void paintComponent(Graphics gr)
      Overrides:
      paintComponent in class JComponent
    • initComponents

      private void initComponents()
      This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.