Eclipse Draw2d
2.1

org.eclipse.draw2d
Class ScrollBar

java.lang.Object
  |
  +--org.eclipse.draw2d.Figure
        |
        +--org.eclipse.draw2d.ScrollBar
All Implemented Interfaces:
EventListener, IFigure, Orientable, PositionConstants, PropertyChangeListener

public class ScrollBar
extends Figure
implements Orientable, PropertyChangeListener

Provides for the scrollbars used by the ScrollPane. A ScrollBar is made up of five essential Figures: An 'Up' arrow button, a 'Down' arrow button, a draggable 'Thumb', a 'Pageup' button, and a 'Pagedown' button.


Nested Class Summary
 
Nested classes inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator
 
Nested classes inherited from class org.eclipse.draw2d.IFigure
IFigure.NoInsets
 
Field Summary
protected static int MAX_FLAG
           
protected  org.eclipse.draw2d.ScrollBar.ThumbDragger thumbDragger
           
protected  Transposer transposer
           
 
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, maxSize, minSize, NO_MANAGER, prefSize, toolTip
 
Fields inherited from interface org.eclipse.draw2d.Orientable
HORIZONTAL, VERTICAL
 
Fields inherited from interface org.eclipse.draw2d.PositionConstants
BOTTOM, CENTER, EAST, EAST_WEST, LEFT, LEFT_CENTER_RIGHT, MIDDLE, NONE, NORTH, NORTH_EAST, NORTH_SOUTH, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TOP_MIDDLE_BOTTOM, WEST
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Constructor Summary
ScrollBar()
          Constructs a ScrollBar.
 
Method Summary
protected  Clickable createDefaultDownButton()
          Creates the default 'Down' ArrowButton for the ScrollBar.
protected  IFigure createDefaultThumb()
          Creates the Scrollbar's "thumb", the draggable Figure that indicates the Scrollbar's position.
protected  Clickable createDefaultUpButton()
          Creates the default 'Up' ArrowButton for the ScrollBar.
protected  Clickable createPageDown()
          Creates the pagedown Figure for the Scrollbar.
protected  Clickable createPageUp()
          Creates the pageup Figure for the Scrollbar.
protected  IFigure getButtonDown()
           
protected  IFigure getButtonUp()
           
 int getExtent()
           
 int getMaximum()
           
 int getMinimum()
           
protected  IFigure getPageDown()
           
 int getPageIncrement()
           
protected  IFigure getPageUp()
           
 RangeModel getRangeModel()
           
 int getStepIncrement()
           
protected  IFigure getThumb()
           
 int getValue()
           
protected  int getValueRange()
           
protected  void initialize()
          Initilization of the ScrollBar.
 boolean isHorizontal()
           
 void propertyChange(PropertyChangeEvent event)
           
 void revalidate()
          Revalidates this IFigure.
 void setDirection(int direction)
          Sets the direction the orientable figure will face.
 void setDownClickable(Clickable down)
          Sets the Clickable that represents the down arrow of the Scrollbar to down.
 void setEnabled(boolean value)
          Sets enabled status of Scrollbar to value.
 void setExtent(int ext)
          Sets the extent of the Scrollbar to ext
 void setHorizontal(boolean value)
          Sets the orientation of the ScrollBar.
 void setMaximum(int max)
          The ScrollBars position is designated by integer values.
 void setMinimum(int min)
          The ScrollBars position is designated by integer values.
 void setOrientation(int value)
          Sets the orientation of the ScrollBar to the passed value.
 void setPageDown(Clickable down)
          Sets the pagedown button to the passed Clickable.
 void setPageIncrement(int increment)
          Sets the ScrollBar to scroll increment pixels when its pageup or pagedown buttons are pressed.
 void setPageUp(Clickable up)
          Sets the pageup button to the passed Clickable.
 void setRangeModel(RangeModel rangeModel)
          Sets the ScrollBar's RangeModel to the passed value.
 void setStepIncrement(int increment)
          Sets the ScrollBar's step increment to the passed value.
 void setThumb(IFigure figure)
          Sets the ScrollBar's thumb to the passed Figure.
 void setUpClickable(Clickable up)
          Sets the Clickable that represents the up arrow of the Scrollbar to up.
 void setValue(int v)
          Sets the value of the Scrollbar to v
protected  void stepDown()
          Causes the ScrollBar to scroll down (or right) by the value of its step increment.
protected  void stepUp()
          Causes the ScrollBar to scroll up (or left) by the value of its step increment.
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addFigureListener, addFocusListener, addKeyListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isEnabled, isFocusTraversable, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeFigureListener, removeFocusListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setConstraint, setCursor, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.draw2d.IFigure
add, add, add, add, addAncestorListener, addFigureListener, addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isEnabled, isFocusTraversable, isOpaque, isRequestFocusEnabled, isVisible, paint, remove, removeAncestorListener, removeFigureListener, removeFocusListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, setBackgroundColor, setBorder, setBounds, setConstraint, setCursor, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
 

Field Detail

MAX_FLAG

protected static final int MAX_FLAG

thumbDragger

protected org.eclipse.draw2d.ScrollBar.ThumbDragger thumbDragger

transposer

protected final Transposer transposer
Constructor Detail

ScrollBar

public ScrollBar()
Constructs a ScrollBar. ScrollBar orientation is vertical by default. Call setHorizontal(true) to set horizontal orientation.

