Package com.ribs.plus

Class RJThumbWheel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class RJThumbWheel extends 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 <info@reportmill.com>.

See Also:
  • Field Details

  • Constructor Details

    • RJThumbWheel

      public RJThumbWheel()
      Creates a new thumbwheel.
    • RJThumbWheel

      public RJThumbWheel(byte aType, float vmin, float vmax, float current)
      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 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).
    • _processMouseEvent

      protected void _processMouseEvent(MouseEvent e)
      Handles mouse events.
    • processMouseEvent

      protected void processMouseEvent(MouseEvent e)
      Forwards mouse events to above method.
      Overrides:
      processMouseEvent in class JComponent
    • processMouseMotionEvent

      protected void processMouseMotionEvent(MouseEvent e)
      Forwards mouse motion events to above method.
      Overrides:
      processMouseMotionEvent in class JComponent
    • 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(Graphics g)
      Paints the component.
      Overrides:
      paintComponent in class JComponent
    • addChangeListener

      public void addChangeListener(ChangeListener l)
      Adds a change listener.
    • removeChangeListener

      public void removeChangeListener(ChangeListener l)
      Remove a change listener.
    • notifyChangeListeners

      protected void notifyChangeListeners()
      Notify change listeners.
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides component method to indicate that preferred size is current size.
      Overrides:
      getPreferredSize in class JComponent
    • getMinimumSize

      public Dimension getMinimumSize()
      Overrides component method to indicate that min size is current size.
      Overrides:
      getMinimumSize in class JComponent
    • getMaximumSize

      public Dimension getMaximumSize()
      Overrides component method to indicate that max size is current size.
      Overrides:
      getMaximumSize in class JComponent
    • setBounds

      public void setBounds(int x, int y, int width, int height)
      Overrides component method to set orientation.
      Overrides:
      setBounds in class Component
    • setForeground

      public void setForeground(Color aColor)
      Overrides component method to recache image.
      Overrides:
      setForeground in class JComponent
    • setBackground

      public void setBackground(Color aColor)
      Overrides component method to recache image.
      Overrides:
      setBackground in class JComponent