org.w3c.tools.widgets
Class Slider

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by org.w3c.tools.widgets.Slider
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class Slider
extends java.awt.Canvas

Slider :

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  org.w3c.tools.widgets.Slider.Pointer pointer
           
 
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
Slider()
          Constructs an invisible Slider.
Slider(int minPixelStep, boolean border)
          Constructs an invisible Slider.
 
Method Summary
protected  int getGoodX(int x)
           
protected  int getGraduationLength()
           
 java.awt.Dimension getMinimumSize()
          Gets the mininimum size of this component.
 double getValue()
          Get the current value pointed by the slider.
 void initialize(double min, double max, double step)
          Initialize the slider's bounds and Step
 void initialize(double min, double max, double step, boolean border)
           
 void initialize(long min, long max, long step)
           
 void initialize(long min, long max, long step, boolean border)
           
static void main(java.lang.String[] argv)
           
protected  void movePointerTo(int x, int y)
           
protected  void movePointerTo(java.awt.Point p)
           
 void paint(java.awt.Graphics g)
          paint the slider.
protected  void paintGraduation(java.awt.Graphics g)
           
 void setBounds(double min, double max)
          Set the bounds of the slider.
 void setColor(java.awt.Color color)
          Set the slider's color.
protected  void setDefaultSize(double min, double max, double step)
           
 void setMax(double max)
          Set the maximum bound of the slider.
 void setMin(double min)
          Set the minimum bound of the slider.
 void setStep(double step)
          Set the step of the slider.
 void setValue(double value)
          Set the value pointed by the slider.
 void setValue(long value)
           
protected  void update()
           
 void update(java.awt.Graphics g)
          update the slider.
protected  void updateCurrentGraduation()
           
protected  void updateGraduationPosition()
           
protected  void updatePointerPosition(double value)
           
 void updateSize(java.awt.Dimension d)
          Resizes this component so that it has width "width" and height "height".
 void updateSize(int width, int height)
          Resizes this component so that it has width "width" and height "height".
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pointer

protected org.w3c.tools.widgets.Slider.Pointer pointer
Constructor Detail

Slider

public Slider(int minPixelStep,
              boolean border)
Constructs an invisible Slider. use initialize to define it.

Parameters:
minPixelStep - - the min step (in pixels) between two positions.
border - - if true draw a border arround the slider.

Slider

public Slider()
Constructs an invisible Slider. use initialize to define it.

Method Detail

updateCurrentGraduation

protected void updateCurrentGraduation()

getGoodX

protected int getGoodX(int x)

getValue

public double getValue()
Get the current value pointed by the slider.

Returns:
the value.

updatePointerPosition

protected void updatePointerPosition(double value)

setValue

public void setValue(double value)
Set the value pointed by the slider. if the value is too high, resize the slider.

Parameters:
The - value to point.

setValue

public void setValue(long value)

movePointerTo

protected void movePointerTo(int x,
                             int y)

movePointerTo

protected void movePointerTo(java.awt.Point p)

paint

public void paint(java.awt.Graphics g)
paint the slider.

Overrides:
paint in class java.awt.Canvas

getGraduationLength

protected int getGraduationLength()

updateGraduationPosition

protected void updateGraduationPosition()

paintGraduation

protected void paintGraduation(java.awt.Graphics g)

update

public void update(java.awt.Graphics g)
update the slider.

Overrides:
update in class java.awt.Canvas

setDefaultSize

protected void setDefaultSize(double min,
                              double max,
                              double step)

updateSize

public void updateSize(java.awt.Dimension d)
Resizes this component so that it has width "width" and height "height".

Parameters:
d - - The dimension specifying the new size of this slider.

updateSize

public void updateSize(int width,
                       int height)
Resizes this component so that it has width "width" and height "height".

Parameters:
width - - The new width of this slider
height - - The new height of this slider

getMinimumSize

public java.awt.Dimension getMinimumSize()
Gets the mininimum size of this component.

Overrides:
getMinimumSize in class java.awt.Component
Returns:
A dimension object indicating this slider's minimum size.

setColor

public void setColor(java.awt.Color color)
Set the slider's color.

Parameters:
color - - the slider's color.

setMin

public void setMin(double min)
Set the minimum bound of the slider. Use initialize or SetBounds if you want to set more than one value.

Parameters:
min - - the min bound
See Also:
setMax(double), setBounds(double, double), setStep(double), initialize(double, double, double)

setMax

public void setMax(double max)
Set the maximum bound of the slider. Use initialize or SetBounds if you want to set more than one value.

Parameters:
max - - the max bound
See Also:
setMin(double), setBounds(double, double), setStep(double), initialize(double, double, double)

setBounds

public void setBounds(double min,
                      double max)
Set the bounds of the slider.

Parameters:
min - - the min bound
max - - the max bound
See Also:
setMin(double), setMax(double), setStep(double), initialize(double, double, double)

setStep

public void setStep(double step)
Set the step of the slider. Use initialize or SetBounds if you want to set more than one value.

Parameters:
step - - the step between two position
See Also:
setMin(double), setMax(double), setBounds(double, double), initialize(double, double, double)

initialize

public void initialize(double min,
                       double max,
                       double step)
Initialize the slider's bounds and Step

Parameters:
min - - the min bound
max - - the max bound
step - - the step between two position
See Also:
setMin(double), setMax(double), setBounds(double, double), initialize(double, double, double)

initialize

public void initialize(double min,
                       double max,
                       double step,
                       boolean border)

initialize

public void initialize(long min,
                       long max,
                       long step)

initialize

public void initialize(long min,
                       long max,
                       long step,
                       boolean border)

update

protected void update()

main

public static void main(java.lang.String[] argv)