Package org.eclipse.draw2d
Class AbstractHintLayout
java.lang.Object
org.eclipse.draw2d.AbstractLayout
org.eclipse.draw2d.AbstractHintLayout
- All Implemented Interfaces:
- LayoutManager
- Direct Known Subclasses:
- BorderLayout,- GridLayout,- OrderedLayout,- ScrollPaneLayout,- StackLayout,- ViewportLayout
The foundation for layout managers which are sensitive to width and/or height
 hints. This class will cache preferred and minimum sizes for a given set of
 hints. If the hints change in a meaningful way, the cached size is thrown out
 and redetermined.
 
 Subclasses may be sensitive to one or both hints. By default, this class
 assumes both hints are important. Subclasses may override this behavior in
 isSensitiveHorizontally(IFigure) and
 isSensitiveVertically(IFigure). At least one of these method should
 return true.
- Since:
- 2.0
- 
Field SummaryFields inherited from class org.eclipse.draw2d.AbstractLayoutisObservingVisibility, preferredSize
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected DimensioncalculateMinimumSize(IFigure container, int wHint, int hHint) Calculates the minimum size using the given width and height hints.getMinimumSize(IFigure container, int w, int h) Returns the minimum size of the given figure.final DimensiongetPreferredSize(IFigure container, int w, int h) Returns the preferred size of the given figure, using width and height hints.voidExtends the superclass implementation to flush the cached minimum size.protected booleanisSensitiveHorizontally(IFigure container) Returns whether this layout manager is sensitive to changes in the horizontal hint.protected booleanisSensitiveVertically(IFigure container) Returns whether this layout manager is sensitive to changes in the vertical hint.Methods inherited from class org.eclipse.draw2d.AbstractLayoutcalculatePreferredSize, calculatePreferredSize, getBorderPreferredSize, getConstraint, getMinimumSize, getPreferredSize, invalidate, isObservingVisibility, remove, setConstraint, setObserveVisibilityMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.draw2d.LayoutManagerlayout
- 
Constructor Details- 
AbstractHintLayoutpublic AbstractHintLayout()
 
- 
- 
Method Details- 
calculateMinimumSizeCalculates the minimum size using the given width and height hints. This method is called fromgetMinimumSize(IFigure, int, int)whenever the cached minimum size has been flushed.By default, this method just calls getPreferredSize(IFigure, int, int), meaning minimum and preferres sizes will be the same unless this method is overridden.- Parameters:
- container- the Figure on which this layout is installed
- wHint- the width hint
- hHint- the height hint
- Returns:
- the layout's minimum size
 
- 
getMinimumSizeDescription copied from interface:LayoutManagerReturns the minimum size of the given figure.- Specified by:
- getMinimumSizein interface- LayoutManager
- Overrides:
- getMinimumSizein class- AbstractLayout
- Parameters:
- container- The Figure
- w- the width hint
- h- the height hint
- Returns:
- The minimum size
- See Also:
 
- 
getPreferredSizeDescription copied from class:AbstractLayoutReturns the preferred size of the given figure, using width and height hints. If the preferred size is cached, that size is returned. Otherwise,AbstractLayout.calculatePreferredSize(IFigure, int, int)is called.- Specified by:
- getPreferredSizein interface- LayoutManager
- Overrides:
- getPreferredSizein class- AbstractLayout
- Parameters:
- container- The figure
- w- The width hint
- h- The height hint
- Returns:
- The preferred size
- See Also:
 
- 
invalidatepublic void invalidate()Extends the superclass implementation to flush the cached minimum size.- Specified by:
- invalidatein interface- LayoutManager
- Overrides:
- invalidatein class- AbstractLayout
- See Also:
 
- 
isSensitiveHorizontallyReturns whether this layout manager is sensitive to changes in the horizontal hint. By default, this method returnstrue.- Parameters:
- container- the layout's container
- Returns:
- trueif this layout is sensite to horizontal hint changes
 
- 
isSensitiveVerticallyReturns whether this layout manager is sensitive to changes in the vertical hint. By default, this method returnstrue.- Parameters:
- container- the layout's container
- Returns:
- trueif this layout is sensite to vertical hint changes
 
 
-