JHotDraw 7.4.1

org.jhotdraw.draw.layouter
Class VerticalLayouter

java.lang.Object
  extended by org.jhotdraw.draw.layouter.AbstractLayouter
      extended by org.jhotdraw.draw.layouter.VerticalLayouter
All Implemented Interfaces:
Layouter

public class VerticalLayouter
extends AbstractLayouter

A Layouter which lays out all children of a CompositeFigure in vertical direction.

The preferred size of the figures is used to determine the layout. This may cause some figures to resize.

The VerticalLayouter honors the LAYOUT_INSETS and the COMPOSITE_ALIGNMENT AttributeKey when laying out a CompositeFigure.

If COMPOSITE_ALIGNMENT is not set on the composite figure, the layout assigns the same width to all figures.

Version:
$Id: VerticalLayouter.java 604 2010-01-09 12:00:29Z rawcoder $
Author:
Werner Randelshofer

Constructor Summary
VerticalLayouter()
           
 
Method Summary
 java.awt.geom.Rectangle2D.Double calculateLayout(CompositeFigure layoutable, java.awt.geom.Point2D.Double anchor, java.awt.geom.Point2D.Double lead)
          Calculate the layout for the figure and all its subelements.
 java.awt.geom.Rectangle2D.Double layout(CompositeFigure layoutable, java.awt.geom.Point2D.Double anchor, java.awt.geom.Point2D.Double lead)
          Method which lays out a figure.
 
Methods inherited from class org.jhotdraw.draw.layouter.AbstractLayouter
getInsets
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VerticalLayouter

public VerticalLayouter()
Method Detail

calculateLayout

public java.awt.geom.Rectangle2D.Double calculateLayout(CompositeFigure layoutable,
                                                        java.awt.geom.Point2D.Double anchor,
                                                        java.awt.geom.Point2D.Double lead)
Description copied from interface: Layouter
Calculate the layout for the figure and all its subelements. The layout is not actually performed but just its dimensions are calculated.

anchor - start point for the layout
lead - minimum lead point for the layout

layout

public java.awt.geom.Rectangle2D.Double layout(CompositeFigure layoutable,
                                               java.awt.geom.Point2D.Double anchor,
                                               java.awt.geom.Point2D.Double lead)
Description copied from interface: Layouter
Method which lays out a figure. It is called by the figure if a layout task is to be performed. Implementing classes specify a certain layout algorithm in this method.

anchor - start point for the layout
lead - minimum lead point for the layout

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.