massim.visualization.svg
Class SvgFunction

java.lang.Object
  extended by massim.visualization.svg.SvgFunction
Direct Known Subclasses:
Agent, ItemsAndObstacles, MainGrid

public class SvgFunction
extends java.lang.Object

main SVG function for more information look at www.w3.org/TR/SVG/index.html Copyright © [2006-05-08] World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231


Constructor Summary
SvgFunction()
           
 
Method Summary
 org.w3c.dom.Document funcAddAttribute(org.w3c.dom.Document doc, java.lang.String id, java.lang.String attribute, java.lang.String attributeValue)
           
 org.w3c.dom.Element funcCircle(org.w3c.dom.Document doc, double cx, double cy, double r, java.lang.String style)
          function create the SVG element circle -->
 org.w3c.dom.Element funcEllipse(org.w3c.dom.Document doc, double cx, double cy, double rx, double ry, java.lang.String style)
          function create the SVG element ellipse -->
 org.w3c.dom.Element funcLine(org.w3c.dom.Document doc, double x1, double x2, double y1, double y2, double rx, double ry, java.lang.String style)
          function create the SVG element line -->
 org.w3c.dom.Element funcLine(org.w3c.dom.Document doc, double x1, double x2, double y1, double y2, java.lang.String style)
          function create the SVG element line -->
 org.w3c.dom.Element funcPath(org.w3c.dom.Document doc, java.lang.String d, double pathLength, java.lang.String style)
          function create the SVG elment path -->  org.w3c.dom.Element
funcPath(org.w3c.dom.Document doc, java.lang.String d, java.lang.String style)
           
 org.w3c.dom.Element funcPolygon(org.w3c.dom.Document doc, java.lang.String points, java.lang.String style)
          function create the SVG element polygone -->  org.w3c.dom.Element
funcPolyline(org.w3c.dom.Document doc, java.lang.String points, java.lang.String style)
          function create the SVG element polyline -->  org.w3c.dom.Element
funcRect(org.w3c.dom.Document doc, double x, double y, double width, double height, double rx, double ry, java.lang.String style)
          function create the SVG element rectangle -->
 org.w3c.dom.Element funcText(org.w3c.dom.Document doc, double x, double y, java.lang.String text, java.lang.String style)
          function create the SVG element text --> Hello World!
 org.w3c.dom.Element funcText(org.w3c.dom.Document doc, java.lang.String id, double x, double y, java.lang.String text, java.lang.String style)
          function create the SVG element text --> Hello World!
 java.lang.String rotation(double x, double y, java.lang.String angle)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SvgFunction

public SvgFunction()
Method Detail

funcLine

public org.w3c.dom.Element funcLine(org.w3c.dom.Document doc,
                                    double x1,
                                    double x2,
                                    double y1,
                                    double y2,
                                    double rx,
                                    double ry,
                                    java.lang.String style)
function create the SVG element line -->

Parameters:
doc - svg document
x1 - x-axis coordinate of the start of the line
x2 - x-axis coordinate of the end of the line
y1 - y-axis coordinate of the start of the line
y2 - y-axis coordinate of the end of the line
rx -
ry -
style - style for the line NOTE: 'line' elements are never filled
Returns:
line svg element

funcLine

public org.w3c.dom.Element funcLine(org.w3c.dom.Document doc,
                                    double x1,
                                    double x2,
                                    double y1,
                                    double y2,
                                    java.lang.String style)
function create the SVG element line -->

Parameters:
doc - document
x1 - x-axis coordinate of the start of the line
x2 - x-axis coordinate of the end of the line
y1 - y-axis coordinate of the start of the line
y2 - y-axis coordinate of the end of the line
style - style for the line NOTE: 'line' elements are never filled
Returns:
line svg element

funcRect

public org.w3c.dom.Element funcRect(org.w3c.dom.Document doc,
                                    double x,
                                    double y,
                                    double width,
                                    double height,
                                    double rx,
                                    double ry,
                                    java.lang.String style)
function create the SVG element rectangle -->

Parameters:
doc - svg document
x - x-axis coordinate of the rectangle
y - y-axis coordinate of the rectangle
width - width of the rectangle
height - height of the rectangle
rx - rounded rectangles (x-axis radius of ellipse used to round off corners of rectangle) NOTE: negative value is an error
ry - rounded rectangles (y-axis radius of ellipse used to round off corners of rectangle) NOTE: negative value is an error
style -
Returns:
rectangle element

funcCircle

public org.w3c.dom.Element funcCircle(org.w3c.dom.Document doc,
                                      double cx,
                                      double cy,
                                      double r,
                                      java.lang.String style)
function create the SVG element circle -->

Parameters:
doc - svg document
cx - x-axis coordinate of the center of the circle
cy - y-axis coordinate of the center of the circle
r - radius of the circle NOTE: negative value is an error
style -
Returns:
circle element

funcEllipse

