Package com.inductiveautomation.rm.swing
Class RJThumbWheel
- java.lang.Object
- 
- java.awt.Component
- 
- java.awt.Container
- 
- javax.swing.JComponent
- 
- com.inductiveautomation.rm.swing.RJThumbWheel
 
 
 
 
- 
- All Implemented Interfaces:
- java.awt.image.ImageObserver,- java.awt.MenuContainer,- java.io.Serializable
 
 public class RJThumbWheel extends javax.swing.JComponentThis 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.- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static byteABSOLUTE_BOUNDEDstatic byteABSOLUTE_WRAPPEDstatic byteTYPE_LINEARstatic byteTYPE_RADIAL- 
Fields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
- 
 - 
Constructor SummaryConstructors Constructor Description RJThumbWheel()Creates a new thumbwheel.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChangeListener(javax.swing.event.ChangeListener l)Adds a change listener.floatgetAbsoluteMax()Returns the largest value permitted by the thumbwheel (even when outside visible range).floatgetAbsoluteMin()Returns the smallest value permitted by the thumbwheel (even when outside visible range).bytegetAbsoluteMode()Returns the thumbhweel absolute mode (ABSOLUTE_BOUNDED or ABSOLUTE_WRAPPED).intgetOrientation()Returns the orientation (SwingConstants.VERTICAL or SwingConstants.HORIZONTAL).floatgetRound()Returns the value that thumbwheel values are rounded to.bytegetType()Returns the type (radial or linear).doublegetValue()Returns the value.doublegetValueAtPoint(java.awt.Point aPoint)This method gives the value that corresponds to a point with respect to the given frame and the visible range.booleangetValueIsAdjusting()Returns whether the thumbweel is in a state of rapid interactive use (from mouse loop).floatgetVisibleMax()Returns the largest value in the visible range (ie, on the right side) of the thumbhweel.floatgetVisibleMin()Returns the smallest value in the visible range (ie, on the left side) of the thumbhweel.floatgetVisibleRange()Returns the extent of the thumbwheel's visible range.booleanisBounded()Returns whether thumbwheel is absolute bounded.booleanisHorizontal()Returns whether thumbwheel is horizontal.booleanisLinear()Returns whether thumbwheel is linear.booleanisRadial()Returns whether thumbwheel is radial.booleanisVertical()Returns whether thumbwheel is vertical.booleanisWrapped()Returns whether thumbwheel does absolute wrapping.protected voidmouseDragged(java.awt.event.MouseEvent anEvent)Mouse Pressed.protected voidmousePressed(java.awt.event.MouseEvent anEvent)Mouse Pressed.voidmouseReleased(java.awt.event.MouseEvent anEvent)Mouse Released.voidpaintComponent(java.awt.Graphics g)Paints the component.protected voidprocessMouseEvent(java.awt.event.MouseEvent e)Forwards mouse events to mouse methods.protected voidprocessMouseMotionEvent(java.awt.event.MouseEvent e)Forwards mouse events to mouse methods.voidremoveChangeListener(javax.swing.event.ChangeListener l)Remove a change listener.voidsetAbsoluteMax(float aValue)Sets the largest value permitted by the thumbwheel (even when outside visible range).voidsetAbsoluteMin(float aValue)Sets the smallest value permitted by the thumbwheel (even when outside visible range).voidsetAbsoluteMode(byte aValue)Sets the thumbhweel absolute mode (ABSOLUTE_BOUNDED or ABSOLUTE_WRAPPED).voidsetBackground(java.awt.Color aColor)Overrides to reset image.voidsetBounds(int x, int y, int width, int height)Override to reset image and set orientation.voidsetForeground(java.awt.Color aColor)Overrides to reset image.voidsetOrientation(int aValue)Returns the orientation (SwingConstants.VERTICAL or SwingConstants.HORIZONTAL).voidsetRound(float aValue)Sets the value that thumbwheel values are rounded to.voidsetType(byte aType)Sets the type (radial or linear).voidsetValue(double aValue)Sets the value.voidsetVisibleMax(float aValue)Sets the largest value in the visible range (ie, on the right side) of the thumbhweel.voidsetVisibleMin(float aValue)Sets the smallest value in the visible range (ie, on the left side) of the thumbhweel.- 
Methods inherited from class javax.swing.JComponentaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 - 
Methods inherited from class java.awt.Containeradd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 - 
Methods inherited from class java.awt.Componentaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
- 
 
- 
- 
- 
Field Detail- 
TYPE_RADIALpublic static final byte TYPE_RADIAL - See Also:
- Constant Field Values
 
 - 
TYPE_LINEARpublic static final byte TYPE_LINEAR - See Also:
- Constant Field Values
 
 - 
ABSOLUTE_BOUNDEDpublic static final byte ABSOLUTE_BOUNDED - See Also:
- Constant Field Values
 
 - 
ABSOLUTE_WRAPPEDpublic static final byte ABSOLUTE_WRAPPED - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getTypepublic byte getType() Returns the type (radial or linear).
 - 
setTypepublic void setType(byte aType) Sets the type (radial or linear).
 - 
getValuepublic double getValue() Returns the value.
 - 
setValuepublic void setValue(double aValue) Sets the value.
 - 
getRoundpublic float getRound() Returns the value that thumbwheel values are rounded to.
 - 
setRoundpublic void setRound(float aValue) Sets the value that thumbwheel values are rounded to.
 - 
getVisibleMinpublic float getVisibleMin() Returns the smallest value in the visible range (ie, on the left side) of the thumbhweel.
 - 
setVisibleMinpublic void setVisibleMin(float aValue) Sets the smallest value in the visible range (ie, on the left side) of the thumbhweel.
 - 
getVisibleMaxpublic float getVisibleMax() Returns the largest value in the visible range (ie, on the right side) of the thumbhweel.
 - 
setVisibleMaxpublic void setVisibleMax(float aValue) Sets the largest value in the visible range (ie, on the right side) of the thumbhweel.
 - 
getAbsoluteMinpublic float getAbsoluteMin() Returns the smallest value permitted by the thumbwheel (even when outside visible range).
 - 
setAbsoluteMinpublic void setAbsoluteMin(float aValue) Sets the smallest value permitted by the thumbwheel (even when outside visible range).
 - 
getAbsoluteMaxpublic float getAbsoluteMax() Returns the largest value permitted by the thumbwheel (even when outside visible range).
 - 
setAbsoluteMaxpublic void setAbsoluteMax(float aValue) Sets the largest value permitted by the thumbwheel (even when outside visible range).
 - 
getAbsoluteModepublic byte getAbsoluteMode() Returns the thumbhweel absolute mode (ABSOLUTE_BOUNDED or ABSOLUTE_WRAPPED).
 - 
setAbsoluteModepublic void setAbsoluteMode(byte aValue) Sets the thumbhweel absolute mode (ABSOLUTE_BOUNDED or ABSOLUTE_WRAPPED).
 - 
getOrientationpublic int getOrientation() Returns the orientation (SwingConstants.VERTICAL or SwingConstants.HORIZONTAL).
 - 
setOrientationpublic void setOrientation(int aValue) Returns the orientation (SwingConstants.VERTICAL or SwingConstants.HORIZONTAL).
 - 
getValueIsAdjustingpublic boolean getValueIsAdjusting() Returns whether the thumbweel is in a state of rapid interactive use (from mouse loop).
 - 
processMouseEventprotected void processMouseEvent(java.awt.event.MouseEvent e) Forwards mouse events to mouse methods.- Overrides:
- processMouseEventin class- javax.swing.JComponent
 
 - 
processMouseMotionEventprotected void processMouseMotionEvent(java.awt.event.MouseEvent e) Forwards mouse events to mouse methods.- Overrides:
- processMouseMotionEventin class- javax.swing.JComponent
 
 - 
mousePressedprotected void mousePressed(java.awt.event.MouseEvent anEvent) Mouse Pressed.
 - 
mouseDraggedprotected void mouseDragged(java.awt.event.MouseEvent anEvent) Mouse Pressed.
 - 
mouseReleasedpublic void mouseReleased(java.awt.event.MouseEvent anEvent) Mouse Released.
 - 
getValueAtPointpublic double getValueAtPoint(java.awt.Point aPoint) 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.
 - 
isVerticalpublic boolean isVertical() Returns whether thumbwheel is vertical.
 - 
isHorizontalpublic boolean isHorizontal() Returns whether thumbwheel is horizontal.
 - 
isRadialpublic boolean isRadial() Returns whether thumbwheel is radial.
 - 
isLinearpublic boolean isLinear() Returns whether thumbwheel is linear.
 - 
isBoundedpublic boolean isBounded() Returns whether thumbwheel is absolute bounded.
 - 
isWrappedpublic boolean isWrapped() Returns whether thumbwheel does absolute wrapping.
 - 
getVisibleRangepublic float getVisibleRange() Returns the extent of the thumbwheel's visible range.
 - 
paintComponentpublic void paintComponent(java.awt.Graphics g) Paints the component.- Overrides:
- paintComponentin class- javax.swing.JComponent
 
 - 
addChangeListenerpublic void addChangeListener(javax.swing.event.ChangeListener l) Adds a change listener.
 - 
removeChangeListenerpublic void removeChangeListener(javax.swing.event.ChangeListener l) Remove a change listener.
 - 
setBoundspublic void setBounds(int x, int y, int width, int height)Override to reset image and set orientation.- Overrides:
- setBoundsin class- java.awt.Component
 
 - 
setForegroundpublic void setForeground(java.awt.Color aColor) Overrides to reset image.- Overrides:
- setForegroundin class- javax.swing.JComponent
 
 - 
setBackgroundpublic void setBackground(java.awt.Color aColor) Overrides to reset image.- Overrides:
- setBackgroundin class- javax.swing.JComponent
 
 
- 
 
-