|
JHotDraw 7.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CompositeFigure
A CompositeFigure is composed of several child Figures. A CompositeFigure can be laid out using a Layouter.
Field Summary | |
---|---|
static AttributeKey<Insets2D.Double> |
LAYOUT_INSETS
The value of this attribute is a Insets2D.Double object. |
Method Summary | |
---|---|
boolean |
add(Figure child)
Adds a child to the figure. |
void |
add(int index,
Figure child)
Adds a child to the figure at the specified index. |
void |
addCompositeFigureListener(CompositeFigureListener listener)
Adds a listener for this composite figure. |
void |
basicAdd(Figure child)
Adds a child to the figure without firing events. |
void |
basicAdd(int index,
Figure child)
Adds a child to the figure at the specified index without firing events. |
int |
basicRemove(Figure child)
Removes the specified child without firing events. |
void |
basicRemoveAllChildren()
Removes all children from the composite figure without firing events. |
Figure |
basicRemoveChild(int index)
Removes the child at the specified index without firing events. |
boolean |
contains(Figure f)
Returns true if this composite figure contains the specified figure. |
Figure |
getChild(int index)
Returns the child figure at the specified index. |
int |
getChildCount()
Returns the number of children. |
java.util.List<Figure> |
getChildren()
Returns an unchangeable list view on the children. |
Layouter |
getLayouter()
Get a Layouter object which encapsulated a layout algorithm for this figure. |
int |
indexOf(Figure child)
Returns the index of the specified child. |
void |
layout()
A layout algorithm is used to define how the child components should be laid out in relation to each other. |
boolean |
remove(Figure child)
Removes the specified child. |
void |
removeAllChildren()
Removes all children from the composite figure. |
Figure |
removeChild(int index)
Removes the child at the specified index. |
void |
removeCompositeFigureListener(CompositeFigureListener listener)
Removes a listener from this composite figure. |
void |
setLayouter(Layouter newValue)
Set a Layouter object which encapsulated a layout algorithm for this figure. |
Methods inherited from interface org.jhotdraw.draw.Figure |
---|
addFigureListener, addNotify, canConnect, changed, clone, contains, createHandles, draw, findCompatibleConnector, findConnector, findFigureInside, getActions, getAttribute, getAttributes, getAttributesRestoreData, getBounds, getConnectors, getCursor, getDecomposition, getDrawingArea, getEndPoint, getLayer, getPreferredSize, getStartPoint, getTool, getToolTipText, getTransformRestoreData, handleDrop, handleMouseClick, includes, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removeNotify, requestRemove, restoreAttributesTo, restoreTransformTo, setAttribute, setBounds, transform, willChange |
Methods inherited from interface org.jhotdraw.xml.DOMStorable |
---|
read, write |
Field Detail |
---|
static final AttributeKey<Insets2D.Double> LAYOUT_INSETS
Method Detail |
---|
boolean add(Figure child)
This is a convenience method for add(getChildCount(), child);
This method calls figureAdded
on all registered
CompositeFigureListener
s.
true
if this CompositeFigure changed as a result of the
callvoid add(int index, Figure child)
This method calls figureAdded
on all registered
CompositeFigureListener
s.
void basicAdd(Figure child)
This method can be used to reinsert a child figure which has been
temporarily removed from this CompositeFigure (for example to reorder
the sequence of the children) and to efficiently build a drawing from
an InputFormat
.
This is a convenience method for calling
basicAdd(getChildCount(), child);
.
void basicAdd(int index, Figure child)
This method can be used to reinsert a child figure which has been
temporarily removed from this CompositeFigure (for example to reorder
the sequence of the children) and to efficiently build a drawing from
an InputFormat
.
boolean remove(Figure child)
This is a convenience method for calling
removeChild(getChildren().indexOf(child));
This method calls figureRemoved
on all registered
CompositeFigureListener
's.
Figure removeChild(int index)
Calls figureRemoved
on all registered
CompositeFigureListener
's.
void removeAllChildren()
This is a convenience method for
while(getChildCount() > 0) removeChild(0);
int basicRemove(Figure child)
This method can be used to temporarily remove a child from this CompositeFigure (for example to reorder the sequence of the children).
This is a convenience method for calling
basicRemove(indexOf(child));
.
Returns the index of the removed figure. Returns -1 if the figure was not a child of this CompositeFigure.
Figure basicRemoveChild(int index)
This method can be used to temporarily remove a child from this CompositeFigure (for example to reorder the sequence of the children).
Returns the removed child figure.
void basicRemoveAllChildren()
This method can be used to temporarily remove a child from this CompositeFigure (for example to reorder the sequence of the children).
This is a convenience method for
while(getChildCount() > 0) basicRemoveChild(0);
java.util.List<Figure> getChildren()
int getChildCount()
This is a convenience method for calling
getChildren().size();
.
Figure getChild(int index)
This is a convenience method for calling
getChildren().get(index);
.
int indexOf(Figure child)
This is a convenience method for calling
getChildren().indexOf(index);
.
boolean contains(Figure f)
This is a convenience method for calling
getChildren().contains(f);
.
Layouter getLayouter()
void layout()
void setLayouter(Layouter newValue)
newValue
- encapsulation of a layout algorithm.void addCompositeFigureListener(CompositeFigureListener listener)
void removeCompositeFigureListener(CompositeFigureListener listener)
|
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |