JHotDraw 7.0.6

org.jhotdraw.samples.svg.figures
Class SVGPath

java.lang.Object
  extended by org.jhotdraw.draw.AbstractFigure
      extended by org.jhotdraw.draw.AbstractCompositeFigure
          extended by org.jhotdraw.draw.AbstractAttributedCompositeFigure
              extended by org.jhotdraw.samples.svg.figures.SVGPath
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, CompositeFigure, Figure, SVGFigure, DOMStorable

public class SVGPath
extends AbstractAttributedCompositeFigure
implements SVGFigure

SVGPath is a composite Figure which contains one or more BezierFigures as its children.

XXX - Roll in the read() method of SVGLine.

See Also:
Serialized Form

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
SVGPath()
          Creates a new instance.
 
Method Summary
 void basicTransform(java.awt.geom.AffineTransform tx)
          Transforms the figure.
 java.util.LinkedList<Handle> createHandles(int detailLevel)
          Creates handles used to manipulate the figure.
 void drawFigure(java.awt.Graphics2D g)
           
 void drawFill(java.awt.Graphics2D g)
          This method is called by method draw() to draw the fill area of the figure.
 void drawStroke(java.awt.Graphics2D g)
          This method is called by method draw() to draw the text of the figure .
 java.util.Collection<javax.swing.Action> getActions(java.awt.geom.Point2D.Double p)
          Returns a collection of actions which are presented to the user in a popup menu.
 void invalidate()
          Informs that a figure needs to be redrawn.
protected  void invalidatePath()
           
 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
 void read(DOMInput in)
           
protected  void readAttributes(DOMInput in)
           
protected  void readPoints(DOMInput in)
           
protected  void validate()
           
protected  void validatePath()
           
 void write(DOMOutput out)
           
protected  void writeAttributes(DOMOutput out)
           
protected  void writePoints(DOMOutput out)
           
 
Methods inherited from class org.jhotdraw.draw.AbstractAttributedCompositeFigure
applyAttributesTo, basicSetAttribute, basicSetAttributeOnChildren, clone, drawChildren, drawConnectors, drawText, getAttribute, getAttributeKey, getAttributes, getFigureDrawBounds, getStroke, getStrokeMiterLimitFactor, hasAttribute, isAttributeEnabled, removeAttribute, setAttribute, setAttributeEnabled, setAttributes
 
Methods inherited from class org.jhotdraw.draw.AbstractCompositeFigure
add, add, addAll, addNotify, basicAdd, basicAdd, basicAddAll, basicRemove, basicRemoveAllChildren, basicRemoveChild, basicSetBounds, changed, contains, findChild, findChildIndex, findFigureInside, getBounds, getChild, getChildCount, getChildren, getChildrenFrontToBack, getDecomposition, getLayouter, getPreferredSize, getRestoreData, invalidateBounds, layout, remove, removeAllChildren, removeChild, removeNotify, restoreTo, sendToBack, sendToFront, setLayouter, undoableEditHappened, willChange
 
Methods inherited from class org.jhotdraw.draw.AbstractFigure
addFigureListener, addUndoableEditListener, basicClone, canConnect, draw, drawDecorator, findCompatibleConnector, findConnector, fireAreaInvalidated, fireAreaInvalidated, fireAttributeChanged, fireFigureAdded, fireFigureChanged, fireFigureChanged, fireFigureChanged, fireFigureRemoved, fireFigureRequestRemove, fireUndoableEditHappened, getChangingDepth, getCourtingConnection, getCursor, getDecorator, getDrawBounds, getDrawing, getEndPoint, getFontRenderContext, getLayer, getLock, getStartPoint, getTool, getTooltip, handleDrop, handleMouseClick, includes, isChanging, isConnectorsVisible, isDrawDecoratorFirst, isInteractive, isVisible, remap, remap, removeFigureListener, removeUndoableEditListener, requestRemove, setBounds, setBounds, setConnectorsVisible, setDecorator, setDrawDecoratorFirst, setInteractive, setVisible, toString, transform, updateDecoratorBounds
 
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, addNotify, addUndoableEditListener, basicSetAttribute, basicSetBounds, canConnect, changed, clone, contains, draw, findCompatibleConnector, findConnector, findFigureInside, getAttribute, getAttributes, getBounds, getCursor, getDecomposition, getDecorator, getDrawBounds, getEndPoint, getLayer, getPreferredSize, getRestoreData, getStartPoint, getTool, getTooltip, handleDrop, handleMouseClick, includes, isConnectorsVisible, isInteractive, isVisible, remap, removeFigureListener, removeNotify, removeUndoableEditListener, requestRemove, restoreTo, setAttribute, setConnectorsVisible, setDecorator, setVisible, willChange
 

