|
JHotDraw 7.0.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jhotdraw.draw.AbstractFigure
org.jhotdraw.draw.AbstractCompositeFigure
public abstract class AbstractCompositeFigure
A Figure that is composed of several children. A AbstractCompositeFigure doesn't define any layout behavior. It is up to subclassers to arrange the contained children.
| Field Summary |
|---|
| Fields inherited from class org.jhotdraw.draw.AbstractFigure |
|---|
changingDepth, decorator, listenerList |
| Fields inherited from interface org.jhotdraw.draw.CompositeFigure |
|---|
LAYOUT_INSETS |
| Constructor Summary | |
|---|---|
AbstractCompositeFigure()
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
add(Figure figure)
Adds a child to the figure. |
void |
add(int index,
Figure figure)
Adds a child to the figure at the specified index. |
void |
addAll(java.util.Collection<Figure> newFigures)
|
void |
addNotify(Drawing drawing)
Informs a figure, that it has been added to the specified drawing. |
void |
basicAdd(Figure figure)
Adds a child to the figure without firing events. |
void |
basicAdd(int index,
Figure figure)
Adds a child to the figure at the specified index without firing events. |
void |
basicAddAll(java.util.Collection<Figure> newFigures)
|
boolean |
basicRemove(Figure figure)
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. |
void |
basicSetAttribute(AttributeKey name,
java.lang.Object value)
Sets an attribute of the figure without firing events. |
void |
basicSetBounds(java.awt.geom.Point2D.Double anchor,
java.awt.geom.Point2D.Double lead)
Sets the logical bounds of the figure and of its decorator figure. |
void |
basicTransform(java.awt.geom.AffineTransform tx)
Transforms the figure. |
void |
changed()
Informs that a figure changed the area of its display box. |
AbstractCompositeFigure |
clone()
Returns a clone of the figure. |
boolean |
contains(java.awt.geom.Point2D.Double p)
Checks if a point is contained by the figure. |
java.util.Collection<Handle> |
createHandles(int detailLevel)
Creates handles used to manipulate the figure. |
protected void |
drawConnectors(java.awt.Graphics2D g)
|
void |
drawFigure(java.awt.Graphics2D g)
|
Figure |
findChild(java.awt.geom.Point2D.Double p)
|
int |
findChildIndex(java.awt.geom.Point2D.Double p)
|
Figure |
findFigureInside(java.awt.geom.Point2D.Double p)
Returns the figure that contains the given point. |
java.lang.Object |
getAttribute(AttributeKey name)
Gets an attribute from the Figure. |
java.util.Map<AttributeKey,java.lang.Object> |
getAttributes()
Returns a view to all attributes of this figure. |
java.awt.geom.Rectangle2D.Double |
getBounds()
Returns the logical bounds of the figure as a Rectangle. |
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. |
java.util.List<Figure> |
getChildrenFrontToBack()
Returns an iterator to iterate in Z-order front to back over the children. |
java.util.Collection<Figure> |
getDecomposition()
Returns a decompositon of a figure into its parts. |
java.awt.geom.Rectangle2D.Double |
getFigureDrawBounds()
|
Layouter |
getLayouter()
Get a Layouter object which encapsulated a layout algorithm for this figure. |
Dimension2DDouble |
getPreferredSize()
The preferred size is used by Layouter to determine the preferred size of a Figure. |
java.lang.Object |
getRestoreData()
Gets data which can be used to restore the shape of the figure after a basicTransform has been applied to it. |
boolean |
hasAttribute(AttributeKey key)
|
void |
invalidate()
Informs that a figure needs to be redrawn. |
protected void |
invalidateBounds()
|
void |
layout()
A layout algorithm is used to define how the child components should be laid out in relation to each other. |
void |
read(DOMInput in)
|
boolean |
remove(Figure figure)
Removes the specified child. |
void |
removeAllChildren()
Removes all children. |
void |
removeAttribute(AttributeKey key)
|
Figure |
removeChild(int index)
Removes the child at the specified index. |
void |
removeNotify(Drawing drawing)
Informs a figure, that it has been removed from the specified drawing. |
void |
restoreTo(java.lang.Object geometry)
Restores the shape of the figure to a previously stored state. |
void |
sendToBack(Figure figure)
Sends a figure to the back of the composite figure. |
void |
sendToFront(Figure figure)
Sends a figure to the front of the drawing. |
void |
setAttribute(AttributeKey name,
java.lang.Object value)
Sets an attribute of the figure. |
void |
setLayouter(Layouter newLayouter)
Set a Layouter object which encapsulated a layout algorithm for this figure. |
void |
undoableEditHappened(javax.swing.event.UndoableEditEvent e)
|
protected void |
validate()
|
void |
willChange()
Informs that a figure is about to change something that affects the contents of its display box. |
void |
write(DOMOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jhotdraw.draw.Figure |
|---|
addFigureListener, addUndoableEditListener, canConnect, draw, findCompatibleConnector, findConnector, getActions, getCursor, getDecorator, getDrawBounds, getEndPoint, getLayer, getStartPoint, getTool, getTooltip, handleDrop, handleMouseClick, includes, isConnectorsVisible, isInteractive, isVisible, remap, removeFigureListener, removeUndoableEditListener, requestRemove, setConnectorsVisible, setDecorator, setVisible |
| Constructor Detail |
|---|
public AbstractCompositeFigure()
| Method Detail |
|---|
public java.util.Collection<Handle> createHandles(int detailLevel)
Figure
createHandles in interface FigurecreateHandles in class AbstractFiguredetailLevel - The detail level of the handles. Usually this is 0 for
bounding box handles and 1 for point handles.
Handlepublic void add(Figure figure)
CompositeFigure
add in interface CompositeFigure
public void add(int index,
Figure figure)
CompositeFigure
add in interface CompositeFigurepublic void addAll(java.util.Collection<Figure> newFigures)
public void basicAdd(Figure figure)
CompositeFigure
basicAdd in interface CompositeFigure
public void basicAdd(int index,
Figure figure)
CompositeFigure
basicAdd in interface CompositeFigurepublic void basicAddAll(java.util.Collection<Figure> newFigures)
public void addNotify(Drawing drawing)
Figure
addNotify in interface FigureaddNotify in class AbstractFigurepublic void removeNotify(Drawing drawing)
Figure
removeNotify in interface FigureremoveNotify in class AbstractFigurepublic boolean remove(Figure figure)
CompositeFigure
remove in interface CompositeFigurepublic Figure removeChild(int index)
CompositeFigure
removeChild in interface CompositeFigurepublic boolean basicRemove(Figure figure)
CompositeFigure
basicRemove in interface CompositeFigurepublic Figure basicRemoveChild(int index)
CompositeFigure
basicRemoveChild in interface CompositeFigurepublic void removeAllChildren()
removeAllChildren in interface CompositeFigureadd(org.jhotdraw.draw.Figure)public void basicRemoveAllChildren()
CompositeFigure
basicRemoveAllChildren in interface CompositeFigurepublic void sendToBack(Figure figure)
figure - that is part of this composite figurepublic void sendToFront(Figure figure)
figure - that is part of the drawingpublic void basicTransform(java.awt.geom.AffineTransform tx)
basicTransform in interface FigurebasicTransform in class AbstractFiguretx - The transformation.
public void basicSetBounds(java.awt.geom.Point2D.Double anchor,
java.awt.geom.Point2D.Double lead)
FigureThis is used by Tool's which create a new Figure and by Tool's which connect a Figure to another Figure.
This is a basic operation which does not fire events.
basicSetBounds in interface Figureanchor - the start point of the boundslead - the end point of the boundsFigure.getBounds()public void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
public java.util.List<Figure> getChildren()
CompositeFigure
getChildren in interface CompositeFigurepublic int getChildCount()
CompositeFigure
getChildCount in interface CompositeFigurepublic Figure getChild(int index)
CompositeFigure
getChild in interface CompositeFigurepublic java.util.List<Figure> getChildrenFrontToBack()
public void setAttribute(AttributeKey name,
java.lang.Object value)
Figure
On an attribute change, the Figure fires
FigureListener.figureAttributeChanged,
UndoableEditListener.undoableEditHappened. If
the shape is affected by an attribute change,
FigureListener.figureChanged is fired too.
setAttribute in interface Figure
public void basicSetAttribute(AttributeKey name,
java.lang.Object value)
Figure
Use AttributeKey.set() for typesafe access to this method.
basicSetAttribute in interface FigureAttributeKey.set(org.jhotdraw.draw.Figure, T)public java.lang.Object getAttribute(AttributeKey name)
Figure
Use AttributeKey.get() for typesafe access to this method.
getAttribute in interface FigureAttributeKey.get(org.jhotdraw.draw.Figure)public boolean contains(java.awt.geom.Point2D.Double p)
FigureThis is used for hit testing by Tool's.
contains in interface Figurepublic Figure findFigureInside(java.awt.geom.Point2D.Double p)
Figure
findFigureInside in interface FigurefindFigureInside in class AbstractFigurepublic Figure findChild(java.awt.geom.Point2D.Double p)
public int findChildIndex(java.awt.geom.Point2D.Double p)
public Layouter getLayouter()
getLayouter in interface CompositeFigurepublic void layout()
layout in interface CompositeFigurepublic void setLayouter(Layouter newLayouter)
setLayouter in interface CompositeFigurenewLayouter - encapsulation of a layout algorithm.public Dimension2DDouble getPreferredSize()
Figure
getPreferredSize in interface FiguregetPreferredSize in class AbstractFigurepublic java.awt.geom.Rectangle2D.Double getFigureDrawBounds()
getFigureDrawBounds in class AbstractFigurepublic java.awt.geom.Rectangle2D.Double getBounds()
Figure
getBounds in interface Figurepublic void drawFigure(java.awt.Graphics2D g)
drawFigure in class AbstractFigureprotected void drawConnectors(java.awt.Graphics2D g)
public AbstractCompositeFigure clone()
Figure
clone in interface Figureclone in class AbstractFigureprotected void invalidateBounds()
public java.util.Collection<Figure> getDecomposition()
Figure
getDecomposition in interface FiguregetDecomposition in class AbstractFigure
public void read(DOMInput in)
throws java.io.IOException
read in interface DOMStorablejava.io.IOException
public void write(DOMOutput out)
throws java.io.IOException
write in interface DOMStorablejava.io.IOExceptionpublic java.util.Map<AttributeKey,java.lang.Object> getAttributes()
Figure
getAttributes in interface Figurepublic void restoreTo(java.lang.Object geometry)
Figure
restoreTo in interface Figurepublic java.lang.Object getRestoreData()
Figure
getRestoreData in interface FigureFigure.basicTransform(AffineTransform)public void willChange()
AbstractFigure
willChange in interface FigurewillChange in class AbstractFigurepublic void changed()
AbstractFigure
changed in interface Figurechanged in class AbstractFigureFigure.willChange()public void invalidate()
AbstractFigure
invalidate in interface Figureinvalidate in class AbstractFigureprotected void validate()
validate in class AbstractFigurepublic void removeAttribute(AttributeKey key)
public boolean hasAttribute(AttributeKey key)
|
Copyright 1996-2006 © JHotDraw.org | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||