Class PamRangeSlider

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants
Direct Known Subclasses:
ColourRangeSlider

public class PamRangeSlider extends JSlider
An extension of JSlider to select a range of values using two thumb controls. The thumb controls are used to select the lower and upper value of a range with predetermined minimum and maximum values.

Note that RangeSlider makes use of the default BoundedRangeModel, which supports an inner range defined by a value and an extent. The upper value returned by RangeSlider is simply the lower value plus the extent.

PamRangeSlider is based on code from Ernie Yu. http://ernienotes.wordpress.com/2010/12/27/creating-a-java-swing-range-slider/ (28/09/2013)

See Also:
  • Constructor Details

    • PamRangeSlider

      public PamRangeSlider()
      Constructs a RangeSlider with default minimum and maximum values of 0 and 100.
    • PamRangeSlider

      public PamRangeSlider(int orientation)
      Constructs a RangeSlider with default minimum and maximum values of 0 and 100 and specified orientation.
    • PamRangeSlider

      public PamRangeSlider(int min, int max)
      Constructs a RangeSlider with the specified default minimum and maximum values.
    • PamRangeSlider

      public PamRangeSlider(int min, int max, int orientation)
      Constructs a RangeSlider with the specified default minimum and maximum values and specified orientation.
  • Method Details

    • updateUI

      public void updateUI()
      Overrides the superclass method to install the UI delegate to draw two thumbs.
      Overrides:
      updateUI in class JSlider
    • getValue

      public int getValue()
      Returns the lower value in the range.
      Overrides:
      getValue in class JSlider
    • setValue

      public void setValue(int value)
      Sets the lower value in the range.
      Overrides:
      setValue in class JSlider
    • getUpperValue

      public int getUpperValue()
      Returns the upper value in the range.
    • setUpperValue

      public void setUpperValue(int value)
      Sets the upper value in the range.
    • setRangeColour

      public void setRangeColour(Color frequencyBarColour)
    • setThumbSizes

      public void setThumbSizes(int size)
    • setTrackDragging

      public void setTrackDragging(boolean dragging)
      Allow the track between thumbs to be dragged.