public org.w3c.dom.Element funcEllipse(org.w3c.dom.Document doc,
                                       double cx,
                                       double cy,
                                       double rx,
                                       double ry,
                                       java.lang.String style)
function create the SVG element ellipse -->

Parameters:
doc - svg document
cx - x-axis coordinate of the center of the ellipse
cy - y-axis coordinate of the center of the ellipse
rx - x-axis radius of the ellipse NOTE: negative value is an error
ry - y-axis radius of the ellipse NOTE: negative value is an error
style -
Returns:
ellipse element

funcPolyline

public org.w3c.dom.Element funcPolyline(org.w3c.dom.Document doc,
                                        java.lang.String points,
                                        java.lang.String style)
function create the SVG element polyline -->

funcPolygon

public org.w3c.dom.Element funcPolygon(org.w3c.dom.Document doc,
                                       java.lang.String points,
                                       java.lang.String style)
function create the SVG element polygone -->

funcPath

public org.w3c.dom.Element funcPath(org.w3c.dom.Document doc,
                                    java.lang.String d,
                                    double pathLength,
                                    java.lang.String style)
function create the SVG elment path -->

Parameters:
doc - svg document
d - definition of the outline of a shape NOTE: > "name" (parameters) //example Command //example > "moveto" (x y)+ M (absolute) indicates that absolute coordinates m (relative) indicates that relative coordinates > "closepath" (none) Z or z close the current subpath (drawing a straight line from current point to current subpath's initial point) > "lineto" (x y)+ draw a line from current point to given coordinate number of coordinates pairs may be specified to draw a polyline L (absolute) indicates that absolute coordinates l (relative) indicates that relative coordinates > "horizontal lineto" x+ Draws a horizontal line from current point (currentpoint(x), currentpoint(y)) to (x, currentpoint(y)) H (absolute) indicates that absolute coordinates h (relative) indicates that relative coordinates > "vertical lineto" y+ draws a vertical line from current point (currentpoint(x), currentpoint(y)) to (currentpoint(x), y) V (absolute) indicates that absolute coordinates v (relative) indicates that relative coordinates > "curveto" (x1 y1 x2 y2 x y)+ draws a cubic Bözier curve from current point to (x,y) using (x1,y1) as control point at beginning of curve and (x2,y2) as control point at end of curve C (absolute) indicates that absolute coordinates c (relative) indicates that relative coordinates > "shorthand/smooth curveto" (x2 y2 x y)+ draws a cubic Bözier curve from current point to (x,y) (x2,y2) is control point at the end of the curve S (absolute) indicates that absolute coordinates s (relative) indicates that relative coordinates > "quadratic Bözier curveto" (x1 y1 x y)+ Q (absolute) indicates that absolute coordinates q (relative) indicates that relative coordinates > "Shorthand/smooth quadratic Bözier curveto" (x y)+ draws a quadratic Bözier curve from current point to (x,y) T (absolute) indicates that absolute coordinates t (relative) indicates that relative coordinates > "elliptical arc" (rx ry x-axis-rotation large-arc-flag sweep-flag x y)+ draws an elliptical arc from current point to (x, y) size and orientation of ellipse are defined by two radii (rx, ry) and an x-axis-rotation, which indicates how ellipse as a whole is rotated relative to current coordinate system the center (cx, cy) of ellipse is calculated automatically to satisfy constraints imposed by other parameters large-arc-flag and sweep-flag contribute to automatic calculations and help determine how arc is drawn A (absolute) indicates that absolute coordinates a (relative) indicates that relative coordinates Copyright � [2006-05-08] World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231
pathLength - the total length of the path NOTE: negative value is an error
style -
Returns:
path element

funcPath

public org.w3c.dom.Element funcPath(org.w3c.dom.Document doc,
                                    java.lang.String d,
                                    java.lang.String style)

funcText

public org.w3c.dom.Element funcText(org.w3c.dom.Document doc,
                                    java.lang.String id,
                                    double x,
                                    double y,
                                    java.lang.String text,
                                    java.lang.String style)
function create the SVG element text --> Hello World!

Parameters:
doc - svg document
x - start x-axis coordinate for text
y - y-axis coordinate for the text
text -
style -
Returns:

funcText

public org.w3c.dom.Element funcText(org.w3c.dom.Document doc,
                                    double x,
                                    double y,
                                    java.lang.String text,
                                    java.lang.String style)
function create the SVG element text --> Hello World!

Parameters:
doc - svg document
x - start x-axis coordinate for text
y - y-axis coordinate for the text
text -
style -
Returns:

funcAddAttribute

public org.w3c.dom.Document funcAddAttribute(org.w3c.dom.Document doc,
                                             java.lang.String id,
                                             java.lang.String attribute,
                                             java.lang.String attributeValue)

rotation

public java.lang.String rotation(double x,
                                 double y,
                                 java.lang.String angle)


Copyright © 2012. All Rights Reserved.