kitfox-svg-core
1.0.0-build001 / 2012-04-07T15:40:49.711-0500

com.kitfox.svg
Class SVGDiagram

java.lang.Object
  extended by com.kitfox.svg.SVGDiagram
All Implemented Interfaces:
Serializable

public class SVGDiagram
extends Object
implements Serializable

Top level structure in an SVG tree.

Author:
Mark McKay, Mark McKay
See Also:
Serialized Form

Field Summary
protected  boolean ignoreClipHeuristic
          If true, no attempt will be made to discard geometry based on it being out of bounds.
static long serialVersionUID
           
 
Constructor Summary
SVGDiagram(URI xmlBase, SVGUniverse universe)
          Creates a new instance of SVGDiagram
 
Method Summary
 Rectangle getDeviceViewport()
           
 SVGElement getElement(String name)
           
 float getHeight()
           
 SVGRoot getRoot()
           
 SVGUniverse getUniverse()
           
 Rectangle2D getViewRect()
           
 Rectangle2D getViewRect(Rectangle2D rect)
          Returns the viewing rectangle of this diagram in device coordinates.
 float getWidth()
           
 URI getXMLBase()
           
 boolean ignoringClipHeuristic()
           
 List pick(Point2D point, boolean boundingBox, List retVec)
           
 List pick(Point2D point, List retVec)
          Searches thorough the scene graph for all RenderableElements that have shapes that contain the passed point.
 List pick(Rectangle2D pickArea, boolean boundingBox, List retVec)
           
 List pick(Rectangle2D pickArea, List retVec)
           
 void removeElement(String name)
           
 void render(Graphics2D g)
          Draws this diagram to the passed graphics context
 void setDeviceViewport(Rectangle deviceViewport)
          Sets the dimensions of the device being rendered into.
 void setElement(String name, SVGElement node)
           
 void setIgnoringClipHeuristic(boolean ignoreClipHeuristic)
           
 void setRoot(SVGRoot root)
           
 void updateTime(double curTime)
          Updates all attributes in this diagram associated with a time event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

ignoreClipHeuristic

protected boolean ignoreClipHeuristic
If true, no attempt will be made to discard geometry based on it being out of bounds. This trades potentially drawing many out of bounds shapes with having to recalculate bounding boxes every animation iteration.

Constructor Detail

SVGDiagram

public SVGDiagram(URI xmlBase,
                  SVGUniverse universe)
Creates a new instance of SVGDiagram

Method Detail

render

public void render(Graphics2D g)
            throws SVGException
Draws this diagram to the passed graphics context

Throws:
SVGException

pick

public List pick(Point2D point,
                 List retVec)
          throws SVGException
Searches thorough the scene graph for all RenderableElements that have shapes that contain the passed point. For every shape which contains the pick point, a List containing the path to the node is added to the return list. That is, the result of SVGElement.getPath() is added for each entry.

Returns:
the passed in list
Throws:
SVGException

pick

public List pick(Point2D point,
                 boolean boundingBox,
                 List retVec)
          throws SVGException
Throws:
SVGException

pick

public List pick(Rectangle2D pickArea,
                 List retVec)
          throws SVGException
Throws:
SVGException

pick

public List pick(Rectangle2D pickArea,
                 boolean boundingBox,
                 List retVec)
          throws SVGException
Throws:
SVGException

getUniverse

public SVGUniverse getUniverse()

getXMLBase

public URI getXMLBase()

getWidth

public float getWidth()

getHeight

public float getHeight()

getViewRect

public Rectangle2D getViewRect(Rectangle2D rect)
Returns the viewing rectangle of this diagram in device coordinates.


getViewRect

public Rectangle2D getViewRect()

getElement

public SVGElement getElement(String name)

setElement

public void setElement(String name,
                       SVGElement node)

removeElement

public void removeElement(String name)

getRoot

public SVGRoot getRoot()

setRoot

public void setRoot(SVGRoot root)

ignoringClipHeuristic

public boolean ignoringClipHeuristic()

setIgnoringClipHeuristic

public void setIgnoringClipHeuristic(boolean ignoreClipHeuristic)

updateTime

public void updateTime(double curTime)
                throws SVGException
Updates all attributes in this diagram associated with a time event. Ie, all attributes with track information.

Throws:
SVGException

getDeviceViewport

public Rectangle getDeviceViewport()

setDeviceViewport

public void setDeviceViewport(Rectangle deviceViewport)
Sets the dimensions of the device being rendered into. This is used by SVGRoot when its x, y, width or height parameters are specified as percentages.


kitfox-svg-core
1.0.0-build001 / 2012-04-07T15:40:49.711-0500

Copyright © 2011-2012 Barchart, Inc.. All Rights Reserved.