Package snap.viewx

Class ColorPanel

All Implemented Interfaces:
PropChange.DoChange

public class ColorPanel extends ViewOwner
This class provides UI for selecting a color.
  • Constructor Details

    • ColorPanel

      public ColorPanel()
      Creates a new color panel.
  • Method Details

    • getShared

      public static ColorPanel getShared()
      Returns the shared instance of the color panel.
    • getColor

      public Color getColor()
      Returns the current color of the color panel.
    • setColor

      public void setColor(Color aColor)
      Sets the current color of the color panel.
    • addRecentColor

      public void addRecentColor(Color aColor)
      Add to the list of Recent Colors shown on the Color Panel
    • getColorWell

      public ColorWell getColorWell()
      Returns the ColorWell that receives notifications of color panel changes.
    • setColorWell

      public void setColorWell(ColorWell aColorWell)
      Sets the ColorWell that receives notifications of color panel changes.
    • getDefaultColorWell

      public ColorWell getDefaultColorWell()
      Returns the ColorWell to fall back on when no ColorWell set.
    • setDefaultColorWell

      public void setDefaultColorWell(ColorWell aColorWell)
      Sets the ColorWell to fall back on when no ColorWell set.
    • getSelectedPicker

      public int getSelectedPicker()
      Returns the selected picker (0=Image, 1=RGB Sliders, 2=Gray Sliders, 3=SwatchPicker).
    • setSelectedPicker

      public void setSelectedPicker(int aPicker)
      Sets the selected picker (0=Image, 1=RGB Sliders, 2=Gray Sliders, 3=SwatchPicker).
    • initUI

      protected void initUI()
      Initialize UI panel.
      Overrides:
      initUI in class ViewOwner
    • resetUI

      protected void resetUI()
      Resets UI controls.
      Overrides:
      resetUI in class ViewOwner
    • respondUI

      protected void respondUI(ViewEvent anEvent)
      Responds to changes to the UI controls.
      Overrides:
      respondUI in class ViewOwner
    • fireActionEvent

      protected void fireActionEvent(ViewEvent anEvent)
      Called when color changed by user.
    • setShowing

      protected void setShowing(boolean aValue)
      Override to de-select color well on hide.
      Overrides:
      setShowing in class ViewOwner