JHotDraw 6.0b1

org.jhotdraw.contrib
Class SimpleLayouter

java.lang.Object
  extended by org.jhotdraw.contrib.SimpleLayouter
All Implemented Interfaces:
java.io.Serializable, Layouter, Storable
Direct Known Subclasses:
StandardLayouter

public class SimpleLayouter
extends java.lang.Object
implements Layouter

See Also:
Serialized Form

Constructor Summary
SimpleLayouter(Layoutable newLayoutable)
           
 
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
 Layoutable getLayoutable()
          Get the figure upon which the layout strategy operates.
 java.awt.Rectangle layout(java.awt.Point origin, java.awt.Point corner)
          Method which lays out a figure.
 void read(StorableInput dr)
          Reads the contained figures from StorableInput.
 void setInsets(java.awt.Insets newInsets)
          Set the insets for spacing between the figure and its subfigures
 void setLayoutable(Layoutable newLayoutable)
          Set the figure upon which the layout strategy operates.
 void write(StorableOutput dw)
          Writes the contained figures to the StorableOutput.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleLayouter

public SimpleLayouter(Layoutable newLayoutable)
Method Detail

getLayoutable

public Layoutable getLayoutable()
Get the figure upon which the layout strategy operates.

Returns:
associated figure which should be laid out

setLayoutable

public void setLayoutable(Layoutable newLayoutable)
Set the figure upon which the layout strategy operates.

Parameters:
newLayoutable - Layoutable to be laid out

setInsets

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

Specified by:
setInsets in interface Layouter
Parameters:
newInsets - new spacing dimensions

getInsets

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

Specified by:
getInsets in interface Layouter
Returns:
spacing dimensions

create

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

Specified by:
create in interface Layouter

calculateLayout

public java.awt.Rectangle calculateLayout(java.awt.Point origin,
                                          java.awt.Point corner)
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
Parameters:
origin - start point for the layout
corner - minimum corner point for the layout
Returns:
size including space for insets

layout

public java.awt.Rectangle layout(java.awt.Point origin,
                                 java.awt.Point corner)
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
Parameters:
origin - start point for the layout
corner - minimum corner point for the layout

read

public void read(StorableInput dr)
          throws java.io.IOException
Reads the contained figures from StorableInput.

Specified by:
read in interface Storable
Throws:
java.io.IOException

write

public void write(StorableOutput dw)
Writes the contained figures to the StorableOutput.

Specified by:
write in interface Storable

JHotDraw 6.0b1