Constructor Detail

SVGPath

public SVGPath()
Creates a new instance.

Method Detail

drawFigure

public void drawFigure(java.awt.Graphics2D g)
Overrides:
drawFigure in class AbstractAttributedCompositeFigure

drawFill

public void drawFill(java.awt.Graphics2D g)
Description copied from class: AbstractAttributedCompositeFigure
This method is called by method draw() to draw the fill area of the figure. AttributedFigure configures the Graphics2D object with the FILL_COLOR attribute before calling this method. If the FILL_COLOR attribute is null, this method is not called.

Specified by:
drawFill in class AbstractAttributedCompositeFigure

drawStroke

public void drawStroke(java.awt.Graphics2D g)
Description copied from class: AbstractAttributedCompositeFigure
This method is called by method draw() to draw the text of the figure . AttributedFigure configures the Graphics2D object with the TEXT_COLOR attribute before calling this method. If the TEXT_COLOR attribute is null, this method is not called.

Specified by:
drawStroke in class AbstractAttributedCompositeFigure

invalidate

public void invalidate()
Description copied from class: AbstractFigure
Informs that a figure needs to be redrawn.

Specified by:
invalidate in interface Figure
Overrides:
invalidate in class AbstractCompositeFigure

validate

protected void validate()
Overrides:
validate in class AbstractCompositeFigure

validatePath

protected void validatePath()

invalidatePath

protected void invalidatePath()

write

public void write(DOMOutput out)
           throws java.io.IOException
Specified by:
write in interface DOMStorable
Overrides:
write in class AbstractAttributedCompositeFigure
Throws:
java.io.IOException

writePoints

protected void writePoints(DOMOutput out)

writeAttributes

protected void writeAttributes(DOMOutput out)
                        throws java.io.IOException
Overrides:
writeAttributes in class AbstractAttributedCompositeFigure
Throws:
java.io.IOException

read

public void read(DOMInput in)
          throws java.io.IOException
Specified by:
read in interface DOMStorable
Overrides:
read in class AbstractAttributedCompositeFigure
Throws:
java.io.IOException

readPoints

protected void readPoints(DOMInput in)
                   throws java.io.IOException
Throws:
java.io.IOException

readAttributes

protected void readAttributes(DOMInput in)
                       throws java.io.IOException
Overrides:
readAttributes in class AbstractAttributedCompositeFigure
Throws:
java.io.IOException

basicTransform

public void basicTransform(java.awt.geom.AffineTransform tx)
Description copied from class: AbstractCompositeFigure
Transforms the figure.

Specified by:
basicTransform in interface Figure
Overrides:
basicTransform in class AbstractCompositeFigure
Parameters:
tx - The transformation.

isEmpty

public boolean isEmpty()
Description copied from interface: SVGFigure
Returns true, if this figure is empty for one of the following reasons:

Specified by:
isEmpty in interface SVGFigure

createHandles

public java.util.LinkedList<Handle> createHandles(int detailLevel)
Description copied from interface: Figure
Creates handles used to manipulate the figure.

Specified by:
createHandles in interface Figure
Overrides:
createHandles in class AbstractCompositeFigure
Parameters:
detailLevel - The detail level of the handles. Usually this is 0 for bounding box handles and 1 for point handles.
Returns:
a Collection of handles
See Also:
Handle

getActions

public java.util.Collection<javax.swing.Action> getActions(java.awt.geom.Point2D.Double p)
Description copied from class: AbstractFigure
Returns a collection of actions which are presented to the user in a popup menu.

The collection may contain null entries. These entries are used interpreted as separators in the popup menu.

Specified by:
getActions in interface Figure
Overrides:
getActions in class AbstractFigure

Copyright 1996-2006 © JHotDraw.org