de.erichseifert.gral
Class StackedLayout

java.lang.Object
  extended by de.erichseifert.gral.StackedLayout
All Implemented Interfaces:
Layout

public class StackedLayout
extends Object
implements Layout

Class that represents a layout manager which arranges its components lying upon another.


Constructor Summary
StackedLayout(DrawableConstants.Orientation orientation)
          Creates a new StackedLayout object with the specified orientation and default gap between the components.
StackedLayout(DrawableConstants.Orientation orientation, Dimension2D gap)
          Creates a new StackedLayout object with the specified orientation gap between the components.
 
Method Summary
 Dimension2D getGap()
          Returns the minimal space between components.
 DrawableConstants.Orientation getOrientation()
          Returns whether the components will be laid out horizontally or vertically.
 Dimension2D getPreferredSize(Container container)
          Returns the preferred size of the specified Container using this Layout.
 void layout(Container container)
          Arranges the components of this Container according to this Layout.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackedLayout

public StackedLayout(DrawableConstants.Orientation orientation)
Creates a new StackedLayout object with the specified orientation and default gap between the components.

Parameters:
orientation - Orientation in which components are stacked.

StackedLayout

public StackedLayout(DrawableConstants.Orientation orientation,
                     Dimension2D gap)
Creates a new StackedLayout object with the specified orientation gap between the components.

Parameters:
orientation - Orientation in which components are stacked.
gap - Gap between the components.
Method Detail

getPreferredSize

public Dimension2D getPreferredSize(Container container)
Description copied from interface: Layout
Returns the preferred size of the specified Container using this Layout.

Specified by:
getPreferredSize in interface Layout
Parameters:
container - Container whose preferred size is to be returned.
Returns:
Preferred extent of the specified Container.

layout

public void layout(Container container)
Description copied from interface: Layout
Arranges the components of this Container according to this Layout.

Specified by:
layout in interface Layout
Parameters:
container - Container to be laid out.

getOrientation

public DrawableConstants.Orientation getOrientation()
Returns whether the components will be laid out horizontally or vertically.

Returns:
Orientation constant

getGap

public Dimension2D getGap()
Returns the minimal space between components. No space will be allocated if there are no components.

Returns:
Horizontal and vertical gaps


Copyright © 2009-2010. All Rights Reserved.