visad.util
Class BarSlider

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byvisad.util.Slider
                      extended byvisad.util.BarSlider
All Implemented Interfaces:
Accessible, EventListener, ImageObserver, MenuContainer, MouseListener, MouseMotionListener, Serializable

public class BarSlider
extends Slider
implements MouseListener, MouseMotionListener

The visad utillity sliding bar

Since:
Visad Utility Library v0.7.1
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
(package private)  Dimension maxSize
           
(package private)  Dimension minSize
          widget sizes
(package private)  Dimension prefSize
           
 
Fields inherited from class visad.util.Slider
listeners, name
 
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.Container
 
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
BarSlider()
          Construct a new bar slider with the default values
BarSlider(float lower, float upper, float initial)
          Construct a new bar slider with the givden lower, upper and initial values
 
Method Summary
 float getMaximum()
          Return the maximum value of this slider
 Dimension getMaximumSize()
          Return the maximum size of the bar slider
 float getMinimum()
          Return the minimum value of this slider
 Dimension getMinimumSize()
          Return the minimum size of the bar slider
 Dimension getPreferredSize()
          Return the preferred sise of the bar slider
 float getValue()
          Returns the current value of the slider
static void main(String[] argv)
          For testing puropses
 void mouseClicked(MouseEvent e)
          Present to implement MouseListener, currently ignored
 void mouseDragged(MouseEvent e)
          Updates the slider position
 void mouseEntered(MouseEvent e)
          Present to implement MouseListener, currently ignored
 void mouseExited(MouseEvent e)
          Present to implement MouseListener, currently ignored
 void mouseMoved(MouseEvent e)
          Present to implement MouseMovementListener, currently ignored
 void mousePressed(MouseEvent e)
          Moves the slider to the clicked position
 void mouseReleased(MouseEvent e)
          Present to implement MouseListener, currently ignored
 void paint(Graphics g)
          Redraw the slider
 void setMaximum(float value)
          Sets the maximum value of this scrolbar
 void setMaximumSize(Dimension dim)
          Set the preferred size of the bar slider
 void setMinimum(float value)
          Sets the minimum value for this slider
 void setMinimumSize(Dimension dim)
          Set the preferred size of the bar slider
 void setPreferredSize(Dimension dim)
          Set the preferred size of the bar slider
 void setValue(float value)
          Sets the current value of the slider
 void update(Graphics g)
          update the slider
 
Methods inherited from class visad.util.Slider
addSliderChangeListener, getName, notifyListeners, removeSliderChangeListener
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

minSize

Dimension minSize
widget sizes


prefSize

Dimension prefSize

maxSize

Dimension maxSize
Constructor Detail

BarSlider

public BarSlider()
Construct a new bar slider with the default values


BarSlider

public BarSlider(float lower,
                 float upper,
                 float initial)
Construct a new bar slider with the givden lower, upper and initial values

Throws:
IllegalArgumenentException - if lower is not less than initial or initial is not less than upper
Method Detail

main

public static void main(String[] argv)
For testing puropses


getMinimum

public float getMinimum()
Return the minimum value of this slider

Specified by:
getMinimum in class Slider

setMinimum

public void setMinimum(float value)
Sets the minimum value for this slider

Specified by:
setMinimum in class Slider

getMaximum

public float getMaximum()
Return the maximum value of this slider

Specified by:
getMaximum in class Slider

setMaximum

public void setMaximum(float value)
Sets the maximum value of this scrolbar

Specified by:
setMaximum in class Slider

getValue

public float getValue()
Returns the current value of the slider

Specified by:
getValue in class Slider

setValue

public void setValue(float value)
Sets the current value of the slider

Specified by:
setValue in class Slider
Throws:
IllegalArgumentException - if the new value is out of bounds for the slider

getPreferredSize

public Dimension getPreferredSize()
Return the preferred sise of the bar slider


setPreferredSize

public void setPreferredSize(Dimension dim)
Set the preferred size of the bar slider


getMaximumSize

public Dimension getMaximumSize()
Return the maximum size of the bar slider


setMaximumSize

public void setMaximumSize(Dimension dim)
Set the preferred size of the bar slider


getMinimumSize

public Dimension getMinimumSize()
Return the minimum size of the bar slider


setMinimumSize

public void setMinimumSize(Dimension dim)
Set the preferred size of the bar slider


mouseClicked

public void mouseClicked(MouseEvent e)
Present to implement MouseListener, currently ignored

Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Present to implement MouseListener, currently ignored

Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Present to implement MouseListener, currently ignored

Specified by:
mouseExited in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Moves the slider to the clicked position

Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Present to implement MouseListener, currently ignored

Specified by:
mouseReleased in interface MouseListener

mouseDragged

public void mouseDragged(MouseEvent e)
Updates the slider position

Specified by:
mouseDragged in interface MouseMotionListener

mouseMoved

public void mouseMoved(MouseEvent e)
Present to implement MouseMovementListener, currently ignored

Specified by:
mouseMoved in interface MouseMotionListener

update

public void update(Graphics g)
update the slider


paint

public void paint(Graphics g)
Redraw the slider