Package org.eclipse.draw2d
Class ScrollBarLayout
java.lang.Object
org.eclipse.draw2d.AbstractLayout
org.eclipse.draw2d.ScrollBarLayout
- All Implemented Interfaces:
LayoutManager
Lays out the Figures that make up a ScrollBar.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Used as a constraint for the down arrow figure.static final String
Used as a constraint for the page down figure.static final String
Used as a constraint for the page up figure.static final String
Used as a constraint for the thumb figure.protected final Transposer
Transposes values if the ScrollBar is horizontally oriented.static final String
Used as a constraint for the up arrow figure.Fields inherited from class org.eclipse.draw2d.AbstractLayout
isObservingVisibility, preferredSize
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Dimension
calculatePreferredSize
(IFigure parent, int w, int h) Calculates the preferred size of the given figure, using width and height hints.void
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
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, isObservingVisibility, setObserveVisibility
-
Field Details
-
UP_ARROW
Used as a constraint for the up arrow figure.- See Also:
-
DOWN_ARROW
Used as a constraint for the down arrow figure.- See Also:
-
THUMB
Used as a constraint for the thumb figure.- See Also:
-
PAGE_UP
Used as a constraint for the page up figure.- See Also:
-
PAGE_DOWN
Used as a constraint for the page down figure.- See Also:
-
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 Details
-
ScrollBarLayout
Constructs a ScrollBarLayout. If the given Transposer is enabled, the Scrollbar will be horizontally oriented. Otherwise, the ScrollBar will be vertically oriented.- Parameters:
t
- the Transposer- Since:
- 2.0
-
-
Method Details
-
setConstraint
Description copied from class:AbstractLayout
Sets the constraint for the given figure.- Specified by:
setConstraint
in interfaceLayoutManager
- Overrides:
setConstraint
in classAbstractLayout
- Parameters:
figure
- the childconstraint
- the child's new constraint- See Also:
-
calculatePreferredSize
Description copied from class:AbstractLayout
Calculates the preferred size of the given figure, using width and height hints.- Specified by:
calculatePreferredSize
in classAbstractLayout
- Parameters:
parent
- The figurew
- The width hinth
- The height hint- Returns:
- The preferred size
- See Also:
-
layout
Description copied from interface:LayoutManager
Lays out the given figure.- Parameters:
parent
- The figure- See Also:
-
layoutButtons
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.- Parameters:
scrollBar
- the scrollbar whose buttons are being layed out- Returns:
- the Rectangle into which the track should be placed
- Since:
- 2.0
-
remove
Description copied from class:AbstractLayout
Removes the given figure from this LayoutManager's list of figures.- Specified by:
remove
in interfaceLayoutManager
- Overrides:
remove
in classAbstractLayout
- Parameters:
child
- The figure to remove- See Also:
-