Draw2D v2.0

org.eclipse.draw2d
Class AbstractLayout

java.lang.Object
  |
  +--org.eclipse.draw2d.AbstractLayout
All Implemented Interfaces:
LayoutManager
Direct Known Subclasses:
DelegatingLayout, FlowLayout, ScrollPaneLayout, StackLayout, ToolbarLayout, ViewportLayout, XYLayout

public abstract class AbstractLayout
extends Object
implements LayoutManager

Provides generic support for LayoutManagers.


Constructor Summary
AbstractLayout()
           
 
Method Summary
protected abstract  Dimension calculatePreferredSize(IFigure container)
          Calculates the preferred size of the given figure.
protected  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.
 Object getConstraint(IFigure child)
          Returns the constraint for the given figure.
 Dimension getMinimumSize(IFigure container)
          Returns the minimum size of the given figure.
 Dimension getPreferredSize(IFigure container)
          Returns the preferred size of the given figure.
 Dimension getPreferredSize(IFigure container, int wHint, int hHint)
          Returns the preferred size of the given figure, using width and height hints.
 void invalidate()
          Removes all cached information for all figures this LayoutManager is responsible for.
 void invalidate(IFigure figure)
          Removes any cached information about the given figure.
 void remove(IFigure child)
          Removes the given figure from this LayoutManager's list of figures.
 void setConstraint(IFigure figure, Object constraint)
          Sets the constraint for the given figure.
 
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
 

Constructor Detail

AbstractLayout

public AbstractLayout()
Method Detail

calculatePreferredSize

protected abstract Dimension calculatePreferredSize(IFigure container)
Calculates the preferred size of the given figure.

calculatePreferredSize

protected Dimension calculatePreferredSize(IFigure container,
                                           int wHint,
                                           int hHint)
Calculates the preferred size of the given figure, using width and height hints.

getBorderPreferredSize

protected Dimension getBorderPreferredSize(IFigure container)
Returns the preferred size of the figure's border.

getConstraint

public Object getConstraint(IFigure child)
Returns the constraint for the given figure.
Specified by:
getConstraint in interface LayoutManager

getMinimumSize

public Dimension getMinimumSize(IFigure container)
Returns the minimum size of the given figure.
Specified by:
getMinimumSize in interface LayoutManager

getPreferredSize

public Dimension getPreferredSize(IFigure container,
                                  int wHint,
                                  int hHint)
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 interface LayoutManager

getPreferredSize

public Dimension getPreferredSize(IFigure container)
Returns the preferred size of the given figure.
Specified by:
getPreferredSize in interface LayoutManager

invalidate

public void invalidate()
Removes all cached information for all figures this LayoutManager is responsible for.
Specified by:
invalidate in interface LayoutManager

invalidate

public void invalidate(IFigure figure)
Removes any cached information about the given figure.
Specified by:
invalidate in interface LayoutManager

remove

public void remove(IFigure child)
Removes the given figure from this LayoutManager's list of figures.
Specified by:
remove in interface LayoutManager

setConstraint

public void setConstraint(IFigure figure,
                          Object constraint)
Sets the constraint for the given figure.
Specified by:
setConstraint in interface LayoutManager

Draw2D v2.0