CH.ifa.draw.contrib
Class StandardLayouter
- java.lang.Object
-
- CH.ifa.draw.contrib.StandardLayouter
-
public class StandardLayouter extends java.lang.Object implements Layouter
A StandardLayouter contains standard algorithm for layouting a Layoutable. As a standard behaviour all child components of a Layoutable are laid out underneath each other starting from top to bottom while the x position of all child components stays the same and the width is forced to the width of the maximum width. At the end the presentation figure of the Layoutable is set to the maximum x and y size to encompass all contained child components graphically as well.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description StandardLayouter()Default constructor which is needed for the Storable mechanism.StandardLayouter(Layoutable newLayoutable)Constructor which associates a StandardLayouter with a certain Layoutable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.RectanglecalculateLayout(java.awt.Point origin, java.awt.Point corner)java.awt.InsetsgetInsets()Get the insets for spacing between the figure and its subfiguresLayoutablegetLayoutable()Get the figure upon which the layout strategy operates.java.awt.Rectanglelayout(java.awt.Point origin, java.awt.Point corner)Method which lays out a figure.voidread(StorableInput dr)Reads the contained figures from StorableInput.voidsetInsets(java.awt.Insets newInsets)Set the insets for spacing between the figure and its subfiguresvoidsetLayoutable(Layoutable newLayoutable)Set the figure upon which the layout strategy operates.voidwrite(StorableOutput dw)Writes the contained figures to the StorableOutput.
-
-
-
Constructor Detail
-
StandardLayouter
public StandardLayouter()
Default constructor which is needed for the Storable mechanism. Usually, the constructor which takes a Layoutable should be used as each StandardLayouter is associated with exactly one Layoutable.
-
StandardLayouter
public StandardLayouter(Layoutable newLayoutable)
Constructor which associates a StandardLayouter with a certain Layoutable.- Parameters:
newLayoutable- Layoutable to be laid out
-
-
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
-
calculateLayout
public java.awt.Rectangle calculateLayout(java.awt.Point origin, java.awt.Point corner)- Specified by:
calculateLayoutin interfaceLayouter
-
layout
public 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. First, the layout dimension for the figure is calculated and then the figure is arranged newly. All child component are place beneath another. The figure and all its children are forced to the minimium width
-
read
public void read(StorableInput dr) throws java.io.IOException
Reads the contained figures from StorableInput.
-
write
public void write(StorableOutput dw)
Writes the contained figures to the StorableOutput.
-
setInsets
public void setInsets(java.awt.Insets newInsets)
Set the insets for spacing between the figure and its subfigures
-
-
DataMelt 3.0 © DataMelt by jWork.ORG