Package ca.phon.ui

Class JRangeSlider

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, SwingConstants

public class JRangeSlider extends JComponent implements SwingConstants
A component that lets the user graphically select a contiguous range of values by sliding knobs withing a bounded interval. Like the regular swing JSlider, the component can show both major ticks marks and minor tick marks between them.
Version:
1.0 2007-04-22
See Also:
  • Field Details

    • majorTickSpacing

      protected int majorTickSpacing
      The number of values between major ticks.
    • minorTickSpacing

      protected int minorTickSpacing
      The number of values between minor ticks.
    • snapToTicks

      protected boolean snapToTicks
      Snap to ticks?
    • snapToValue

      protected boolean snapToValue
      Snap to value?
    • paintSlidingLabel

      protected boolean paintSlidingLabel
      Paint the sliding value label?
    • orientation

      protected int orientation
      Component orientation
    • changeListener

      protected ChangeListener changeListener
      The default change listener for the model.
    • labelFormat

      protected Format labelFormat
      The formatter
    • changeEvent

      protected transient ChangeEvent changeEvent
      Keep one ChangeEvent per instance
  • Constructor Details

    • JRangeSlider

      public JRangeSlider()
      Default Constructor. Creates a horizontal slider with range[0-100] and selected range [20-80].
    • JRangeSlider

      public JRangeSlider(int orientation)
      Creates a slider with the specified orientation with range [0-100] and selected range [20-80].
    • JRangeSlider

      public JRangeSlider(int min, int max, int start, int length)
      Creates a horizontal slider with the specified range and selected range.
      Parameters:
      min -
      max -
      start -
      length -
    • JRangeSlider

      public JRangeSlider(int orientation, int min, int max, int start, int length)
      Creates a slider with the spectified orientation, range, and selected range.
      Parameters:
      orientation -
      min -
      max -
      start -
      length -
  • Method Details

    • getUI

      public RangeSliderUI getUI()
      Get the UI object.
      Overrides:
      getUI in class JComponent
    • setUI

      public void setUI(RangeSliderUI ui)
      Set the component UI.
    • updateUI

      public void updateUI()
      Update UI
      Overrides:
      updateUI in class JComponent
    • getUIClassID

      public String getUIClassID()
      Get UI classname.
      Overrides:
      getUIClassID in class JComponent
    • addChangeListener

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

      public void removeChangeListener(ChangeListener listener)
      Remote a change listener.
    • getChangeListeners

      public ChangeListener[] getChangeListeners()
      Get the change listeners.
    • fireStateChange

      protected void fireStateChange()
      Fire state change.
    • getModel

      public BoundedRangeModel getModel()
      The data model that handles the components four main attributes: min, max, start, length
    • setModel

      public void setModel(BoundedRangeModel model)
      Set the model.
    • getStart

      public int getStart()
      Return the start value
    • setStart

      public void setStart(int value)
      Set the start value
      Parameters:
      value -
    • getLength

      public int getLength()
      Return the length value.
    • setLength

      public void setLength(int length)
      Set the length
      Parameters:
      length -
    • getMinimum

      public int getMinimum()
      Return the minimum
    • setMinimum

      public void setMinimum(int min)
      Set the minimum.
      Parameters:
      min -
    • getMaximum

      public int getMaximum()
      Return the maximum.
    • setMaximum

      public void setMaximum(int max)
      Set the maximum
    • getValueIsAdjusting

      public boolean getValueIsAdjusting()
      Is one of the knobs being dragged?
    • setValueIsAdjusting

      public void setValueIsAdjusting(boolean adjusting)
      Sets the valueIsAdjusting property.
    • getOrientation

      public int getOrientation()
      The component orientation.
    • setOrientation

      public void setOrientation(int orientation)
      Set the component orientaiton.
    • main

      public static void main(String[] args)
    • getLabelFormat

      public Format getLabelFormat()
    • setLabelFormat

      public void setLabelFormat(Format labelFormat)
    • isPaintSlidingLabel

      public boolean isPaintSlidingLabel()
    • setPaintSlidingLabel

      public void setPaintSlidingLabel(boolean paintSlidingLabel)