|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.standard.AbstractFigure
org.jhotdraw.standard.CompositeFigure
public abstract class CompositeFigure
A Figure that is composed of several figures. A CompositeFigure doesn't define any layout behavior. It is up to subclassers to arrange the contained figures.
Composite
CompositeFigure enables to treat a composition of figures like
a single figure.
Figure
,
Serialized FormField Summary |
---|
Fields inherited from interface org.jhotdraw.framework.Figure |
---|
POPUP_MENU |
Method Summary | |
---|---|
Figure |
add(Figure figure)
Adds a figure to the list of figures. |
void |
addAll(FigureEnumeration fe)
Adds a FigureEnumeration of figures. |
void |
addAll(java.util.List newFigures)
Deprecated. use addAll(FigureEnumeration) instead |
void |
bringToFront(Figure figure)
Brings a figure to the front. |
boolean |
containsFigure(Figure checkFigure)
Check whether a given figure is a child figure of this CompositeFigure. |
void |
draw(java.awt.Graphics g)
Draws all the contained figures |
void |
draw(java.awt.Graphics g,
FigureEnumeration fe)
Draws only the given figures |
Figure |
figureAt(int i)
Gets a figure at the given index. |
void |
figureChanged(FigureChangeEvent e)
Sent when a figure changed |
int |
figureCount()
Gets number of child figures. |
void |
figureInvalidated(FigureChangeEvent e)
Propagates the figureInvalidated event to my listener. |
void |
figureRemoved(FigureChangeEvent e)
Sent when a figure was removed |
void |
figureRequestRemove(FigureChangeEvent e)
Propagates the removeFromDrawing request up to the container. |
void |
figureRequestUpdate(FigureChangeEvent e)
Propagates the requestUpdate request up to the container. |
FigureEnumeration |
figures()
Returns an Enumeration for accessing the contained figures. |
FigureEnumeration |
figures(java.awt.Rectangle viewRectangle)
Returns an enumeration to iterate in Z-order back to front over the figures that lie within the given bounds. |
FigureEnumeration |
figuresReverse()
Returns an Enumeration for accessing the contained figures in the reverse drawing order. |
Figure |
findFigure(int x,
int y)
Finds a top level Figure. |
Figure |
findFigure(java.awt.Rectangle r)
Finds a top level Figure that intersects the given rectangle. |
Figure |
findFigure(java.awt.Rectangle r,
Figure without)
Finds a top level Figure that intersects the given rectangle. |
Figure |
findFigureInside(int x,
int y)
Finds a figure but descends into a figure's children. |
Figure |
findFigureInsideWithout(int x,
int y,
Figure without)
Finds a figure but descends into a figure's children. |
Figure |
findFigureWithout(int x,
int y,
Figure without)
Finds a top level Figure, but supresses the passed in figure. |
Figure |
getFigureFromLayer(int layerNr)
Gets the figure from a certain layer. |
int |
getLayer(Figure figure)
Gets the layer for a certain figure (first occurrence). |
boolean |
includes(Figure figure)
Checks if the composite figure has the argument as one of its children. |
void |
init(java.awt.Rectangle viewRectangle)
Used to optimize rendering. |
Figure |
orphan(Figure figure)
Removes a figure from the figure list, but doesn't release it. |
void |
orphanAll(FigureEnumeration fe)
|
void |
orphanAll(java.util.List newFigures)
Deprecated. use orphanAll(FigureEnumeration) instead |
void |
read(StorableInput dr)
Reads the contained figures from StorableInput. |
void |
release()
Releases the figure and all its children. |
Figure |
remove(Figure figure)
Removes a figure from the composite. |
void |
removeAll()
Removes all children. |
void |
removeAll(FigureEnumeration fe)
Removes a FigureEnumeration of figures. |
void |
removeAll(java.util.List figures)
Deprecated. use removeAll(FigureEnumeration) instead |
Figure |
replace(Figure figure,
Figure replacement)
Replaces a figure in the drawing without removing it from the drawing. |
void |
sendToBack(Figure figure)
Sends a figure to the back of the drawing. |
void |
sendToLayer(Figure figure,
int layerNr)
Sends a figure to a certain layer within a drawing. |
void |
write(StorableOutput dw)
Writes the contained figures to the StorableOutput. |
Methods inherited from class org.jhotdraw.standard.AbstractFigure |
---|
addDependendFigure, addFigureChangeListener, addToContainer, basicDisplayBox, canConnect, center, changed, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, displayBox, getAttribute, getAttribute, getDecoratedFigure, getDependendFigures, getTextHolder, getZValue, handles, invalidate, isEmpty, listener, moveBy, removeDependendFigure, removeFigureChangeListener, removeFromContainer, setAttribute, setAttribute, setZValue, size, visit, willChange |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Figure add(Figure figure)
figure
- to be added to the drawing
public void addAll(java.util.List newFigures)
add(org.jhotdraw.framework.Figure)
public void addAll(FigureEnumeration fe)
fe
- (unused) enumeration containing all figures to be addedadd(org.jhotdraw.framework.Figure)
public Figure remove(Figure figure)
figure
- that is part of the drawing and should be removed
removeAll(java.util.List)
public void removeAll(java.util.List figures)
remove(org.jhotdraw.framework.Figure)
public void removeAll(FigureEnumeration fe)
remove(org.jhotdraw.framework.Figure)
public void removeAll()
remove(org.jhotdraw.framework.Figure)
public Figure orphan(Figure figure)
figure
- that is part of the drawing and should be addedpublic void orphanAll(java.util.List newFigures)
orphan(org.jhotdraw.framework.Figure)
public void orphanAll(FigureEnumeration fe)
public Figure replace(Figure figure, Figure replacement)
figure
- figure to be replacedreplacement
- figure that should replace the specified figure
public void sendToBack(Figure figure)
figure
- that is part of the drawingpublic void bringToFront(Figure figure)
figure
- that is part of the drawingpublic void sendToLayer(Figure figure, int layerNr)
figure
- figure to be sent to a certain layerlayerNr
- target layer of the figurepublic int getLayer(Figure figure)
figure
- figure to be queried for its layering place
sendToLayer(org.jhotdraw.framework.Figure, int)
public Figure getFigureFromLayer(int layerNr)
layerNr
- number of the layer which figure should be returned
sendToLayer(org.jhotdraw.framework.Figure, int)
public void draw(java.awt.Graphics g)
draw
in interface Figure
g
- the Graphics to draw intoFigure.draw(java.awt.Graphics)
public void draw(java.awt.Graphics g, FigureEnumeration fe)
Figure.draw(java.awt.Graphics)
public Figure figureAt(int i)
public FigureEnumeration figures()
figures
in interface Figure
figures
in class AbstractFigure
CompositeFigure
public FigureEnumeration figures(java.awt.Rectangle viewRectangle)
public int figureCount()
public boolean containsFigure(Figure checkFigure)
public final FigureEnumeration figuresReverse()
public Figure findFigure(int x, int y)
public Figure findFigure(java.awt.Rectangle r)
public Figure findFigureWithout(int x, int y, Figure without)
x
- the x coordinatey
- the y coordinatewithout
- the figure to be ignored during
the find.public Figure findFigure(java.awt.Rectangle r, Figure without)
public Figure findFigureInside(int x, int y)
findFigureInside
in interface Figure
findFigureInside
in class AbstractFigure
AbstractFigure.containsPoint(int, int)
public Figure findFigureInsideWithout(int x, int y, Figure without)
public boolean includes(Figure figure)
includes
in interface Figure
includes
in class AbstractFigure
public void release()
release
in interface Figure
release
in class AbstractFigure
Figure.release()
public void figureInvalidated(FigureChangeEvent e)
figureInvalidated
in interface FigureChangeListener
FigureChangeListener
public void figureRequestRemove(FigureChangeEvent e)
figureRequestRemove
in interface FigureChangeListener
FigureChangeListener
public void figureRequestUpdate(FigureChangeEvent e)
figureRequestUpdate
in interface FigureChangeListener
FigureChangeListener
public void figureChanged(FigureChangeEvent e)
FigureChangeListener
figureChanged
in interface FigureChangeListener
public void figureRemoved(FigureChangeEvent e)
FigureChangeListener
figureRemoved
in interface FigureChangeListener
public void write(StorableOutput dw)
write
in interface Storable
write
in class AbstractFigure
public void read(StorableInput dr) throws java.io.IOException
read
in interface Storable
read
in class AbstractFigure
java.io.IOException
public void init(java.awt.Rectangle viewRectangle)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |