com.ribs.plus
Class RJThumbWheel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
com.ribs.plus.RJThumbWheel
- All Implemented Interfaces:
- java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
- public class RJThumbWheel
- extends javax.swing.JComponent
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.
Copyright (c) 2004 ReportMill Software, Inc. All Rights Reserved. Contact ReportMill .
- See Also:
- Serialized Form
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
|
Constructor Summary |
RJThumbWheel()
Creates a new thumbwheel. |
RJThumbWheel(byte aType,
float vmin,
float vmax,
float current)
Creates a new thumbwheel. |
|
Method Summary |
void |
addChangeListener(javax.swing.event.ChangeListener l)
Adds a change listener. |
float |
getAbsoluteMax()
Returns the largest value permitted by the thumbwheel (even when outside visible range). |
float |
getAbsoluteMin()
Returns the smallest value permitted by the thumbwheel (even when outside visible range). |
byte |
getAbsoluteMode()
Returns the thumbhweel absolute mode (ABSOLUTE_BOUNDED or ABSOLUTE_WRAPPED). |
float |
getFloatValueAtPoint(float px,
float py)
This method gives the value that corresponds to a point with respect to the given frame and the visible range. |
java.awt.Dimension |
getMaximumSize()
Overrides component method to indicate that max size is current size. |
java.awt.Dimension |
getMinimumSize()
Overrides component method to indicate that min size is current size. |
int |
getOrientation()
Returns the origientation (SwingConstants.VERTICAL or SwingConstants.HORIZONTAL). |
java.awt.Dimension |
getPreferredSize()
Overrides component method to indicate that preferred size is current size. |
float |
getRound()
Returns the value that thumbwheel values are rounded to. |
byte |
getType()
Returns the type (radial or linear). |
float |
getValue()
Returns the value. |
boolean |
getValueIsAdjusting()
Returns whether the thumbweel is in a state of rapid interactive use (from mouse loop). |
float |
getVisibleMax()
Returns the largest value in the visible range (ie, on the right side) of the thumbhweel. |
float |
getVisibleMin()
Returns the smallest value in the visible range (ie, on the left side) of the thumbhweel. |
float |
getVisibleRange()
Returns the extent of the thumbwheel's visible range. |
boolean |
isBounded()
Returns whether thumbwheel is absolute bounded. |
boolean |
isHorizontal()
Returns whether thumbwheel is horizontal. |
boolean |
isLinear()
Returns whether thumbwheel is linear. |
boolean |
isRadial()
Returns whether thumbwheel is radial. |
boolean |
isVertical()
Returns whether thumbwheel is vertical. |
boolean |
isWrapped()
Returns whether thumbwheel does absolute wrapping. |
void |
paintComponent(java.awt.Graphics g)
Paints the component. |
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Remove a change listener. |
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 |
setBackground(java.awt.Color aColor)
Overrides component method to recache image. |
void |
setBounds(int x,
int y,
int width,
int height)
Overrides component method to set orientation. |
void |
setForeground(java.awt.Color aColor)
Overrides component method to recache image. |
void |
setOrientation(int aValue)
Returns the origientation (SwingConstants.VERTICAL or SwingConstants.HORIZONTAL). |
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(float aValue)
Sets the value. |
void |
setValue(float aValue,
boolean notifyListeners)
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. |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TYPE_RADIAL
public static final byte TYPE_RADIAL
- See Also:
- Constant Field Values
TYPE_LINEAR
public static final byte TYPE_LINEAR
- See Also:
- Constant Field Values
ABSOLUTE_BOUNDED
public static final byte ABSOLUTE_BOUNDED
- See Also:
- Constant Field Values
ABSOLUTE_WRAPPED
public static final byte ABSOLUTE_WRAPPED
- See Also:
- Constant Field Values
RJThumbWheel
public RJThumbWheel()
- Creates a new thumbwheel.
RJThumbWheel
public RJThumbWheel(byte aType,
float vmin,
float vmax,
float current)
- Creates a new thumbwheel.
getType
public byte getType()
- Returns the type (radial or linear).
setType
public void setType(byte aType)
- Sets the type (radial or linear).
getValue
public float getValue()
- Returns the value.
setValue
public void setValue(float aValue)
- Sets the value.
setValue
public void setValue(float aValue,
boolean notifyListeners)
- 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).
getOrientation
public int getOrientation()
- Returns the origientation (SwingConstants.VERTICAL or SwingConstants.HORIZONTAL).
setOrientation
public void setOrientation(int aValue)
- Returns the origientation (SwingConstants.VERTICAL or SwingConstants.HORIZONTAL).
getValueIsAdjusting
public boolean getValueIsAdjusting()
- Returns whether the thumbweel is in a state of rapid interactive use (from mouse loop).
getFloatValueAtPoint
public float getFloatValueAtPoint(float px,
float py)
- 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.
isVertical
public boolean isVertical()
- Returns whether thumbwheel is vertical.
isHorizontal
public boolean isHorizontal()
- Returns whether thumbwheel is horizontal.
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.
paintComponent
public void paintComponent(java.awt.Graphics g)
- Paints the component.
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener l)
- Adds a change listener.
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
- Remove a change listener.
getPreferredSize
public java.awt.Dimension getPreferredSize()
- Overrides component method to indicate that preferred size is current size.
getMinimumSize
public java.awt.Dimension getMinimumSize()
- Overrides component method to indicate that min size is current size.
getMaximumSize
public java.awt.Dimension getMaximumSize()
- Overrides component method to indicate that max size is current size.
setBounds
public void setBounds(int x,
int y,
int width,
int height)
- Overrides component method to set orientation.
setForeground
public void setForeground(java.awt.Color aColor)
- Overrides component method to recache image.
setBackground
public void setBackground(java.awt.Color aColor)
- Overrides component method to recache image.