Package org.eclipse.draw2d
Class ViewportLayout
java.lang.Object
org.eclipse.draw2d.AbstractLayout
org.eclipse.draw2d.AbstractHintLayout
org.eclipse.draw2d.ViewportLayout
- All Implemented Interfaces:
LayoutManager
Layout for a viewport. A viewport is a flexible window onto a figure.
-
Field Summary
Fields inherited from class org.eclipse.draw2d.AbstractLayout
isObservingVisibility, preferredSize
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Dimension
calculateMinimumSize
(IFigure figure, int wHint, int hHint) Returns the minimum size required by the input viewport figure.protected Dimension
calculatePreferredSize
(IFigure parent, int wHint, int hHint) Calculates and returns the preferred size of the figure based on the given hints.protected boolean
isSensitiveHorizontally
(IFigure parent) Returns whether this layout manager is sensitive to changes in the horizontal hint.protected boolean
isSensitiveVertically
(IFigure parent) Returns whether this layout manager is sensitive to changes in the vertical hint.void
Lays out the given figure.Methods inherited from class org.eclipse.draw2d.AbstractHintLayout
getMinimumSize, getPreferredSize, invalidate
Methods inherited from class org.eclipse.draw2d.AbstractLayout
calculatePreferredSize, getBorderPreferredSize, getConstraint, getMinimumSize, getPreferredSize, invalidate, isObservingVisibility, remove, setConstraint, setObserveVisibility
-
Constructor Details
-
ViewportLayout
public ViewportLayout()
-
-
Method Details
-
calculateMinimumSize
Returns the minimum size required by the input viewport figure. Since viewport is flexible, the minimum size required would be the just the size of the borders.- Overrides:
calculateMinimumSize
in classAbstractHintLayout
- Parameters:
figure
- the Figure on which this layout is installedwHint
- the width hinthHint
- the height hint- Returns:
- the layout's minimum size
- See Also:
-
calculatePreferredSize
Calculates and returns the preferred size of the figure based on the given hints. The given wHint is ignored unless the viewport (parent) is tracking width. The same is true for the height hint.- Specified by:
calculatePreferredSize
in classAbstractLayout
- Parameters:
parent
- the Viewport whose preferred size is to be calculatedwHint
- the width hinthHint
- the height hint- Returns:
- the Preferred size of the given viewport
- Since:
- 2.0
-
isSensitiveHorizontally
Description copied from class:AbstractHintLayout
Returns whether this layout manager is sensitive to changes in the horizontal hint. By default, this method returnstrue
.- Overrides:
isSensitiveHorizontally
in classAbstractHintLayout
- Parameters:
parent
- the layout's container- Returns:
true
if this layout is sensite to horizontal hint changes- See Also:
-
isSensitiveVertically
Description copied from class:AbstractHintLayout
Returns whether this layout manager is sensitive to changes in the vertical hint. By default, this method returnstrue
.- Overrides:
isSensitiveVertically
in classAbstractHintLayout
- Parameters:
parent
- the layout's container- Returns:
true
if this layout is sensite to vertical hint changes- See Also:
-
layout
Description copied from interface:LayoutManager
Lays out the given figure.- Parameters:
figure
- The figure- See Also:
-