infovis.panel.dqinter
Class BasicRangeSlider

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by infovis.panel.dqinter.BasicRangeSlider
All Implemented Interfaces:
MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener, ChangeListener

public abstract class BasicRangeSlider
extends JComponent
implements MouseListener, MouseMotionListener, ChangeListener

Base class for range sliders.

Version:
$Revision: 1.5 $
Author:
Jean-Daniel Fekete
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
 
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
BasicRangeSlider(DoubleBoundedRangeModel model)
          Creates a new RangeSlider object.
BasicRangeSlider(double minimum, double maximum, double lowValue, double highValue)
          Constructs a new range slider.
 
Method Summary
 boolean contains(double v)
          Returns true if the specified value is within the range indicated by this range slider, i˙e˙ lowValue 1 <= v <= highValue.
 double getHighValue()
          Returns the current "high" value shown by the range slider's bar.
 double getLowValue()
          Returns the current "low" value shown by the range slider's bar.
 double getMaximum()
          Returns the maximum possible value for either the low value or the high value.
 double getMinimum()
          Returns the minimum possible value for either the low value or the high value.
 void setHighValue(double highValue)
          Sets the high value shown by this range slider.
 void setLowValue(double lowValue)
          Sets the low value shown by this range slider.
 void setMaximum(double max)
          Sets the maximum value of the doubleBoundedRangeModel.
 void setMinimum(double min)
          Sets the minimum value of the doubleBoundedRangeModel.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, 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
 
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from interface java.awt.event.MouseMotionListener
mouseDragged, mouseMoved
 
Methods inherited from interface javax.swing.event.ChangeListener
stateChanged
 

Constructor Detail

BasicRangeSlider

public BasicRangeSlider(double minimum,
                        double maximum,
                        double lowValue,
                        double highValue)
Constructs a new range slider.

Parameters:
minimum - - the minimum value of the range.
maximum - - the maximum value of the range.
lowValue - - the current low value shown by the range slider's bar.
highValue - - the current high value shown by the range slider's bar.

BasicRangeSlider

public BasicRangeSlider(DoubleBoundedRangeModel model)
Creates a new RangeSlider object.

Parameters:
model - the DoubleBoundedRangeModel
Method Detail

getLowValue

public double getLowValue()
Returns the current "low" value shown by the range slider's bar. The low value meets the constraint minimum <= lowValue <= highValue <= maximum.

Returns:
the current "low" value shown by the range slider's bar.

getHighValue

public double getHighValue()
Returns the current "high" value shown by the range slider's bar. The high value meets the constraint minimum <= lowValue <= highValue <= maximum.

Returns:
the current "high" value shown by the range slider's bar.

getMinimum

public double getMinimum()
Returns the minimum possible value for either the low value or the high value.

Returns:
the minimum possible value for either the low value or the high value.

getMaximum

public double getMaximum()
Returns the maximum possible value for either the low value or the high value.

Returns:
the maximum possible value for either the low value or the high value.

contains

public boolean contains(double v)
Returns true if the specified value is within the range indicated by this range slider, i˙e˙ lowValue 1 <= v <= highValue.

Parameters:
v - value
Returns:
true if the specified value is within the range indicated by this range slider.

setLowValue

public void setLowValue(double lowValue)
Sets the low value shown by this range slider. This causes the range slider to be repainted and a RangeEvent to be fired.

Parameters:
lowValue - the low value shown by this range slider

setHighValue

public void setHighValue(double highValue)
Sets the high value shown by this range slider. This causes the range slider to be repainted and a RangeEvent to be fired.

Parameters:
highValue - the high value shown by this range slider

setMinimum

public void setMinimum(double min)
Sets the minimum value of the doubleBoundedRangeModel.

Parameters:
min - the minimum value.

setMaximum

public void setMaximum(double max)
Sets the maximum value of the doubleBoundedRangeModel.

Parameters:
max - the maximum value.


Copyright 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.