public class XYLayout extends AbstractLayout
LayoutManager
interface
using the XY Layout algorithm. This lays out the components using the layout
constraints as defined by each component.Modifier and Type | Field and Description |
---|---|
protected java.util.Map |
constraints
The layout contraints
|
isObservingVisibility, preferredSize
Constructor and Description |
---|
XYLayout() |
Modifier and Type | Method and Description |
---|---|
protected Dimension |
calculatePreferredSize(IFigure f,
int wHint,
int hHint)
Calculates and returns the preferred size of the input figure.
|
java.lang.Object |
getConstraint(IFigure figure)
Returns the constraint for the given figure.
|
Point |
getOrigin(IFigure parent)
Returns the origin for the given figure.
|
void |
layout(IFigure parent)
Implements the algorithm to layout the components of the given container
figure.
|
void |
remove(IFigure figure)
Removes the given figure from this LayoutManager's list of figures.
|
void |
setConstraint(IFigure figure,
java.lang.Object newConstraint)
Sets the layout constraint of the given figure.
|
calculatePreferredSize, getBorderPreferredSize, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, invalidate, invalidate, isObservingVisibility, setObserveVisibility
protected Dimension calculatePreferredSize(IFigure f, int wHint, int hHint)
calculatePreferredSize
in class AbstractLayout
f
- The figurewHint
- The width hinthHint
- The height hintAbstractLayout.calculatePreferredSize(IFigure, int, int)
public java.lang.Object getConstraint(IFigure figure)
AbstractLayout
getConstraint
in interface LayoutManager
getConstraint
in class AbstractLayout
figure
- The figureLayoutManager.getConstraint(IFigure)
public Point getOrigin(IFigure parent)
parent
- the figure whose origin is requestedpublic void layout(IFigure parent)
parent
- The figureLayoutManager.layout(IFigure)
public void remove(IFigure figure)
AbstractLayout
remove
in interface LayoutManager
remove
in class AbstractLayout
figure
- The figure to removeLayoutManager.remove(IFigure)
public void setConstraint(IFigure figure, java.lang.Object newConstraint)
Rectangle
.setConstraint
in interface LayoutManager
setConstraint
in class AbstractLayout
figure
- the childnewConstraint
- the child's new constraintLayoutManager.setConstraint(IFigure, Object)
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.