public class SVGGroupFigure extends GroupFigure implements SVGFigure
AbstractCompositeFigure.EventHandler
cachedBounds, cachedDrawingArea, children, eventHandler, layouter
changingDepth, listenerList
propertySupport
CONNECTABLE_PROPERTY, REMOVABLE_PROPERTY, SELECTABLE_PROPERTY, TRANSFORMABLE_PROPERTY
LAYOUT_INSETS
Constructor and Description |
---|
SVGGroupFigure()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
SVGGroupFigure |
clone()
Returns a clone of the figure, with clones of all aggregated figures,
such as children and decorators.
|
java.util.LinkedList<Handle> |
createHandles(int detailLevel)
Creates handles used to manipulate the figure.
|
void |
draw(java.awt.Graphics2D g)
Draws the figure.
|
<T> T |
get(AttributeKey<T> key)
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 untransformed logical bounds of the figure as a Rectangle.
|
boolean |
isEmpty()
Returns true, if this figure is empty for one of the following
reasons:
A group has no children
A path has less than two points
An ellipse or a rectangle has a width or a height of 0
A text has no characters
|
<T> void |
set(AttributeKey<T> key,
T value)
Sets an attribute on the figure and calls
attributeChanged
on all registered FigureListener s if the attribute value
has changed. |
void |
setAttributes(java.util.Map<AttributeKey,java.lang.Object> map) |
java.lang.String |
toString() |
chop, isTransformable
add, add, addAll, addAll, addCompositeFigureListener, addNotify, basicAdd, basicAdd, basicAddAll, basicRemove, basicRemoveAll, basicRemoveAllChildren, basicRemoveChild, bringToFront, changed, contains, contains, createEventHandler, findChild, findChildIndex, findFigureInside, fireFigureAdded, fireFigureRemoved, getAttributesRestoreData, getChild, getChildCount, getChildren, getChildrenFrontToBack, getDecomposition, getDrawingArea, getLayouter, getPreferredSize, getTransformRestoreData, indexOf, invalidate, layout, read, remove, removeAll, removeAllChildren, removeChild, removeCompositeFigureListener, removeNotify, restoreAttributesTo, restoreTransformTo, sendToBack, setBounds, setLayouter, transform, validate, willChange, write
addFigureListener, findCompatibleConnector, findConnector, fireAreaInvalidated, fireAreaInvalidated, fireAreaInvalidated, fireAttributeChanged, fireFigureAdded, fireFigureChanged, fireFigureChanged, fireFigureChanged, fireFigureHandlesChanged, fireFigureRemoved, fireFigureRequestRemove, fireUndoableEditHappened, getActions, getChangingDepth, getConnectors, getCursor, getDrawing, getEndPoint, getFontRenderContext, getLayer, getLock, getStartPoint, getTool, getToolTipText, handleDrop, handleMouseClick, includes, isChanging, isConnectable, isRemovable, isSelectable, isVisible, remap, removeFigureListener, requestRemove, setBounds, setConnectable, setRemovable, setSelectable, setTransformable, setVisible
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFigureListener, addNotify, addPropertyChangeListener, changed, contains, findCompatibleConnector, findConnector, findFigureInside, getActions, getAttributesRestoreData, getConnectors, getCursor, getDecomposition, getDrawingArea, getEndPoint, getLayer, getPreferredSize, getStartPoint, getTool, getToolTipText, getTransformRestoreData, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removeNotify, removePropertyChangeListener, requestRemove, restoreAttributesTo, restoreTransformTo, setBounds, transform, willChange
public <T> void set(AttributeKey<T> key, T value)
Figure
attributeChanged
on all registered FigureListener
s if the attribute value
has changed.
For efficiency reasons, the drawing is not automatically repainted.
If you want the drawing to be repainted when the attribute is changed,
you can either use key.set(figure, value);
or
figure.willChange(); figure.set(...); figure.changed();
set
in interface Figure
set
in class AbstractCompositeFigure
AttributeKey.set(org.jhotdraw.draw.Figure, T)
public <T> T get(AttributeKey<T> key)
Figure
get
in interface Figure
get
in class AbstractCompositeFigure
AttributeKey.get(org.jhotdraw.draw.Figure)
public java.util.Map<AttributeKey,java.lang.Object> getAttributes()
Figure
getAttributes
in interface Figure
getAttributes
in class AbstractCompositeFigure
public void setAttributes(java.util.Map<AttributeKey,java.lang.Object> map)
public void draw(java.awt.Graphics2D g)
Figure
draw
in interface Figure
draw
in class AbstractCompositeFigure
g
- The Graphics2D to draw to.public java.awt.geom.Rectangle2D.Double getBounds()
Figure
The bounds are used by Handle objects for adjusting the figure and for aligning the figure on a grid.
getBounds
in interface Figure
getBounds
in class AbstractCompositeFigure
public java.util.LinkedList<Handle> createHandles(int detailLevel)
Figure
createHandles
in interface Figure
createHandles
in class AbstractCompositeFigure
detailLevel
- The detail level of the handles. Usually this is 0 for
bounding box handles and 1 for point handles. The value -1 is used
by the SelectAreaTracker and the HandleTracker to highlight figures, over which the mouse
pointer is hovering.Handle
public boolean isEmpty()
SVGFigure
public java.lang.String toString()
toString
in class AbstractFigure
public SVGGroupFigure clone()
Figure
clone
in interface Figure
clone
in class AbstractCompositeFigure