com.kitfox.svg
Class ShapeElement

java.lang.Object
  extended by com.kitfox.svg.SVGElement
      extended by com.kitfox.svg.TransformableElement
          extended by com.kitfox.svg.RenderableElement
              extended by com.kitfox.svg.ShapeElement
Direct Known Subclasses:
Circle, Ellipse, Group, Line, MissingGlyph, Path, Polygon, Polyline, Rect, Text, Tspan, Use

public abstract class ShapeElement
extends RenderableElement

Parent of shape objects

Author:
Mark McKay, Mark McKay

Field Summary
protected  float strokeWidthScalar
          This is necessary to get text elements to render the stroke the correct width.
 
Fields inherited from class com.kitfox.svg.SVGElement
children, cssClass, diagram, id, ignorePresAttrib, inlineStyles, parent, presAttribs, SVG_NS, trackManager, xmlBase
 
Constructor Summary
ShapeElement()
          Creates a new instance of ShapeElement
 
Method Summary
abstract  java.awt.Shape getShape()
           
protected  java.awt.geom.Rectangle2D includeStrokeInBounds(java.awt.geom.Rectangle2D rect)
           
abstract  void render(java.awt.Graphics2D g)
           
protected  void renderShape(java.awt.Graphics2D g, java.awt.Shape shape)
           
 
Methods inherited from class com.kitfox.svg.RenderableElement
beginLayer, finishLayer, getBoundingBox
 
Methods inherited from class com.kitfox.svg.TransformableElement
boundsToParent, build, shapeToParent, updateTime
 
Methods inherited from class com.kitfox.svg.SVGElement
addAttribute, buildPath, getChild, getChildren, getId, getParent, getPath, getPres, getPresAbsolute, getStyle, getStyle, getStyleAbsolute, getXMLBase, hasAttribute, loaderAddChild, loaderAddText, loaderEndElement, loaderStartElement, nextFloat, parsePathList, parseSingleTransform, parseTransform, removeChild, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strokeWidthScalar

protected float strokeWidthScalar
This is necessary to get text elements to render the stroke the correct width. It is an alternative to producing new font glyph sets at different sizes.

Constructor Detail

ShapeElement

public ShapeElement()
Creates a new instance of ShapeElement

Method Detail

render

public abstract void render(java.awt.Graphics2D g)
                     throws SVGException
Specified by:
render in class RenderableElement
Throws:
SVGException

renderShape

protected void renderShape(java.awt.Graphics2D g,
                           java.awt.Shape shape)
                    throws SVGException
Throws:
SVGException

getShape

public abstract java.awt.Shape getShape()

includeStrokeInBounds

protected java.awt.geom.Rectangle2D includeStrokeInBounds(java.awt.geom.Rectangle2D rect)
                                                   throws SVGException
Throws:
SVGException