JHotDraw 6.0b1

org.jhotdraw.contrib
Interface Layouter

All Superinterfaces:
java.io.Serializable, Storable
All Known Implementing Classes:
HTMLLayouter, SimpleLayouter, StandardLayouter

public interface Layouter
extends java.io.Serializable, Storable

A Layouter encapsulates a algorithm to layout a figure. It is passed on to a figure which delegates the layout task to the Layouter's layout method. The Layouter might need access to some information specific to a certain figure in order to layout it out properly. Note: Currently, only the GraphicalCompositeFigure uses such a Layouter to layout its child components.

See Also:
GraphicalCompositeFigure

Method Summary
 java.awt.Rectangle calculateLayout(java.awt.Point origin, java.awt.Point corner)
          Calculate the layout for the figure and all its subelements.
 Layouter create(Layoutable newLayoutable)
          Create a new instance of this type and sets the layoutable
 java.awt.Insets getInsets()
          Get the insets for spacing between the figure and its subfigures
 java.awt.Rectangle layout(java.awt.Point origin, java.awt.Point corner)
          Method which lays out a figure.
 void setInsets(java.awt.Insets newInsets)
          Set the insets for spacing between the figure and its subfigures
 
Methods inherited from interface org.jhotdraw.util.Storable
read, write
 

Method Detail

calculateLayout

java.awt.Rectangle calculateLayout(java.awt.Point origin,
                                   java.awt.Point corner)
Calculate the layout for the figure and all its subelements. The layout is not actually performed but just its dimensions are calculated.

Parameters:
origin - start point for the layout
corner - minimum corner point for the layout
Returns:
size including space for insets

layout

java.awt.Rectangle layout(java.awt.Point origin,
                          java.awt.Point corner)
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.

Parameters:
origin - start point for the layout
corner - minimum corner point for the layout

setInsets

void setInsets(java.awt.Insets newInsets)
Set the insets for spacing between the figure and its subfigures

Parameters:
newInsets - new spacing dimensions

getInsets

java.awt.Insets getInsets()
Get the insets for spacing between the figure and its subfigures

Returns:
spacing dimensions

create

Layouter create(Layoutable newLayoutable)
Create a new instance of this type and sets the layoutable


JHotDraw 6.0b1