|
||||||||||
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
org.jhotdraw.contrib.GraphicalCompositeFigure
public class GraphicalCompositeFigure
The GraphicalCompositeFigure fills in the gap between a CompositeFigure
and other figures which mainly have a presentation purpose. The
GraphicalCompositeFigure can be configured with any Figure which
takes over the task for rendering the graphical presentation for
a CompositeFigure. Therefore, the GraphicalCompositeFigure manages
contained figures like the CompositeFigure does, but delegates
its graphical presentation to another (graphical) figure which
purpose it is to draw the container for all contained figures.
The GraphicalCompositeFigure adds to the CompositeFigure
by containing a presentation figure by default which can not be removed. Normally,
the CompositeFigure
can not be seen without containing a figure
because it has no mechanism to draw itself. It instead relies on its contained
figures to draw themselves thereby giving the CompositeFigure
its
appearance. However, the GraphicalCompositeFigure's presentation figure
can draw itself even when the GraphicalCompositeFigure contains no other figures.
The GraphicalCompositeFigure also uses a Layouter
or layout
its contained figures.
Field Summary |
---|
Fields inherited from interface org.jhotdraw.framework.Figure |
---|
POPUP_MENU |
Constructor Summary | |
---|---|
GraphicalCompositeFigure()
Default constructor which uses a RectangleFigure as presentation figure. |
|
GraphicalCompositeFigure(Figure newPresentationFigure)
Constructor which creates a GraphicalCompositeFigure with a given graphical figure for presenting it. |
Method Summary | |
---|---|
void |
basicDisplayBox(java.awt.Point origin,
java.awt.Point corner)
Standard presentation method which is delegated to the encapsulated presentation figure. |
java.lang.Object |
clone()
Clones a figure and initializes it |
java.awt.Rectangle |
displayBox()
Return the display area. |
void |
draw(java.awt.Graphics g)
Draw the figure. |
void |
figureRequestRemove(FigureChangeEvent e)
Propagates the removeFromDrawing request up to the container. |
java.lang.Object |
getAttribute(FigureAttributeConstant attributeConstant)
Delegate capabilities for storing and retrieving attributes to a CompositeFigure if the encapsulated presentation figure. |
java.lang.Object |
getAttribute(java.lang.String name)
Deprecated. use getAttribute(FigureAttributeConstant) instead |
Layouter |
getLayouter()
Get a Layouter object which encapsulated a layout algorithm for this figure. |
Figure |
getPresentationFigure()
Get a figure which renders this CompositeFigure. |
HandleEnumeration |
handles()
Return default handles from the presentation figure. |
void |
layout()
A layout algorithm is used to define how the child components should be laid out in relation to each other. |
void |
read(StorableInput dr)
Reads the contained figures from StorableInput. |
void |
setAttribute(FigureAttributeConstant attributeConstant,
java.lang.Object value)
Delegate capabilities for storing and retrieving attributes to a CompositeFigure if the encapsulated presentation figure. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Deprecated. use setAttribute(FigureAttributeConstant, Object) instead |
void |
setLayouter(Layouter newLayouter)
Set a Layouter object which encapsulated a layout algorithm for this figure. |
void |
setPresentationFigure(Figure newPresentationFigure)
Set a figure which renders this CompositeFigure. |
void |
update()
Explicit update: an updated involves a layout for all contained figures. |
void |
write(StorableOutput dw)
Writes the contained figures to the StorableOutput. |
Methods inherited from class org.jhotdraw.standard.CompositeFigure |
---|
add, addAll, addAll, bringToFront, containsFigure, draw, figureAt, figureChanged, figureCount, figureInvalidated, figureRemoved, figureRequestUpdate, figures, figures, figuresReverse, findFigure, findFigure, findFigure, findFigureInside, findFigureInsideWithout, findFigureWithout, getFigureFromLayer, getLayer, includes, init, orphan, orphanAll, orphanAll, release, remove, removeAll, removeAll, removeAll, replace, sendToBack, sendToLayer |
Methods inherited from class org.jhotdraw.standard.AbstractFigure |
---|
addDependendFigure, addFigureChangeListener, addToContainer, canConnect, center, changed, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, getDecoratedFigure, getDependendFigures, getTextHolder, getZValue, invalidate, isEmpty, listener, moveBy, removeDependendFigure, removeFigureChangeListener, removeFromContainer, setZValue, size, visit, willChange |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jhotdraw.framework.Figure |
---|
addDependendFigure, addFigureChangeListener, addToContainer, canConnect, center, changed, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, figures, findFigureInside, getDecoratedFigure, getDependendFigures, getTextHolder, getZValue, includes, invalidate, isEmpty, listener, moveBy, release, removeDependendFigure, removeFigureChangeListener, removeFromContainer, setZValue, size, visit, willChange |
Constructor Detail |
---|
public GraphicalCompositeFigure()
public GraphicalCompositeFigure(Figure newPresentationFigure)
newPresentationFigure
- figure which renders the containerMethod Detail |
---|
public java.lang.Object clone()
clone
in interface Figure
clone
in class AbstractFigure
Figure.clone()
public java.awt.Rectangle displayBox()
displayBox
in interface Figure
displayBox
in class AbstractFigure
Figure.basicDisplayBox(java.awt.Point, java.awt.Point)
public void basicDisplayBox(java.awt.Point origin, java.awt.Point corner)
basicDisplayBox
in interface Figure
basicDisplayBox
in class AbstractFigure
origin
- the new origincorner
- the new cornerAbstractFigure.displayBox(java.awt.Point, java.awt.Point)
public void update()
public void draw(java.awt.Graphics g)
draw
in interface Figure
draw
in class CompositeFigure
g
- the Graphics to draw intoFigure.draw(java.awt.Graphics)
public HandleEnumeration handles()
handles
in interface Figure
handles
in class AbstractFigure
Handle
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface Figure
getAttribute
in class AbstractFigure
name
- name of the attribute whose value should be returned
public java.lang.Object getAttribute(FigureAttributeConstant attributeConstant)
getAttribute
in interface Figure
getAttribute
in class AbstractFigure
attributeConstant
- attribute constant whose value should be returned
public void setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in interface Figure
setAttribute
in class AbstractFigure
name
- name of the attributevalue
- value associated with this attributepublic void setAttribute(FigureAttributeConstant attributeConstant, java.lang.Object value)
setAttribute
in interface Figure
setAttribute
in class AbstractFigure
attributeConstant
- attribute constantvalue
- value associated with this attributepublic void setPresentationFigure(Figure newPresentationFigure)
newPresentationFigure
- figure takes over the presentation taskspublic Figure getPresentationFigure()
public void layout()
layout
in interface Layoutable
public void setLayouter(Layouter newLayouter)
setLayouter
in interface Layoutable
newLayouter
- encapsulation of a layout algorithm.public Layouter getLayouter()
getLayouter
in interface Layoutable
public void figureRequestRemove(FigureChangeEvent e)
figureRequestRemove
in interface FigureChangeListener
figureRequestRemove
in class CompositeFigure
FigureChangeListener
public void read(StorableInput dr) throws java.io.IOException
read
in interface Storable
read
in class CompositeFigure
java.io.IOException
public void write(StorableOutput dw)
write
in interface Storable
write
in class CompositeFigure
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |