Package snap.viewx
Class ColorPanel
java.lang.Object
snap.props.PropObject
snap.view.ViewOwner
snap.viewx.ColorPanel
- All Implemented Interfaces:
PropChange.DoChange
This class provides UI for selecting a color.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A Slider subclass to show colors in slider groove.static class
An inner class to act as an image color picker. -
Field Summary
Fields inherited from class snap.view.ViewOwner
Action, DragDrop, DragEnter, DragEvents, DragExit, DragGesture, DragOver, KeyEvents, KeyPress, KeyRelease, KeyType, MouseDrag, MouseEnter, MouseEvents, MouseExit, MouseMove, MousePress, MouseRelease, Showing_Prop, WinClose
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRecentColor
(Color aColor) Add to the list of Recent Colors shown on the Color Panelprotected void
fireActionEvent
(ViewEvent anEvent) Called when color changed by user.getColor()
Returns the current color of the color panel.Returns the ColorWell that receives notifications of color panel changes.Returns the ColorWell to fall back on when no ColorWell set.int
Returns the selected picker (0=Image, 1=RGB Sliders, 2=Gray Sliders, 3=SwatchPicker).static ColorPanel
Returns the shared instance of the color panel.protected void
initUI()
Initialize UI panel.protected void
resetUI()
Resets UI controls.protected void
Responds to changes to the UI controls.void
Sets the current color of the color panel.void
setColorWell
(ColorWell aColorWell) Sets the ColorWell that receives notifications of color panel changes.void
setDefaultColorWell
(ColorWell aColorWell) Sets the ColorWell to fall back on when no ColorWell set.void
setSelectedPicker
(int aPicker) Sets the selected picker (0=Image, 1=RGB Sliders, 2=Gray Sliders, 3=SwatchPicker).protected void
setShowing
(boolean aValue) Override to de-select color well on hide.Methods inherited from class snap.view.ViewOwner
addKeyActionFilter, addKeyActionHandler, addViewEventHandler, beep, cancelReset, createUI, createUIForClass, dispatchEventToOwner, enableEvents, fireActionEventForObject, getEnv, getFirstFocus, getImage, getNative, getToggleGroup, getUI, getUI, getUISource, getView, getView, getViewBoolValue, getViewFloatValue, getViewIntValue, getViewItems, getViewSelIndex, getViewSelItem, getViewStringValue, getViewText, getViewValue, getWindow, initShowing, initWindow, invokeResetUI, invokeRespondUI, isEventThread, isSendEventDisabled, isShowing, isUISet, isViewDisabled, isViewEnabled, isViewVisible, isWindowSet, isWindowVisible, requestFocus, resetLater, runDelayed, runLater, setFirstFocus, setSendEventDisabled, setViewDisabled, setViewEnabled, setViewItems, setViewItems, setViewSelIndex, setViewSelItem, setViewText, setViewValue, setViewVisible, setWindowVisible
Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, clone, firePropChange, firePropChange, firePropChange, getPropDefault, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, getPropValue, initProps, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropsString, setPropValue, setPropValues, toString, toStringProps
-
Constructor Details
-
ColorPanel
public ColorPanel()Creates a new color panel.
-
-
Method Details
-
getColor
Returns the current color of the color panel. -
setColor
Sets the current color of the color panel. -
addRecentColor
Add to the list of Recent Colors shown on the Color Panel -
getColorWell
Returns the ColorWell that receives notifications of color panel changes. -
setColorWell
Sets the ColorWell that receives notifications of color panel changes. -
getDefaultColorWell
Returns the ColorWell to fall back on when no ColorWell set. -
setDefaultColorWell
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. -
resetUI
protected void resetUI()Resets UI controls. -
respondUI
Responds to changes to the UI controls. -
fireActionEvent
Called when color changed by user. -
setShowing
protected void setShowing(boolean aValue) Override to de-select color well on hide.- Overrides:
setShowing
in classViewOwner