public class LuminosityPicker extends ButtonGuiImpl
ColorChooserGuiImpl
dialog that allows to view and select with
the mouse the LUMINOSITY of a color. The HUE and SATURATION are used to display the active
selected color but otherwise ignored.Modifier and Type | Field and Description |
---|---|
private int |
BANDING_HEIGHT
Constant representing the height of the banding.
|
private int |
GRADIENT_WIDTH
Constant representing the width (including one-pixel width border) the gradient rule.
|
private int |
hue
The currently selected HUE.
|
private boolean |
imgLoaded
Flags whether we have already tried to load the bundle images.
|
private int |
lum
The currently selected LUMINOSITY.
|
private int |
NATIVE_HEIGHT
Constant representing the height (including one-pixel width border) of the widget.
|
private int |
NATIVE_WIDTH
Constant representing the total width of the widget.
|
private ImageWrapper<java.awt.image.BufferedImage> |
pointer
The pointer of the selected color on the picker.
|
private int |
sat
The currently selected SATURATION.
|
cc, DOT_LINE_WIDTH, gd, gf
config, widgetFocused
insets, location, LOG, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
LuminosityPicker()
This constructor instantiate and initialize the object.
|
Modifier and Type | Method and Description |
---|---|
void |
draw()
Draw the picker widget.
|
boolean |
focusTraversable()
Check if widget is focus traversable.
|
double |
height()
Get widget height.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Notification of a mouse clicked event occurred for this widget.
|
void |
selectValue(int hue,
int sat,
int lum)
Sets a combination of HUE, SATURATION and LUMINOSITY as the value of the picker.
|
double |
width()
Get widget width.
|
afterConfigUpdate, createMnemonic, getImgDisabled, getImgDown, getImgUp, handleBasicEvents, handleCursorKeys, hasImages, hasPrepackagedImages, highlighted, initialize, isAutoResize, isDefaultButton, isDroppable, isFocusable, isMnemonicSupported, isPressed, loadImage, onFocusLost, physicalBounds, processMnemonic, refresh, requestFocus, setActionCode, setImage, supportsCustomMousePointer, toString, updateSize, updateSizeWorker
isMouseOver, mouseActions, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased
addListener, checkKey, config, destroy, getColon, getColumnLabelText, getCommand, getLabelInstance, getLabelText, getMnemonic, getTo, initButtonText, isForceLabel, isNoLabels, isRightAligned, postprocessConfig, processEvent, processKeyEvent, setCommand, setHidden, setLabelInstance, setMnemonic, setNoLabels, setSupportsMnemonic, setText, setTextLabel, setVisible, setWasVisible, textLabel, wasVisible
dimension, forceCursorOnFocus, getDefaultEvent, ignoreAction, manageSystemActions, minimumSize, onFocusGained, onKeyPressed, onKeyTyped, processKeyEventCommon
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, copyState, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, findMouseSource, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, insets, isCurrent, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalDimension, physicalLocation, prepParentLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectAncestorChange, reflectLocationChange, refresh, registerWidgetStateListener, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setEnabled, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, showPopupMenu, sync, topLevelWindow, translate, unrealize, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, defaultMousePtr, dimension, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, insets, isCurrent, isDirectManipulable, isDisplayed, isEnabled, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, minimumSize, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalDimension, physicalLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, raiseLegacyMouseEvents, repaint, repaint, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setEnabled, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, topLevelWindow, unrealize, window
getColumnMnemonic, getMnemonicCharacter, getMnemonicKeyCode, getMnemonicLabel, setColumnMnemonic, updateMnemonic
private final int NATIVE_HEIGHT
private final int NATIVE_WIDTH
private final int GRADIENT_WIDTH
private final int BANDING_HEIGHT
private boolean imgLoaded
private ImageWrapper<java.awt.image.BufferedImage> pointer
null
, the widget was not yet
displayed or load of the image has failed.private int hue
ColorChooserGuiImpl
and ColorRgb
). Only used for preview.private int sat
ColorChooserGuiImpl
and ColorRgb
). Only used for preview.private int lum
ColorChooserGuiImpl
and ColorRgb
).public LuminosityPicker()
public void draw()
draw
in interface Widget<GuiOutputManager>
draw
in class ButtonGuiImpl
public double height()
height
in interface Widget<GuiOutputManager>
height
in class ButtonGuiImpl
public double width()
width
in interface Widget<GuiOutputManager>
width
in class ButtonGuiImpl
public void selectValue(int hue, int sat, int lum)
hue
- New HUE value. Must be in 0-240 interval.sat
- New SATURATION value. Must be in 0-240 interval.lum
- New LUMINOSITY value. Must be in 0-240 interval.public void mouseClicked(java.awt.event.MouseEvent e)
Button.command
is updated so that the action event emitted by super class will
bear the new computed LUMINOSITY.mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class ButtonGuiImpl
e
- The mouse event.public boolean focusTraversable()
focusTraversable
in interface Widget<GuiOutputManager>
focusTraversable
in class ButtonGuiImpl
true
because this widget is NOT focus traversable.