org.jhotdraw.samples.svg.figures
Class SVGGroupFigure
- java.lang.Object
-
- org.jhotdraw.beans.AbstractBean
-
- org.jhotdraw.draw.AbstractFigure
-
- org.jhotdraw.draw.AbstractCompositeFigure
-
- org.jhotdraw.draw.GroupFigure
-
- org.jhotdraw.samples.svg.figures.SVGGroupFigure
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, CompositeFigure, Figure, SVGFigure, DOMStorable
public class SVGGroupFigure extends GroupFigure implements SVGFigure
SVGGroupFigure.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.jhotdraw.draw.Figure
CONNECTABLE_PROPERTY, REMOVABLE_PROPERTY, SELECTABLE_PROPERTY, TRANSFORMABLE_PROPERTY
-
Fields inherited from interface org.jhotdraw.draw.CompositeFigure
LAYOUT_INSETS
-
-
Constructor Summary
Constructors Constructor and Description SVGGroupFigure()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description SVGGroupFigureclone()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.voiddraw(java.awt.Graphics2D g)Draws the figure.<T> Tget(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.DoublegetBounds()Returns the untransformed logical bounds of the figure as a Rectangle.booleanisEmpty()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> voidset(AttributeKey<T> key, T value)Sets an attribute on the figure and callsattributeChangedon all registeredFigureListeners if the attribute value has changed.voidsetAttributes(java.util.Map<AttributeKey,java.lang.Object> map)java.lang.StringtoString()-
Methods inherited from class org.jhotdraw.draw.GroupFigure
chop, isTransformable
-
Methods inherited from class org.jhotdraw.draw.AbstractCompositeFigure
add, add, addAll, addAll, addCompositeFigureListener, addNotify, basicAdd, basicAdd, basicAddAll, basicRemove, basicRemoveAll, basicRemoveAllChildren, basicRemoveChild, bringToFront, changed, contains, contains, findChild, findChildIndex, findFigureInside, getAttributesRestoreData, getChild, getChildCount, getChildren, getChildrenFrontToBack, getDecomposition, getDrawingArea, getLayouter, getPreferredSize, getTransformRestoreData, indexOf, layout, read, remove, removeAll, removeAllChildren, removeChild, removeCompositeFigureListener, removeNotify, restoreAttributesTo, restoreTransformTo, sendToBack, setBounds, setLayouter, transform, willChange, write
-
Methods inherited from class org.jhotdraw.draw.AbstractFigure
addFigureListener, findCompatibleConnector, findConnector, fireAreaInvalidated, fireFigureChanged, getActions, getConnectors, getCursor, getEndPoint, getLayer, getStartPoint, getTool, getToolTipText, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isVisible, remap, removeFigureListener, requestRemove, setBounds, setConnectable, setRemovable, setSelectable, setTransformable, setVisible
-
Methods inherited from class org.jhotdraw.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jhotdraw.draw.Figure
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
-
-
-
-
Method Detail
-
set
public <T> void set(AttributeKey<T> key, T value)
Description copied from interface:FigureSets an attribute on the figure and callsattributeChangedon all registeredFigureListeners 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);orfigure.willChange(); figure.set(...); figure.changed();
- Specified by:
setin interfaceFigure- Overrides:
setin classAbstractCompositeFigure- See Also:
AttributeKey.set(org.jhotdraw.draw.Figure, T)
-
get
public <T> T get(AttributeKey<T> key)
Description copied from interface:FigureGets an attribute from the Figure.- Specified by:
getin interfaceFigure- Overrides:
getin classAbstractCompositeFigure- Returns:
- Returns the attribute value. If the Figure does not have an attribute with the specified key, returns key.getDefaultValue().
- See Also:
AttributeKey.get(org.jhotdraw.draw.Figure)
-
getAttributes
public java.util.Map<AttributeKey,java.lang.Object> getAttributes()
Description copied from interface:FigureReturns a view to all attributes of this figure. By convention, an unmodifiable map is returned.- Specified by:
getAttributesin interfaceFigure- Overrides:
getAttributesin classAbstractCompositeFigure
-
setAttributes
public void setAttributes(java.util.Map<AttributeKey,java.lang.Object> map)
-
draw
public void draw(java.awt.Graphics2D g)
Description copied from interface:FigureDraws the figure.- Specified by:
drawin interfaceFigure- Overrides:
drawin classAbstractCompositeFigure- Parameters:
g- The Graphics2D to draw to.
-
getBounds
public java.awt.geom.Rectangle2D.Double getBounds()
Description copied from interface:FigureReturns the untransformed logical bounds of the figure as a Rectangle.The bounds are used by Handle objects for adjusting the figure and for aligning the figure on a grid.
- Specified by:
getBoundsin interfaceFigure- Overrides:
getBoundsin classAbstractCompositeFigure
-
createHandles
public java.util.LinkedList<Handle> createHandles(int detailLevel)
Description copied from interface:FigureCreates handles used to manipulate the figure.- Specified by:
createHandlesin interfaceFigure- Overrides:
createHandlesin classAbstractCompositeFigure- Parameters:
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.- Returns:
- a Collection of handles
- See Also:
Handle
-
isEmpty
public boolean isEmpty()
Description copied from interface:SVGFigureReturns 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
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractFigure
-
clone
public SVGGroupFigure clone()
Description copied from interface:FigureReturns a clone of the figure, with clones of all aggregated figures, such as children and decorators. The cloned figure does not clone the list of FigureListeners from its original.- Specified by:
clonein interfaceFigure- Overrides:
clonein classAbstractCompositeFigure
-
-
DataMelt 3.0 © DataMelt by jWork.ORG