Since:
2.0
Method Detail

createDefaultUpButton

protected Clickable createDefaultUpButton()
Creates the default 'Up' ArrowButton for the ScrollBar.

Since:
2.0

createDefaultDownButton

protected Clickable createDefaultDownButton()
Creates the default 'Down' ArrowButton for the ScrollBar.

Since:
2.0

createPageDown

protected Clickable createPageDown()
Creates the pagedown Figure for the Scrollbar.

Since:
2.0

createPageUp

protected Clickable createPageUp()
Creates the pageup Figure for the Scrollbar.

Since:
2.0

createDefaultThumb

protected IFigure createDefaultThumb()
Creates the Scrollbar's "thumb", the draggable Figure that indicates the Scrollbar's position.

Since:
2.0

getButtonUp

protected IFigure getButtonUp()

getButtonDown

protected IFigure getButtonDown()

getExtent

public int getExtent()

getMinimum

public int getMinimum()

getMaximum

public int getMaximum()

getPageDown

protected IFigure getPageDown()

getPageIncrement

public int getPageIncrement()

getPageUp

protected IFigure getPageUp()

getRangeModel

public RangeModel getRangeModel()

getStepIncrement

public int getStepIncrement()

getThumb

protected IFigure getThumb()

getValue

public int getValue()

getValueRange

protected int getValueRange()

initialize

protected void initialize()
Initilization of the ScrollBar. Sets the Scrollbar to have a ScrollBarLayout with vertical orientation. Creates the Figures that make up the components of the ScrollBar.

Since:
2.0

isHorizontal

public boolean isHorizontal()

propertyChange

public void propertyChange(PropertyChangeEvent event)
Specified by:
propertyChange in interface PropertyChangeListener

revalidate

public void revalidate()
Description copied from interface: IFigure
Revalidates this IFigure.

Specified by:
revalidate in interface IFigure
Overrides:
revalidate in class Figure
See Also:
IFigure.revalidate()

setDirection

public void setDirection(int direction)
Description copied from interface: Orientable
Sets the direction the orientable figure will face. Can be one of many directional constants defined in PositionConstants.

Specified by:
setDirection in interface Orientable
Parameters:
direction - The direction

setDownClickable

public void setDownClickable(Clickable down)
Sets the Clickable that represents the down arrow of the Scrollbar to down.

Since:
2.0

setUpClickable

public void setUpClickable(Clickable up)
Sets the Clickable that represents the up arrow of the Scrollbar to up.

Since:
2.0

setEnabled

public void setEnabled(boolean value)
Sets enabled status of Scrollbar to value.

Specified by:
setEnabled in interface IFigure
Overrides:
setEnabled in class Figure
Parameters:
value - true if this IFigure should be enabled
Since:
2.0

setExtent

public void setExtent(int ext)
Sets the extent of the Scrollbar to ext

Since:
2.0

setHorizontal

public final void setHorizontal(boolean value)
Sets the orientation of the ScrollBar.

Parameters:
value - If true, Scrollbar will have horizontal orientation. If false ScrollBar will have vertical orientation.
Since:
2.0

setMaximum

public void setMaximum(int max)
The ScrollBars position is designated by integer values. Sets the maximum position to max

Since:
2.0

setMinimum

public void setMinimum(int min)
The ScrollBars position is designated by integer values. Sets the minimum position to min

Since:
2.0

setOrientation

public void setOrientation(int value)
Sets the orientation of the ScrollBar to the passed value.

Specified by:
setOrientation in interface Orientable
Parameters:
value - Can be either HORIZONTAL or VERTICAL as seen in Orientable
Since:
2.0

setPageIncrement

public void setPageIncrement(int increment)
Sets the ScrollBar to scroll increment pixels when its pageup or pagedown buttons are pressed. (Note that the pageup and pagedown buttons are NOT the arrow buttons, they are the figures between the arrow buttons and the ScrollBar's thumb figure).

Since:
2.0

setPageDown

public void setPageDown(Clickable down)
Sets the pagedown button to the passed Clickable. The pagedown button is the figure between the down arrow button and the ScrollBar's thumb figure.

Since:
2.0

setPageUp

public void setPageUp(Clickable up)
Sets the pageup button to the passed Clickable. The pageup button is the rectangular figure between the down arrow button and the ScrollBar's thumb figure.

Since:
2.0

setRangeModel

public void setRangeModel(RangeModel rangeModel)
Sets the ScrollBar's RangeModel to the passed value.

Since:
2.0

setStepIncrement

public void setStepIncrement(int increment)
Sets the ScrollBar's step increment to the passed value. The step increment indicates how many pixels the ScrollBar will scroll when its up or down arrow button is pressed.

Since:
2.0

setThumb

public void setThumb(IFigure figure)
Sets the ScrollBar's thumb to the passed Figure. The thumb is the draggable component of the ScrollBar that indicates the ScrollBar's position.

Since:
2.0

setValue

public void setValue(int v)
Sets the value of the Scrollbar to v

Since:
2.0

stepDown

protected void stepDown()
Causes the ScrollBar to scroll down (or right) by the value of its step increment.

Since:
2.0

stepUp

protected void stepUp()
Causes the ScrollBar to scroll up (or left) by the value of its step increment.

Since:
2.0

Eclipse Draw2d
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.