All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.ifa.draw.contrib.xcomp.AbstractFlowLayout

CH.ifa.draw.contrib.xcomp.BagLayout
   |
   +----CH.ifa.draw.contrib.xcomp.AbstractFlowLayout

public abstract class AbstractFlowLayout
extends BagLayout
The base class for implementing list-like layout strategies. AbstractFlowLayout maintains an ordered vector of components that belong to the layout. The ordering is independent of the order of the display list maintained by the container (CompositeFigure) that determines the drawing order of components.


Variable Index

 o fArrangement
 o fComponents

Constructor Index

 o AbstractFlowLayout()

Method Index

 o accommodateComponents(CompositeFigure)
 o addLayoutComponent(Figure)
Adds a component to the layout.
 o arrange(CompositeFigure)
Fill the arrangement vector with Aligner objects for the subfigures according to the layout strategy and current display box.
 o attachAligners()
 o emptySize()
 o findPos(Figure)
Find the position of figure among the subfigures according to the current layout strategy.
 o getArrengement(CompositeFigure)
Gets the current arrengement of subfigures.
 o getBottomElementAligner(CompositeFigure, Figure, Figure)
Gets the aligner for the bottom element of the list.
 o getComponents()
Returns the components currently stored by this layout.
 o getEmptySize()
 o getMiddleElementAligner(CompositeFigure, Figure, Figure)
Gets the aligner for a middle element of the list.
 o getStationaryFigures()
Return the holdees that are stationary, that is, not in transit.
 o getTopElementAligner(CompositeFigure, Figure)
Gets the aligner for the top element of the list.
 o invalidateLayout()
Force rearrangement.
 o invalidateLayout(Figure)
Force rearrangement.
 o layoutContainer(CompositeFigure)
The bag layout algorithm.
 o layoutSovereigns(CompositeFigure)
Lays out the Sovereign figures that are contained in the container.
 o minimumLayoutSize(CompositeFigure)
Calculates the minimum size dimensions for the specified container.
 o preferredLayoutSize(CompositeFigure)
Calculates the preferred size dimensions for the specified container.
 o removeLayoutComponent(Figure)
Does nothing.
 o replaceLayoutComponent(Figure, Figure)
Does nothing.
 o setEmptySize(Dimension)

Variables

 o fArrangement
 protected transient Vector fArrangement
 o fComponents
 protected Vector fComponents

Constructors

 o AbstractFlowLayout
 public AbstractFlowLayout()

Methods

 o invalidateLayout
 public void invalidateLayout()
Force rearrangement.

Overrides:
invalidateLayout in class BagLayout
 o getEmptySize
 public Dimension getEmptySize()
 o setEmptySize
 public void setEmptySize(Dimension dim)
 o invalidateLayout
 public void invalidateLayout(Figure component)
Force rearrangement.

Overrides:
invalidateLayout in class BagLayout
 o addLayoutComponent
 public void addLayoutComponent(Figure component)
Adds a component to the layout. Uses findPos to find the correct place for the component. Moves the component so that its origin is wihtin its container's display box, if necessary.

Overrides:
addLayoutComponent in class BagLayout
 o removeLayoutComponent
 public void removeLayoutComponent(Figure component)
Does nothing. Bag layout does not need to store the components.

Overrides:
removeLayoutComponent in class BagLayout
 o replaceLayoutComponent
 public void replaceLayoutComponent(Figure component,
                                    Figure replacement)
Does nothing. Bag layout does not need to store the components.

Overrides:
replaceLayoutComponent in class BagLayout
 o getComponents
 public Vector getComponents()
Returns the components currently stored by this layout. The order of components may be significant to the layout.

 o emptySize
 protected Dimension emptySize()
 o getArrengement
 protected Vector getArrengement(CompositeFigure container)
Gets the current arrengement of subfigures. Computes the arrengement if necessary.

 o getStationaryFigures
 protected Vector getStationaryFigures()
Return the holdees that are stationary, that is, not in transit. Includes also figures that are selected to be dragged but not dragged yet.

 o layoutSovereigns
 protected void layoutSovereigns(CompositeFigure container)
Lays out the Sovereign figures that are contained in the container. Sovereigns are placed independently of the container but they need the parent to initiate the lay out process.

 o attachAligners
 protected void attachAligners()
 o getTopElementAligner
 protected abstract Aligner getTopElementAligner(CompositeFigure container,
                                                 Figure component)
Gets the aligner for the top element of the list.

 o getMiddleElementAligner
 protected abstract Aligner getMiddleElementAligner(CompositeFigure container,
                                                    Figure component,
                                                    Figure previous)
Gets the aligner for a middle element of the list.

 o getBottomElementAligner
 protected abstract Aligner getBottomElementAligner(CompositeFigure container,
                                                    Figure component,
                                                    Figure previous)
Gets the aligner for the bottom element of the list.

 o arrange
 protected void arrange(CompositeFigure container)
Fill the arrangement vector with Aligner objects for the subfigures according to the layout strategy and current display box. The default layout strategy is to leave the subfigures where they are relative to the origin of the displaybox. Override in subclasses.

 o findPos
 protected int findPos(Figure figure)
Find the position of figure among the subfigures according to the current layout strategy. Return an index to the vector of subfigures. The default is to return the last+1 position. => make subfigure layout a REAL strategy??

 o preferredLayoutSize
 public Dimension preferredLayoutSize(CompositeFigure container)
Calculates the preferred size dimensions for the specified container.

Overrides:
preferredLayoutSize in class BagLayout
 o accommodateComponents
 protected void accommodateComponents(CompositeFigure container)
 o layoutContainer
 public void layoutContainer(CompositeFigure container)
The bag layout algorithm.

Overrides:
layoutContainer in class BagLayout
 o minimumLayoutSize
 public Dimension minimumLayoutSize(CompositeFigure container)
Calculates the minimum size dimensions for the specified container.

Overrides:
minimumLayoutSize in class BagLayout

All Packages  Class Hierarchy  This Package  Previous  Next  Index