Class DoubleSlider

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--DoubleSlider

public class DoubleSlider
extends javax.swing.JPanel

Basic double-ended slider for Swing.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static int HORIZONTAL
          Orientations
static int VERTICAL
          Orientations
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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
 
Constructor Summary
DoubleSlider()
          Construct a default DoubleSlider with minimum 0.0 and maximum 100.0, oriented HORIZONTALly
DoubleSlider(int orientation, double minValue, double maxValue)
          Construct a DoubleSlider with given minimum, maximum and orientation
 
Method Summary
 void addAdjustmentListener(DoubleSliderAdjustmentListener i)
          Add a DoubleSliderAdjustmentListener to listen for adjustment events
 double getAbsoluteMaximum()
          Get the current absolute maximum value
 double getAbsoluteMinimum()
          Get the current absolute minimum value
 double getHilitedMaximum()
          Get the current hilited maximum value
 double getHilitedMinimum()
          Get the current hilited minimum value
 boolean getHiliteVisible()
          Determine whether or not the hilited range is currently marked
 double getSelectedMaximum()
          Get the current selected maximum value
 double getSelectedMinimum()
          Get the current selected maximum value
 java.awt.Color getTrackColor()
          Get the current color for the track
 boolean isTrackingDrag()
          Check whether the user is currently dragging the slider.
 void removeAdjustmentListener(DoubleSliderAdjustmentListener i)
          Remove the given DoubleSliderAdjustmentListener from the list of event listeners
 void setAbsoluteMaximum(double max)
          Set the maximum possible value
 void setAbsoluteMinimum(double min)
          Set the minimum possible value
 void setAbsoluteRange(double min, double max)
          Set the maximum possible range
 void setHilitedMaximum(double max)
          Set the maximum hilited value
 void setHilitedMinimum(double min)
          Set the minimum hilited value
 void setHilitedRange(double min, double max)
          Set the hilited range
 void setHiliteVisible(boolean visible)
          Set the marking status of the hilited range
 void setSelectedMaximum(double max)
          Set the maximum selected value
 void setSelectedMinimum(double min)
          Set the minimum selected value
 void setSelectedRange(double min, double max)
          Set the selected range
 void setTrackColor(java.awt.Color c)
          Set the current color for the track
 void setTrackNotificationThrottle(long i)
          Set the time interval between consecutive DoubleSliderAdjustmentListener notifications whilst tracking a drag.
 void setValues(double absMin, double absMax, double selectedMin, double selectedMax)
          Set the maximum possible range and selected range all together
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HORIZONTAL

public static final int HORIZONTAL
Orientations

VERTICAL

public static final int VERTICAL
Orientations
Constructor Detail

DoubleSlider

public DoubleSlider()
Construct a default DoubleSlider with minimum 0.0 and maximum 100.0, oriented HORIZONTALly

DoubleSlider

public DoubleSlider(int orientation,
                    double minValue,
                    double maxValue)
Construct a DoubleSlider with given minimum, maximum and orientation
Parameters:
orientation - HORIZONTAL or VERTICAL
minValue - The minimum value
maxValue - The maximum value
Method Detail

isTrackingDrag

public boolean isTrackingDrag()
Check whether the user is currently dragging the slider.
Returns:
true if the user is dragging the slider

addAdjustmentListener

public void addAdjustmentListener(DoubleSliderAdjustmentListener i)
Add a DoubleSliderAdjustmentListener to listen for adjustment events
Parameters:
i - the listener to add

removeAdjustmentListener

public void removeAdjustmentListener(DoubleSliderAdjustmentListener i)
Remove the given DoubleSliderAdjustmentListener from the list of event listeners
Parameters:
i - the listener to remove

setTrackNotificationThrottle

public void setTrackNotificationThrottle(long i)
Set the time interval between consecutive DoubleSliderAdjustmentListener notifications whilst tracking a drag.
Parameters:
i - the new interval in milliseconds

getHilitedMinimum

public double getHilitedMinimum()
Get the current hilited minimum value
Returns:
minimum hilited value

getHilitedMaximum

public double getHilitedMaximum()
Get the current hilited maximum value
Returns:
maximum hilited value

getSelectedMinimum

public double getSelectedMinimum()
Get the current selected maximum value
Returns:
maximum selected value

getSelectedMaximum

public double getSelectedMaximum()
Get the current selected maximum value
Returns:
maximum selected value

getAbsoluteMinimum

public double getAbsoluteMinimum()
Get the current absolute minimum value
Returns:
minimum absolute value

getAbsoluteMaximum

public double getAbsoluteMaximum()
Get the current absolute maximum value
Returns:
maximum absolute value

setHilitedMinimum

public void setHilitedMinimum(double min)
Set the minimum hilited value
Parameters:
min - the new minimum hilited value

setHilitedMaximum

public void setHilitedMaximum(double max)
Set the maximum hilited value
Parameters:
max - the new maximum hilited value

setHilitedRange

public void setHilitedRange(double min,
                            double max)
Set the hilited range
Parameters:
min - the new minimum hilited value
max - the new maximum hilited value

getHiliteVisible

public boolean getHiliteVisible()
Determine whether or not the hilited range is currently marked
Returns:
true if it is currently being marked

setHiliteVisible

public void setHiliteVisible(boolean visible)
Set the marking status of the hilited range
Parameters:
visible - the new marking status

setSelectedMinimum

public void setSelectedMinimum(double min)
Set the minimum selected value
Parameters:
min - the new minimum selected value

setSelectedMaximum

public void setSelectedMaximum(double max)
Set the maximum selected value
Parameters:
max - the new maximum selected value

setSelectedRange

public void setSelectedRange(double min,
                             double max)
Set the selected range
Parameters:
min - the new minimum selected value
max - the new maximum selected value

setAbsoluteMinimum

public void setAbsoluteMinimum(double min)
Set the minimum possible value
Parameters:
min - the new minimum possible value

setAbsoluteMaximum

public void setAbsoluteMaximum(double max)
Set the maximum possible value
Parameters:
max - the new maximum possible value

setAbsoluteRange

public void setAbsoluteRange(double min,
                             double max)
Set the maximum possible range
Parameters:
min - the new minimum possible value
max - the new maximum possible value

setValues

public void setValues(double absMin,
                      double absMax,
                      double selectedMin,
                      double selectedMax)
Set the maximum possible range and selected range all together
Parameters:
absMin - the new minimum possible value
absMax - the new maximum possible value
selectedMin - the new minimum selected value
selectedMax - the new maximum selected value

getTrackColor

public java.awt.Color getTrackColor()
Get the current color for the track
Returns:
The current track color

setTrackColor

public void setTrackColor(java.awt.Color c)
Set the current color for the track
Parameters:
c - the new color