Package org.eclipse.draw2d
Class XYLayout
java.lang.Object
org.eclipse.draw2d.AbstractLayout
org.eclipse.draw2d.AbstractConstraintLayout
org.eclipse.draw2d.XYLayout
- All Implemented Interfaces:
- LayoutManager
- Direct Known Subclasses:
- FreeformLayout
This class implements the 
LayoutManager interface
 using the XY Layout algorithm. This lays out the components using the layout
 constraints as defined by each component.- 
Field SummaryFields inherited from class org.eclipse.draw2d.AbstractConstraintLayoutconstraintsFields inherited from class org.eclipse.draw2d.AbstractLayoutisObservingVisibility, preferredSize
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected DimensioncalculatePreferredSize(IFigure f, int wHint, int hHint) Calculates and returns the preferred size of the input figure.Returns the origin for the given figure.voidImplements the algorithm to layout the components of the given container figure.voidsetConstraint(IFigure figure, Object newConstraint) Sets the layout constraint of the given figure.Methods inherited from class org.eclipse.draw2d.AbstractConstraintLayoutgetConstraint, removeMethods inherited from class org.eclipse.draw2d.AbstractLayoutcalculatePreferredSize, getBorderPreferredSize, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, invalidate, invalidate, isObservingVisibility, setObserveVisibility
- 
Constructor Details- 
XYLayoutpublic XYLayout()
 
- 
- 
Method Details- 
calculatePreferredSizeCalculates and returns the preferred size of the input figure. Since in XYLayout the location of the child should be preserved, the preferred size would be a region which would hold all the children of the input figure. If no constraint is set, that child is ignored for calculation. If width and height are not positive, the preferred dimensions of the child are taken.- Specified by:
- calculatePreferredSizein class- AbstractLayout
- Parameters:
- f- The figure
- wHint- The width hint
- hHint- The height hint
- Returns:
- The preferred size
- Since:
- 2.0
- See Also:
 
- 
getOriginReturns the origin for the given figure.- Parameters:
- parent- the figure whose origin is requested
- Returns:
- the origin
 
- 
layoutImplements the algorithm to layout the components of the given container figure. Each component is laid out using its own layout constraint specifying its size and position.- Parameters:
- parent- The figure
- See Also:
 
- 
setConstraintSets the layout constraint of the given figure. The constraints can only be of typeRectangle.- Specified by:
- setConstraintin interface- LayoutManager
- Overrides:
- setConstraintin class- AbstractConstraintLayout
- Parameters:
- figure- the child
- newConstraint- the child's new constraint
- Since:
- 2.0
- See Also:
 
 
-