Package snap.view
Class ThumbWheel
java.lang.Object
snap.props.PropObject
snap.view.View
snap.view.ThumbWheel
- All Implemented Interfaces:
PropChange.DoChange
,XMLArchiver.Archivable
This class has the behavior of a slider, without boundaries (so you can set values beyond the visible min and max).
Furthermore, it has a 3D thumbwheel look, that is particularly nice for radial values. It also has an optional linear
look, which is good for unbounded linear values.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
Fields inherited from class snap.view.View
_align, _borderRadius, _effect, _font, _margin, _padding, _repaintRect, _showing, _spacing, _vertical, Action, Align_Prop, Border_Prop, BorderRadius_Prop, Clip_Prop, Cursor_Prop, DEFAULT_ALIGN, DEFAULT_MARGIN, DEFAULT_PADDING, DEFAULT_SPACING, Disabled_Prop, DragEvents, Effect_Prop, Fill_Prop, Focusable_Prop, Focused_Prop, FocusWhenPressed_Prop, Font_Prop, GrowHeight_Prop, GrowWidth_Prop, Height_Prop, KeyEvents, KeyPress, KeyRelease, KeyType, LeanX_Prop, LeanY_Prop, Managed_Prop, Margin_Prop, MaxHeight_Prop, MaxWidth_Prop, MinHeight_Prop, MinWidth_Prop, MouseDrag, MouseEnter, MouseEvents, MouseExit, MouseMove, MousePress, MouseRelease, Name_Prop, Opacity_Prop, Padding_Prop, Paintable_Prop, Parent_Prop, Pickable_Prop, PrefHeight_Prop, PrefWidth_Prop, Rotate_Prop, ScaleX_Prop, ScaleY_Prop, Scroll, Showing_Prop, Spacing_Prop, Text_Prop, ToolTip_Prop, TransX_Prop, TransY_Prop, Vertical_Prop, Visible_Prop, Width_Prop, X_Prop, Y_Prop
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfromXML
(XMLArchiver anArchiver, XMLElement anElement) XML unarchival.float
Returns the largest value permitted by the thumbwheel (even when outside visible range).float
Returns the smallest value permitted by the thumbwheel (even when outside visible range).byte
Returns the thumbhweel absolute mode (ABSOLUTE_BOUNDED or ABSOLUTE_WRAPPED).Override to return white.getPropValue
(String aPropName) Returns the value for given key.float
getRound()
Returns the value that thumbwheel values are rounded to.byte
getType()
Returns the type (radial or linear).double
getValue()
Returns the value.double
getValueAtPoint
(Point aPoint) This method gives the value that corresponds to a point with respect to the given frame and the visible range.float
Returns the largest value in the visible range (ie, on the right side) of the thumbhweel.float
Returns the smallest value in the visible range (ie, on the left side) of the thumbhweel.float
Returns the extent of the thumbwheel's visible range.boolean
Returns whether thumbwheel is absolute bounded.boolean
isLinear()
Returns whether thumbwheel is linear.boolean
isRadial()
Returns whether thumbwheel is radial.boolean
Returns whether thumbwheel does absolute wrapping.protected void
Override to suppress.protected void
paintFront
(Painter aPntr) Override to paint thumbwheel.protected void
processEvent
(ViewEvent anEvent) Forwards mouse events to mouse methods.void
setAbsoluteMax
(float aValue) Sets the largest value permitted by the thumbwheel (even when outside visible range).void
setAbsoluteMin
(float aValue) Sets the smallest value permitted by the thumbwheel (even when outside visible range).void
setAbsoluteMode
(byte aValue) Sets the thumbhweel absolute mode (ABSOLUTE_BOUNDED or ABSOLUTE_WRAPPED).void
setHeight
(double aValue) Override to reset image.void
setPropValue
(String aPropName, Object aValue) Sets the value for given key.void
setRound
(float aValue) Sets the value that thumbwheel values are rounded to.void
setType
(byte aType) Sets the type (radial or linear).void
setValue
(double aValue) Sets the value.void
setVisibleMax
(float aValue) Sets the largest value in the visible range (ie, on the right side) of the thumbhweel.void
setVisibleMin
(float aValue) Sets the smallest value in the visible range (ie, on the left side) of the thumbhweel.void
setWidth
(double aValue) Override to reset image.toXML
(XMLArchiver anArchiver) XML archival.Methods inherited from class snap.view.View
addBinding, addEventFilter, addEventHandler, clone, contains, contains, containsShape, createActionEvent, disableEvents, enableEvents, fireActionEvent, getAlign, getAlignX, getAlignY, getAnim, getAnimCleared, getAnimTimeDeep, getBestHeight, getBestSize, getBestWidth, getBinding, getBinding, getBindingCount, getBindings, getBorder, getBorderRadius, getBounds, getBoundsLocal, getBoundsParent, getBoundsShape, getBoundsShapeParent, getClip, getClipAll, getClipAllBounds, getClipBounds, getClippedRect, getCursor, getDefaultBorder, getDefaultFont, getEffect, getEnv, getEventAdapter, getFill, getFillColor, getFocusNext, getFocusPrev, getFont, getHeight, getHost, getInsetsAll, getLean, getLeanX, getLeanY, getLocalToParent, getLocalToParent, getMargin, getMaxHeight, getMaxSize, getMaxWidth, getMaxX, getMaxY, getMidX, getMidY, getMinHeight, getMinHeightImpl, getMinSize, getMinWidth, getMinWidthImpl, getName, getOpacity, getOpacityAll, getOwner, getOwner, getPadding, getParent, getParent, getParentCount, getParentToLocal, getParentToLocal, getPhysics, getPhysics, getPrefHeight, getPrefHeight, getPrefHeightImpl, getPrefSize, getPrefWidth, getPrefWidth, getPrefWidthImpl, getProp, getPropDefault, getProps, getRealClassName, getRepaintRect, getRepaintRectExpanded, getRootView, getRotate, getScale, getScaleX, getScaleY, getSize, getSpacing, getText, getToolTip, getToolTip, getTransX, getTransY, getUpdater, getValuePropName, getVisRect, getWidth, getWindow, getX, getXY, getY, indexInHost, indexInParent, initProps, intersectsShape, isActionable, isAncestor, isClipToBounds, isDisabled, isEnabled, isFocusable, isFocused, isFocusKeysEnabled, isFocusPainted, isFocusWhenPressed, isFontSet, isGrowHeight, isGrowWidth, isGuest, isHorizontal, isLocalToParentSimple, isManaged, isManagedVisible, isMaxHeightSet, isMaxWidthSet, isMinHeightSet, isMinWidthSet, isMouseDown, isMouseOver, isNeedsRepaint, isPaintable, isPickable, isPickableVisible, isPrefHeightSet, isPrefWidthSet, isShowing, isToolTipEnabled, isVertical, isVisible, localToParent, localToParent, localToParent, localToParent, localToScreen, paintAll, parentFontChanged, parentToLocal, parentToLocal, parentToLocal, parentToLocal, playAnimDeep, processEventAll, processEventFilters, processEventHandlers, relayout, relayoutParent, removeBinding, removeBinding, removeEventFilter, removeEventHandler, repaint, repaint, repaint, repaintInParent, requestFocus, runDelayed, runIntervals, runLater, scrollToVisible, setActionable, setAlign, setAlignX, setAlignY, setAnimProps, setAnimString, setAnimTimeDeep, setBorder, setBorder, setBorderRadius, setBounds, setBounds, setBoundsLocal, setClip, setClipToBounds, setCursor, setDisabled, setEffect, setEnabled, setFill, setFocusable, setFocused, setFocusKeysEnabled, setFocusPainted, setFocusWhenPressed, setFont, setGrowHeight, setGrowWidth, setLean, setLeanX, setLeanY, setManaged, setMargin, setMargin, setMaxHeight, setMaxSize, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinSize, setMinWidth, setName, setOpacity, setOwner, setPadding, setPadding, setPaintable, setParent, setPickable, setPrefHeight, setPrefSize, setPrefSize, setPrefWidth, setProp, setRealClassName, setRotate, setScale, setScaleX, setScaleY, setShowing, setSize, setSize, setSizeLocal, setSizeToBestSize, setSizeToPrefSize, setSpacing, setText, setToolTip, setToolTipEnabled, setTransX, setTransY, setVertical, setVisible, setX, setXY, setXYLocal, setY, stopAnimDeep, stopIntervals, themeChanged, toStringProps
Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, firePropChange, firePropChange, firePropChange, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropsString, setPropValues, toString
-
Field Details
-
TYPE_RADIAL
public static final byte TYPE_RADIAL- See Also:
-
TYPE_LINEAR
public static final byte TYPE_LINEAR- See Also:
-
ABSOLUTE_BOUNDED
public static final byte ABSOLUTE_BOUNDED- See Also:
-
ABSOLUTE_WRAPPED
public static final byte ABSOLUTE_WRAPPED- See Also:
-
-
Constructor Details
-
ThumbWheel
public ThumbWheel()Creates a new thumbwheel.
-
-
Method Details
-
getType
public byte getType()Returns the type (radial or linear). -
setType
public void setType(byte aType) Sets the type (radial or linear). -
getValue
public double getValue()Returns the value. -
setValue
public void setValue(double aValue) Sets the value. -
getRound
public float getRound()Returns the value that thumbwheel values are rounded to. -
setRound
public void setRound(float aValue) Sets the value that thumbwheel values are rounded to. -
getVisibleMin
public float getVisibleMin()Returns the smallest value in the visible range (ie, on the left side) of the thumbhweel. -
setVisibleMin
public void setVisibleMin(float aValue) Sets the smallest value in the visible range (ie, on the left side) of the thumbhweel. -
getVisibleMax
public float getVisibleMax()Returns the largest value in the visible range (ie, on the right side) of the thumbhweel. -
setVisibleMax
public void setVisibleMax(float aValue) Sets the largest value in the visible range (ie, on the right side) of the thumbhweel. -
getAbsoluteMin
public float getAbsoluteMin()Returns the smallest value permitted by the thumbwheel (even when outside visible range). -
setAbsoluteMin
public void setAbsoluteMin(float aValue) Sets the smallest value permitted by the thumbwheel (even when outside visible range). -
getAbsoluteMax
public float getAbsoluteMax()Returns the largest value permitted by the thumbwheel (even when outside visible range). -
setAbsoluteMax
public void setAbsoluteMax(float aValue) Sets the largest value permitted by the thumbwheel (even when outside visible range). -
getAbsoluteMode
public byte getAbsoluteMode()Returns the thumbhweel absolute mode (ABSOLUTE_BOUNDED or ABSOLUTE_WRAPPED). -
setAbsoluteMode
public void setAbsoluteMode(byte aValue) Sets the thumbhweel absolute mode (ABSOLUTE_BOUNDED or ABSOLUTE_WRAPPED). -
processEvent
Forwards mouse events to mouse methods.- Overrides:
processEvent
in classView
-
getValueAtPoint
This method gives the value that corresponds to a point with respect to the given frame and the visible range. When in radial mode, the point on the thumbwheel is approximated with a power series for arcCos to get legal values for points outside of the frame. -
isRadial
public boolean isRadial()Returns whether thumbwheel is radial. -
isLinear
public boolean isLinear()Returns whether thumbwheel is linear. -
isBounded
public boolean isBounded()Returns whether thumbwheel is absolute bounded. -
isWrapped
public boolean isWrapped()Returns whether thumbwheel does absolute wrapping. -
getVisibleRange
public float getVisibleRange()Returns the extent of the thumbwheel's visible range. -
paintFront
Override to paint thumbwheel.- Overrides:
paintFront
in classView
-
paintBack
Override to suppress. -
getDefaultFill
Override to return white.- Overrides:
getDefaultFill
in classView
-
setWidth
public void setWidth(double aValue) Override to reset image. -
setHeight
public void setHeight(double aValue) Override to reset image. -
getPropValue
Returns the value for given key.- Overrides:
getPropValue
in classView
-
setPropValue
Sets the value for given key.- Overrides:
setPropValue
in classView
-
toXML
XML archival.- Specified by:
toXML
in interfaceXMLArchiver.Archivable
- Overrides:
toXML
in classView
-
fromXML
XML unarchival.- Specified by:
fromXML
in interfaceXMLArchiver.Archivable
- Overrides:
fromXML
in classView
-