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.
-
fArrangement
-
-
fComponents
-
-
AbstractFlowLayout()
-
-
accommodateComponents(CompositeFigure)
-
-
addLayoutComponent(Figure)
- Adds a component to the layout.
-
arrange(CompositeFigure)
- Fill the arrangement vector with Aligner objects
for the subfigures according to the layout strategy and current display box.
-
attachAligners()
-
-
emptySize()
-
-
findPos(Figure)
- Find the position of figure among the subfigures according to the current
layout strategy.
-
getArrengement(CompositeFigure)
- Gets the current arrengement of subfigures.
-
getBottomElementAligner(CompositeFigure, Figure, Figure)
-
Gets the aligner for the bottom element of the list.
-
getComponents()
- Returns the components currently stored by this layout.
-
getEmptySize()
-
-
getMiddleElementAligner(CompositeFigure, Figure, Figure)
-
Gets the aligner for a middle element of the list.
-
getStationaryFigures()
- Return the holdees that are stationary, that is, not in transit.
-
getTopElementAligner(CompositeFigure, Figure)
-
Gets the aligner for the top element of the list.
-
invalidateLayout()
- Force rearrangement.
-
invalidateLayout(Figure)
- Force rearrangement.
-
layoutContainer(CompositeFigure)
- The bag layout algorithm.
-
layoutSovereigns(CompositeFigure)
- Lays out the Sovereign figures that are contained in the container.
-
minimumLayoutSize(CompositeFigure)
- Calculates the minimum size dimensions for the specified container.
-
preferredLayoutSize(CompositeFigure)
- Calculates the preferred size dimensions for the specified container.
-
removeLayoutComponent(Figure)
- Does nothing.
-
replaceLayoutComponent(Figure, Figure)
- Does nothing.
-
setEmptySize(Dimension)
-
fArrangement
protected transient Vector fArrangement
fComponents
protected Vector fComponents
AbstractFlowLayout
public AbstractFlowLayout()
invalidateLayout
public void invalidateLayout()
- Force rearrangement.
- Overrides:
- invalidateLayout in class BagLayout
getEmptySize
public Dimension getEmptySize()
setEmptySize
public void setEmptySize(Dimension dim)
invalidateLayout
public void invalidateLayout(Figure component)
- Force rearrangement.
- Overrides:
- invalidateLayout in class BagLayout
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
removeLayoutComponent
public void removeLayoutComponent(Figure component)
- Does nothing. Bag layout does not need to store the components.
- Overrides:
- removeLayoutComponent in class BagLayout
replaceLayoutComponent
public void replaceLayoutComponent(Figure component,
Figure replacement)
- Does nothing. Bag layout does not need to store the components.
- Overrides:
- replaceLayoutComponent in class BagLayout
getComponents
public Vector getComponents()
- Returns the components currently stored by this layout. The order of
components may be significant to the layout.
emptySize
protected Dimension emptySize()
getArrengement
protected Vector getArrengement(CompositeFigure container)
- Gets the current arrengement of subfigures. Computes the arrengement
if necessary.
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.
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.
attachAligners
protected void attachAligners()
getTopElementAligner
protected abstract Aligner getTopElementAligner(CompositeFigure container,
Figure component)
- Gets the aligner for the top element of the list.
getMiddleElementAligner
protected abstract Aligner getMiddleElementAligner(CompositeFigure container,
Figure component,
Figure previous)
- Gets the aligner for a middle element of the list.
getBottomElementAligner
protected abstract Aligner getBottomElementAligner(CompositeFigure container,
Figure component,
Figure previous)
- Gets the aligner for the bottom element of the list.
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.
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??
preferredLayoutSize
public Dimension preferredLayoutSize(CompositeFigure container)
- Calculates the preferred size dimensions for the specified container.
- Overrides:
- preferredLayoutSize in class BagLayout
accommodateComponents
protected void accommodateComponents(CompositeFigure container)
layoutContainer
public void layoutContainer(CompositeFigure container)
- The bag layout algorithm.
- Overrides:
- layoutContainer in class BagLayout
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