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.
-
Nested Class Summary
Nested classes/interfaces inherited from class snap.view.View
View.Overflow
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final byte
static final byte
static final String
static final String
static final String
static final byte
static final String
static final byte
static final String
Fields inherited from class snap.view.View
_align, _border, _borderRadius, _effect, _fill, _font, _margin, _padding, _repaintRect, _showing, _spacing, _vertical, Action, Align_Prop, Border_Prop, BorderRadius_Prop, Cursor_Prop, 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, Overflow_Prop, Padding_Prop, Paintable_Prop, Parent_Prop, Pickable_Prop, PrefHeight_Prop, PrefWidth_Prop, Rotate_Prop, RuntimeClassName_Prop, ScaleX_Prop, ScaleY_Prop, Scroll, Showing_Prop, Spacing_Prop, Text_Prop, TextColor_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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromXML
(XMLArchiver anArchiver, XMLElement anElement) XML unarchival.double
Returns the largest value permitted by the thumbwheel (even when outside visible range).double
Returns the smallest value permitted by the thumbwheel (even when outside visible range).byte
Returns the thumbhweel absolute mode (ABSOLUTE_BOUNDED or ABSOLUTE_WRAPPED).getPropValue
(String aPropName) Override to support props for this class.double
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.double
Returns the largest value in the visible range (ie, on the right side) of the thumbhweel.double
Returns the smallest value in the visible range (ie, on the left side) of the thumbhweel.double
Returns the extent of the thumbwheel's visible range.protected void
Override to support props for this class.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
(double aValue) Sets the largest value permitted by the thumbwheel (even when outside visible range).void
setAbsoluteMin
(double 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) Override to support props for this class.void
setRound
(double 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
(double aValue) Sets the largest value in the visible range (ie, on the right side) of the thumbhweel.void
setVisibleMin
(double 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
addEventFilter, addEventHandler, clone, contains, contains, containsShape, createActionEvent, disableEvents, enableEvents, fireActionEvent, getAlign, getAlignX, getAlignY, getAnim, getAnimCleared, getAnimTimeDeep, getBestHeight, getBestSize, getBestWidth, getBorder, getBorderRadius, getBounds, getBoundsLocal, getBoundsParent, getBoundsShape, getBoundsShapeParent, getClip, getClipAll, getClipBounds, getClipBoundsAll, getCursor, 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, getOverflow, getOwner, getOwner, getPadding, getParent, getParent, getParentCount, getParentToLocal, getParentToLocal, getPhysics, getPhysics, getPrefHeight, getPrefHeight, getPrefHeightImpl, getPrefSize, getPrefWidth, getPrefWidth, getPrefWidthImpl, getProp, getPropDefault, getProps, getRepaintRect, getRepaintRectExpanded, getRootView, getRotate, getRuntimeClassName, getScale, getScaleX, getScaleY, getSize, getSpacing, getText, getTextColor, getToolTip, getToolTip, getTransX, getTransY, getUpdater, getValuePropName, getVisibleBounds, getWidth, getWindow, getX, getXY, getY, indexInHost, indexInParent, initStyleProps, intersectsShape, isActionable, isAncestor, isAnimActive, 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, isPropDefault, isShowing, isToolTipEnabled, isVertical, isVisible, localToParent, localToParent, localToParent, localToParent, localToScreen, paintAbove, paintAll, paintChildren, parentFontChanged, parentToLocal, parentToLocal, parentToLocal, parentToLocal, playAnimDeep, processEventAll, processEventFilters, processEventHandlers, relayout, relayoutParent, removeEventFilter, removeEventHandler, repaint, repaint, repaint, repaintInParent, requestFocus, runDelayed, runIntervals, runLater, scrollToVisible, setActionable, setAlign, setAlignX, setAlignY, setAnimString, setAnimTimeDeep, setBorder, setBorder, setBorderRadius, setBounds, setBounds, setBoundsLocal, 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, setOverflow, setOwner, setPadding, setPadding, setPaintable, setParent, setPickable, setPrefHeight, setPrefSize, setPrefSize, setPrefWidth, setProp, setRotate, setRuntimeClassName, setScale, setScaleX, setScaleY, setShowing, setSize, setSize, setSizeLocal, setSizeToBestSize, setSizeToPrefSize, setSpacing, setText, setTextColor, 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, processArchivedNode, processPropChange, processUnarchivedNode, 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:
-
Min_Prop
- See Also:
-
Max_Prop
- See Also:
-
AbsMin_Prop
- See Also:
-
AbsMax_Prop
- See Also:
-
Round_Prop
- See Also:
-
Type_Prop
- See Also:
-
Value_Prop
- 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 double getRound()Returns the value that thumbwheel values are rounded to. -
setRound
public void setRound(double aValue) Sets the value that thumbwheel values are rounded to. -
getVisibleMin
public double getVisibleMin()Returns the smallest value in the visible range (ie, on the left side) of the thumbhweel. -
setVisibleMin
public void setVisibleMin(double aValue) Sets the smallest value in the visible range (ie, on the left side) of the thumbhweel. -
getVisibleMax
public double getVisibleMax()Returns the largest value in the visible range (ie, on the right side) of the thumbhweel. -
setVisibleMax
public void setVisibleMax(double aValue) Sets the largest value in the visible range (ie, on the right side) of the thumbhweel. -
getAbsoluteMin
public double getAbsoluteMin()Returns the smallest value permitted by the thumbwheel (even when outside visible range). -
setAbsoluteMin
public void setAbsoluteMin(double aValue) Sets the smallest value permitted by the thumbwheel (even when outside visible range). -
getAbsoluteMax
public double getAbsoluteMax()Returns the largest value permitted by the thumbwheel (even when outside visible range). -
setAbsoluteMax
public void setAbsoluteMax(double 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 double getVisibleRange()Returns the extent of the thumbwheel's visible range. -
paintFront
Override to paint thumbwheel.- Overrides:
paintFront
in classView
-
paintBack
Override to suppress. -
setWidth
public void setWidth(double aValue) Override to reset image. -
setHeight
public void setHeight(double aValue) Override to reset image. -
initProps
Override to support props for this class. -
getPropValue
Override to support props for this class.- Overrides:
getPropValue
in classView
-
setPropValue
Override to support props for this class.- 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
-