Package org.eclipse.draw2d
Class AbstractLayout
java.lang.Object
org.eclipse.draw2d.AbstractLayout
- All Implemented Interfaces:
LayoutManager
- Direct Known Subclasses:
AbstractConstraintLayout
,AbstractHintLayout
,ScrollBarLayout
Provides generic support for LayoutManagers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Whether or not this layout pays attention to visiblity of figures when calculating its bounds.protected Dimension
The cached preferred size. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
calculatePreferredSize
(IFigure container) This method is nowcalculatePreferredSize(IFigure, int, int)
.protected abstract Dimension
calculatePreferredSize
(IFigure container, int wHint, int hHint) Calculates the preferred size of the given figure, using width and height hints.protected Dimension
getBorderPreferredSize
(IFigure container) Returns the preferred size of the figure's border.getConstraint
(IFigure child) Returns the constraint for the given figure.final void
getMinimumSize
(IFigure container) This method is nowgetMinimumSize(IFigure, int, int)
.getMinimumSize
(IFigure container, int wHint, int hHint) Returns the minimum size of the given figure.final void
getPreferredSize
(IFigure container) This method is nowgetPreferredSize(IFigure, int, int)
.getPreferredSize
(IFigure container, int wHint, int hHint) Returns the preferred size of the given figure, using width and height hints.void
Tells the LayoutManager to throw away all cached information about the figures it is responsible for.protected void
invalidate
(IFigure child) Removes any cached information about the given figure.boolean
Returns whether or not this layout pays attention to visiblity when calculating its bounds.void
Removes the given figure from this LayoutManager's list of figures.void
setConstraint
(IFigure child, Object constraint) Sets the constraint for the given figure.void
setObserveVisibility
(boolean newValue) Sets isObservingVisibility to the given value.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.LayoutManager
layout
-
Field Details
-
preferredSize
The cached preferred size. -
isObservingVisibility
protected boolean isObservingVisibilityWhether or not this layout pays attention to visiblity of figures when calculating its bounds. By default, false.
-
-
Constructor Details
-
AbstractLayout
public AbstractLayout()
-
-
Method Details
-
calculatePreferredSize
This method is nowcalculatePreferredSize(IFigure, int, int)
.- Parameters:
container
- the figure
-
calculatePreferredSize
Calculates the preferred size of the given figure, using width and height hints.- Parameters:
container
- The figurewHint
- The width hinthHint
- The height hint- Returns:
- The preferred size
-
getBorderPreferredSize
Returns the preferred size of the figure's border.- Parameters:
container
- The figure that the border is on- Returns:
- The border's preferred size
-
getConstraint
Returns the constraint for the given figure.- Specified by:
getConstraint
in interfaceLayoutManager
- Parameters:
child
- The figure- Returns:
- The constraint
-
getMinimumSize
This method is nowgetMinimumSize(IFigure, int, int)
.- Parameters:
container
- the figure
-
getMinimumSize
Description copied from interface:LayoutManager
Returns the minimum size of the given figure.- Specified by:
getMinimumSize
in interfaceLayoutManager
- Parameters:
container
- The FigurewHint
- the width hinthHint
- the height hint- Returns:
- The minimum size
- See Also:
-
getPreferredSize
Returns the preferred size of the given figure, using width and height hints. If the preferred size is cached, that size is returned. Otherwise,calculatePreferredSize(IFigure, int, int)
is called.- Specified by:
getPreferredSize
in interfaceLayoutManager
- Parameters:
container
- The figurewHint
- The width hinthHint
- The height hint- Returns:
- The preferred size
-
getPreferredSize
This method is nowgetPreferredSize(IFigure, int, int)
.- Parameters:
container
- the figure
-
invalidate
public void invalidate()Description copied from interface:LayoutManager
Tells the LayoutManager to throw away all cached information about the figures it is responsible for. This method is called whenever the owning figure is invalidated.- Specified by:
invalidate
in interfaceLayoutManager
- See Also:
-
invalidate
Removes any cached information about the given figure.- Parameters:
child
- the child that is invalidated
-
isObservingVisibility
public boolean isObservingVisibility()Returns whether or not this layout pays attention to visiblity when calculating its bounds.- Returns:
- true if invisible figures should not contribute to this layout's bounds.
-
remove
Removes the given figure from this LayoutManager's list of figures.- Specified by:
remove
in interfaceLayoutManager
- Parameters:
child
- The figure to remove
-
setConstraint
Sets the constraint for the given figure.- Specified by:
setConstraint
in interfaceLayoutManager
- Parameters:
child
- the childconstraint
- the child's new constraint
-
setObserveVisibility
public void setObserveVisibility(boolean newValue) Sets isObservingVisibility to the given value.- Parameters:
newValue
-true
if visibility should be observed
-