Eclipse Draw2d
2.1

org.eclipse.draw2d
Class ScrollBarLayout

java.lang.Object
  |
  +--org.eclipse.draw2d.AbstractLayout
        |
        +--org.eclipse.draw2d.ScrollBarLayout
All Implemented Interfaces:
LayoutManager

public class ScrollBarLayout
extends AbstractLayout

Private class that lays out the Figures that make up a ScrollBar.


Field Summary
static String DOWN_ARROW
           
static String PAGE_DOWN
           
static String PAGE_UP
           
static String THUMB
           
protected  Transposer transposer
          Transposes values if the ScrollBar is horizontally oriented.
static String UP_ARROW
           
 
Fields inherited from class org.eclipse.draw2d.AbstractLayout
preferredSize
 
Constructor Summary
ScrollBarLayout(Transposer t)
          Constructs a ScrollBarLayout.
 
Method Summary
protected  Dimension calculatePreferredSize(IFigure parent, int w, int h)
          Calculates and returns the preferred size of the container given as input.
 void layout(IFigure parent)
          Lays out the given figure.
protected  Rectangle layoutButtons(ScrollBar scrollBar)
          Places the buttons and returns the Rectangle into which the Track should be placed.
 void remove(IFigure child)
          Removes the given figure from this LayoutManager's list of figures.
 void setConstraint(IFigure figure, Object constraint)
          Sets the constraint for the given figure.
 
Methods inherited from class org.eclipse.draw2d.AbstractLayout
calculatePreferredSize, getBorderPreferredSize, getConstraint, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, invalidate, invalidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UP_ARROW

public static final String UP_ARROW
See Also:
Constant Field Values

DOWN_ARROW

public static final String DOWN_ARROW
See Also:
Constant Field Values

THUMB

public static final String THUMB
See Also:
Constant Field Values

PAGE_UP

public static final String PAGE_UP
See Also:
Constant Field Values

PAGE_DOWN

public static final String PAGE_DOWN
See Also:
Constant Field Values

transposer

protected final Transposer transposer
Transposes values if the ScrollBar is horizontally oriented. When used properly, the layout manager just needs to code for one case: vertical orientation.

Constructor Detail

ScrollBarLayout

public ScrollBarLayout(Transposer t)
Constructs a ScrollBarLayout.

Parameters:
t - If enabled, Scrollbar will be horizontally oriented. If disabled, ScrollBar will be vertically oriented.
Since:
2.0
Method Detail

setConstraint

public void setConstraint(IFigure figure,
                          Object constraint)
Description copied from class: AbstractLayout
Sets the constraint for the given figure.

Specified by:
setConstraint in interface LayoutManager
Overrides:
setConstraint in class AbstractLayout
Parameters:
figure - the child
constraint - the child's new constraint

calculatePreferredSize

protected Dimension calculatePreferredSize(IFigure parent,
                                           int w,
                                           int h)
Calculates and returns the preferred size of the container given as input.

Specified by:
calculatePreferredSize in class AbstractLayout
Parameters:
parent - Figure whose preferred size is required.
w - The width hint
h - The height hint
Returns:
The preferred size of the figure input.
Since:
2.0

layout

public void layout(IFigure parent)
Description copied from interface: LayoutManager
Lays out the given figure.

Parameters:
parent - The figure

layoutButtons

protected Rectangle layoutButtons(ScrollBar scrollBar)
Places the buttons and returns the Rectangle into which the Track should be placed. The track consists of the pageup, pagedown, and thumb figures. The Rectangle returned should be transposed correctly, that is, it should be vertically oriented. Users of the rectangle will re-transpose it for horizontal use.

Since:
2.0

remove

public void remove(IFigure child)
Description copied from class: AbstractLayout
Removes the given figure from this LayoutManager's list of figures.

Specified by:
remove in interface LayoutManager
Overrides:
remove in class AbstractLayout
Parameters:
child - The figure to remove

Eclipse Draw2d
2.1

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