Eclipse Draw2d
2.1

org.eclipse.draw2d
Class StackLayout

java.lang.Object
  |
  +--org.eclipse.draw2d.AbstractLayout
        |
        +--org.eclipse.draw2d.AbstractHintLayout
              |
              +--org.eclipse.draw2d.StackLayout
All Implemented Interfaces:
LayoutManager

public class StackLayout
extends AbstractHintLayout

Figures using the StackLayout as their layout manager have their children placed on top of one another. Order of placement is determined by the order in which the children were added, first child added placed on the bottom.


Field Summary
 
Fields inherited from class org.eclipse.draw2d.AbstractLayout
preferredSize
 
Constructor Summary
StackLayout()
           
 
Method Summary
protected  Dimension calculateMinimumSize(IFigure figure, int wHint, int hHint)
          Calculates the minimum size using the given width and height hints.
protected  Dimension calculatePreferredSize(IFigure figure, int wHint, int hHint)
          Calculates and returns the preferred size of the given figure.
 void layout(IFigure figure)
          Lays out the given figure.
 
Methods inherited from class org.eclipse.draw2d.AbstractHintLayout
getMinimumSize, getPreferredSize, invalidate, isSensitiveHorizontally, isSensitiveVertically
 
Methods inherited from class org.eclipse.draw2d.AbstractLayout
calculatePreferredSize, getBorderPreferredSize, getConstraint, getMinimumSize, getPreferredSize, invalidate, remove, setConstraint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackLayout

public StackLayout()
Method Detail

calculateMinimumSize

protected Dimension calculateMinimumSize(IFigure figure,
                                         int wHint,
                                         int hHint)
Description copied from class: AbstractHintLayout
Calculates the minimum size using the given width and height hints. This method is called from AbstractHintLayout.getMinimumSize(IFigure, int, int) whenever the cached minimum size has been flushed.

By default, this method just calls AbstractHintLayout.getPreferredSize(IFigure, int, int), meaning minimum and preferres sizes will be the same unless this method is overridden.

Overrides:
calculateMinimumSize in class AbstractHintLayout
Parameters:
figure - the Figure on which this layout is installed * @param wHint the width hint * @param hHint the height hint * @return the layout's minimum size

calculatePreferredSize

protected Dimension calculatePreferredSize(IFigure figure,
                                           int wHint,
                                           int hHint)
Calculates and returns the preferred size of the given figure. This is the union of the preferred sizes of the widest and the tallest of all its children.

Specified by:
calculatePreferredSize in class AbstractLayout
Parameters:
figure - The IFigure whose preferred size has to be calculated
wHint - The width hint (<=0 means it is to be ignored)
hHint - The height hint (<=0 means it is to be ignored)
Returns:
The preferred size of the input figure.
Since:
2.0
See Also:
AbstractHintLayout.getPreferredSize(IFigure, int, int)

layout

public void layout(IFigure figure)
Description copied from interface: LayoutManager
Lays out the given figure.

Parameters:
figure - The figure
See Also:
LayoutManager.layout(IFigure)

Eclipse Draw2d
2.1

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