org.jhotdraw.draw
Class LocatorLayouter

java.lang.Object
  extended by org.jhotdraw.draw.LocatorLayouter
All Implemented Interfaces:
Layouter

public class LocatorLayouter
extends java.lang.Object
implements Layouter

A layouter which lays out all children of a CompositeFigure according to their LayoutLocator property..

Version:
$Id: LocatorLayouter.java 564 2009-10-10 10:21:01Z rawcoder $
Author:
Werner Randelshofer

Field Summary
static AttributeKey<Locator> LAYOUT_LOCATOR
          LayoutLocator property used by the children to specify their location relative to the compositeFigure.
 
Constructor Summary
LocatorLayouter()
          Creates a new instance.
 
Method Summary
 java.awt.geom.Rectangle2D.Double calculateLayout(CompositeFigure compositeFigure, java.awt.geom.Point2D.Double anchor, java.awt.geom.Point2D.Double lead)
          Calculate the layout for the figure and all its subelements.
private  Locator getLocator(Figure f)
           
 java.awt.geom.Rectangle2D.Double layout(CompositeFigure compositeFigure, java.awt.geom.Point2D.Double anchor, java.awt.geom.Point2D.Double lead)
          Method which lays out a figure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAYOUT_LOCATOR

public static final AttributeKey<Locator> LAYOUT_LOCATOR
LayoutLocator property used by the children to specify their location relative to the compositeFigure.

Constructor Detail

LocatorLayouter

public LocatorLayouter()
Creates a new instance.

Method Detail

calculateLayout

public java.awt.geom.Rectangle2D.Double calculateLayout(CompositeFigure compositeFigure,
                                                        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.

Specified by:
calculateLayout in interface Layouter
anchor - start point for the layout
lead - minimum lead point for the layout

layout

public java.awt.geom.Rectangle2D.Double layout(CompositeFigure compositeFigure,
                                               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.

Specified by:
layout in interface Layouter
anchor - start point for the layout
lead - minimum lead point for the layout

getLocator

private Locator getLocator(Figure f)