Eclipse Draw2d
2.1

org.eclipse.draw2d
Class AbstractLayout

java.lang.Object
  |
  +--org.eclipse.draw2d.AbstractLayout
All Implemented Interfaces:
LayoutManager
Direct Known Subclasses:
AbstractHintLayout, DelegatingLayout, FlowFigureLayout, ScrollBarLayout, XYLayout

public abstract class AbstractLayout
extends Object
implements LayoutManager

Provides generic support for LayoutManagers.


Field Summary
protected  Dimension preferredSize
          The cached preferred size.
 
Constructor Summary
AbstractLayout()
           
 
Method Summary
protected  void calculatePreferredSize(IFigure container)
          This method is now calculatePreferredSize(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.
 Object getConstraint(IFigure child)
          Returns the constraint for the given figure.
 void getMinimumSize(IFigure container)
          This method is now getMinimumSize(IFigure, int, int).
 Dimension getMinimumSize(IFigure container, int wHint, int hHint)
          Returns the minimum size of the given figure.
 void getPreferredSize(IFigure container)
          This method is now getPreferredSize(IFigure, int, int).
 Dimension getPreferredSize(IFigure container, int wHint, int hHint)
          Returns the preferred size of the given figure, using width and height hints.
 void invalidate()
          Tells the LayoutManager to throw away all cached information about the figures it is resposible for.
protected  void invalidate(IFigure child)
          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 child, 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
 

Field Detail

preferredSize

protected Dimension preferredSize
The cached preferred size.

Constructor Detail

AbstractLayout

public AbstractLayout()
Method Detail

calculatePreferredSize

protected final void calculatePreferredSize(IFigure container)
This method is now calculatePreferredSize(IFigure, int, int).

Parameters:
container - the figure

calculatePreferredSize

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

Parameters:
container - The figure
wHint - The width hint
hHint - The height hint
Returns:
The preferred size

getBorderPreferredSize

protected Dimension getBorderPreferredSize(IFigure container)
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

public Object getConstraint(IFigure child)
Returns the constraint for the given figure.

Specified by:
getConstraint in interface LayoutManager
Parameters:
child - The figure
Returns:
The constraint

getMinimumSize

public final void getMinimumSize(IFigure container)
This method is now getMinimumSize(IFigure, int, int).

Parameters:
container - the figure

getMinimumSize

public Dimension getMinimumSize(IFigure container,
                                int wHint,
                                int hHint)
Description copied from interface: LayoutManager
Returns the minimum size of the given figure.

Specified by:
getMinimumSize in interface LayoutManager
Parameters:
container - The Figure
wHint - the width hint
hHint - the height hint
Returns:
The minimum size
See Also:
LayoutManager.getMinimumSize(IFigure, int, int)

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
Parameters:
container - The figure
wHint - The width hint
hHint - The height hint
Returns:
The preferred size

getPreferredSize

public final void getPreferredSize(IFigure container)
This method is now getPreferredSize(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 resposible for. This method is called whenever the owning figure is invalidated.

Specified by:
invalidate in interface LayoutManager
See Also:
LayoutManager.invalidate()

invalidate

protected void invalidate(IFigure child)
Removes any cached information about the given figure.

Parameters:
child - the child that is invalidated

remove

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

Specified by:
remove in interface LayoutManager
Parameters:
child - The figure to remove

setConstraint

public void setConstraint(IFigure child,
                          Object constraint)
Sets the constraint for the given figure.

Specified by:
setConstraint in interface LayoutManager
Parameters:
child - the child
constraint - the child's new constraint

Eclipse Draw2d
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.