All Implemented Interfaces:
ActionListener, MouseListener, MouseMotionListener, MouseWheelListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener

A color wheel showing a Red, Yellow, Blue color model traditionally used by graphic artists. $Revision: 2254 $
See Also:
  • Field Details

    • MONOCHROMATIC_SCHEME

      public static final int MONOCHROMATIC_SCHEME
      See Also:
    • CONTRASTING_SCHEME

      public static final int CONTRASTING_SCHEME
      See Also:
    • SOFT_CONTRAST_SCHEME

      public static final int SOFT_CONTRAST_SCHEME
      See Also:
    • DOUBLE_CONTRAST_SCHEME

      public static final int DOUBLE_CONTRAST_SCHEME
      See Also:
    • ANALOGIC_SCHEME

      public static final int ANALOGIC_SCHEME
      See Also:
    • CTRL_ADJUST

      public static final int CTRL_ADJUST
      See Also:
    • ALWAYS_ADJUST

      public static final int ALWAYS_ADJUST
      See Also:
    • NEVER_ADJUST

      public static final int NEVER_ADJUST
      See Also:
    • hueEdit

      protected JTextField hueEdit
    • satEdit

      protected JTextField satEdit
    • brightEdit

      protected JTextField brightEdit
    • baseColorEdit

      protected JTextField baseColorEdit
    • pickerImage

      protected BufferedImage pickerImage
    • imagePicker

      protected ColorWheelPanel.ColorWheel imagePicker
    • fixedPanel

      protected JPanel fixedPanel
    • resetBtn

      protected JButton resetBtn
    • brightnessSlider

      protected JSlider brightnessSlider
    • saturationSlider

      protected JSlider saturationSlider
    • baseColorLabel

      protected JLabel baseColorLabel
    • innerCircle

      protected Ellipse2D innerCircle
    • outerCircle

      protected Ellipse2D outerCircle
    • borderCircle

      protected Ellipse2D borderCircle
    • useWebColors

      protected JCheckBox useWebColors
    • decimalRGB

      protected JCheckBox decimalRGB
    • fontSmall

      protected Font fontSmall
    • chooserColor

      protected ModelColor chooserColor
    • selectedIttenColours

      protected ModelColor[] selectedIttenColours
    • values

      private float[] values
    • h

      private double h
    • s

      private double s
    • b

      private double b
    • colorScheme

      private int colorScheme
    • busy

      private boolean busy
    • displayScheme

      private boolean displayScheme
    • hasChooser

      private boolean hasChooser
    • changeListeners

      private ArrayList<ChangeListener> changeListeners
    • arcDelta

      private static double[] arcDelta
    • ringThickness

      private double ringThickness
    • paths

      private GeneralPath[] paths
    • labelBundle

      private static ResourceBundle labelBundle
    • rolloverPath

      private GeneralPath rolloverPath
    • selectedPath

      private GeneralPath selectedPath
    • showRollovers

      private boolean showRollovers
    • rolloverColor

      private Color rolloverColor
    • selectedColor

      private Color selectedColor
    • systemColor

      private Color systemColor
    • fontFamily

      private String fontFamily
    • adjustWheel

      private int adjustWheel
    • adjustRollover

      private boolean adjustRollover
    • ctrlKeyDown

      private boolean ctrlKeyDown
    • saturationMultipler

      private double saturationMultipler
    • brightnessMultipler

      private double brightnessMultipler
  • Constructor Details

    • ColorWheelPanel

      public ColorWheelPanel()
      Creates a new instance of ColorWheelPanel
  • Method Details

    • setSelectedColors

      public void setSelectedColors(ModelColor[] clrs)
      Set the reference to the selected colours for the colour scheme
      Parameters:
      clrs - the colors
    • addChangeListener

      public void addChangeListener(ChangeListener l)
      Add a listener for changes in the selected color
      Parameters:
      l - the change listener to add
    • removeChangeListener

      public void removeChangeListener(ChangeListener l)
      Remove a change listener
      Parameters:
      l - the change listener to remove
    • useDecimalRGB

      public boolean useDecimalRGB()
      Has the user selected the use decimal rgb checkbox?
      Returns:
      true if decimal rgb values are to be shown
    • useWebColors

      public boolean useWebColors()
      Has the user selected the use web safe colors checkbox?
      Returns:
      true if only web safe colors are to be shown
    • setDisplayScheme

      public void setDisplayScheme(boolean disp)
      Set the display of the color scheme markers.
      Parameters:
      disp - true to display the color scheme markers.
    • getHue

      public int getHue()
      Get the selected colors hue
      Returns:
      the selected hue in the range 0-255
    • setHue

      public void setHue(int h)
      Set the selected hue
      Parameters:
      h - the selected hue in the range 0-255
    • getSaturation

      public int getSaturation()
      Get the selected colors saturation
      Returns:
      the selected saturation in the range 0-255
    • getBrightness

      public int getBrightness()
      Get the selected colors brightness
      Returns:
      the selected brightness in the range 0-255
    • setColorScheme

      public void setColorScheme(int scheme)
      Set the Itten color scheme to use
      Parameters:
      scheme -
      • -1 for no scheme display
      • 0 for a monchromatic color scheme: MONOCHROMATIC_SCHEME
      • 1 for a contrasting color scheme: CONTRASTING_SCHEME
      • 2 for a soft-contrasting color scheme: SOFT_CONTRAST_SCHEME
      • 3 for a double contrasting color scheme: DOUBLE_CONTRAST_SCHEME
      • 4 for a analogical color scheme: ANALOGIC_SCHEME
    • moveHue

      boolean moveHue(Point pt)
      Change the hue to match the angle identified by the point (in the inner circle).
      Parameters:
      pt - the point within the inner circle
    • getAngle

      private int getAngle(Point pt)
    • setColor

      public void setColor(Color c)
    • getColor

      public Color getColor()
      Get the selected color
      Returns:
      the color
    • getChooserColour

      public ModelColor getChooserColour()
      Get the chooser color
      Returns:
      the chooser color
    • setHue

      private void setHue()
      Set the value of the hue edit to match the current color
    • setSaturation

      private void setSaturation()
      Set the value of the saturation edit to match the current color
    • setBrightness

      private void setBrightness()
      Set the value of the brightness edit to match the current color
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Respond to action events for the edit fields
      Specified by:
      actionPerformed in interface ActionListener
    • resetColor

      private void resetColor()
      Reset the displayed color to the color specified by the edit fields
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Invoked when the mouse button has been clicked (pressed and released) on a component.
      Specified by:
      mouseClicked in interface MouseListener
    • mousePressed

      public void mousePressed(MouseEvent e)
      Invoked when a mouse button has been pressed on a component.
      Specified by:
      mousePressed in interface MouseListener
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Invoked when a mouse button has been released on a component.
      Specified by:
      mouseReleased in interface MouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Invoked when the mouse enters a component.
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent e)
      Invoked when the mouse exits a component.
      Specified by:
      mouseExited in interface MouseListener
    • mouseMoved

      public void mouseMoved(MouseEvent e)
      Invoked when the mouse exits a component.
      Specified by:
      mouseMoved in interface MouseMotionListener
    • mouseWheelMoved

      public void mouseWheelMoved(MouseWheelEvent e)
      Move the sliders in rsponse to the mouse wheel
      Specified by:
      mouseWheelMoved in interface MouseWheelListener
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Invoked when the mouse exits a component.
      Specified by:
      mouseDragged in interface MouseMotionListener
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Invoked when the target of the listener has changed its state.
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      e - a ChangeEvent object
    • buildChooser

      protected void buildChooser()
      Specified by:
      buildChooser in class AbstractColorChooserPanel
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in class AbstractColorChooserPanel
    • getHiDpiAwareIcon

      public RadianceIcon getHiDpiAwareIcon(int size, RadianceColorScheme colorScheme)
      Specified by:
      getHiDpiAwareIcon in class RadianceColorChooserPanel
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • updateChooser

      public void updateChooser()
      Specified by:
      updateChooser in class AbstractColorChooserPanel
    • installChooserPanel

      public void installChooserPanel(JColorChooser enclosingChooser)
      Overrides:
      installChooserPanel in class AbstractColorChooserPanel
    • setLabelBundle

      public static void setLabelBundle(ResourceBundle labelBundle)
    • getLabel

      private static String getLabel(String labelName, String defaultValue)
    • showSystemColorList

      private void showSystemColorList(Point p)
      Show a popup menu with the list of system colors
      Parameters:
      p - the location to display the popup
    • getSystemColor

      public Color getSystemColor(String temp)
      Get the named system color
      Parameters:
      temp - the color name
      Returns:
      the color value or null if the name is not recognized
    • shouldAdjustWheel

      private boolean shouldAdjustWheel()
      Should the color wheel's colors be adjusted
      Returns:
      true if the colors should change to match the brightness and saturation
    • getAdjustWheel

      public int getAdjustWheel()
      Get the adjust color wheel flag.
      Returns:
      the adjustment mode
    • setAdjustWheel

      public void setAdjustWheel(int state)
      Set the adjust color wheel flag.
      Parameters:
      state - the color wheel's new adjustment mode ( CTRL_ADJUST | ALWAYS_ADJUST | NEVER_ADJUST );
    • getRollover

      public boolean getRollover()
      Get the adjust rollover color flag.
      Returns:
      the adjustment mode
    • setRollover

      public void setRollover(boolean state)
      Set the adjust rollover color flag.
      Parameters:
      state - the rollover's new adjustment mode ( true | false );
    • resetColorWheel

      public void resetColorWheel()
      Reset the brightness and saturation multipliers for the ColorWheel.