public class SvgFunction extends Object
Constructor and Description |
---|
SvgFunction() |
Modifier and Type | Method and Description |
---|---|
Document |
funcAddAttribute(Document doc,
String id,
String attribute,
String attributeValue) |
Element |
funcCircle(Document doc,
double cx,
double cy,
double r,
String style)
function create the SVG element circle
|
Element |
funcEllipse(Document doc,
double cx,
double cy,
double rx,
double ry,
String style)
function create the SVG element ellipse
|
Element |
funcLine(Document doc,
double x1,
double x2,
double y1,
double y2,
double rx,
double ry,
String style)
function create the SVG element line
|
Element |
funcLine(Document doc,
double x1,
double x2,
double y1,
double y2,
String style)
function create the SVG element line
|
Element |
funcPath(Document doc,
String d,
double pathLength,
String style)
function create the SVG elment path
|
Element |
funcPolygon(Document doc,
String points,
String style)
function create the SVG element polygone
|
Element |
funcText(Document doc,
double x,
double y,
String text,
String style)
function create the SVG element text
|
Element |
funcText(Document doc,
String id,
double x,
double y,
String text,
String style)
function create the SVG element text
|
String |
rotation(double x,
double y,
String angle) |
public Element funcLine(Document doc, double x1, double x2, double y1, double y2, double rx, double ry, String style)
doc
- svg documentx1
- x-axis coordinate of the start of the linex2
- x-axis coordinate of the end of the liney1
- y-axis coordinate of the start of the liney2
- y-axis coordinate of the end of the linerx
- ry
- style
- style for the line NOTE: 'line' elements are never filledpublic Element funcLine(Document doc, double x1, double x2, double y1, double y2, String style)
doc
- documentx1
- x-axis coordinate of the start of the linex2
- x-axis coordinate of the end of the liney1
- y-axis coordinate of the start of the liney2
- y-axis coordinate of the end of the linestyle
- style for the line NOTE: 'line' elements are never filledpublic Element funcRect(Document doc, double x, double y, double width, double height, double rx, double ry, String style)
doc
- svg documentx
- x-axis coordinate of the rectangley
- y-axis coordinate of the rectanglewidth
- width of the rectangleheight
- height of the rectanglerx
- rounded rectangles (x-axis radius of ellipse used to round off
corners of rectangle) NOTE: negative value is an errorry
- rounded rectangles (y-axis radius of ellipse used to round off
corners of rectangle) NOTE: negative value is an errorstyle
- public Element funcCircle(Document doc, double cx, double cy, double r, String style)
doc
- svg documentcx
- x-axis coordinate of the center of the circlecy
- y-axis coordinate of the center of the circler
- radius of the circle NOTE: negative value is an errorstyle
- public Element funcEllipse(Document doc, double cx, double cy, double rx, double ry, String style)
doc
- svg documentcx
- x-axis coordinate of the center of the ellipsecy
- y-axis coordinate of the center of the ellipserx
- x-axis radius of the ellipse NOTE: negative value is an errorry
- y-axis radius of the ellipse NOTE: negative value is an errorstyle
- public Element funcPolyline(Document doc, String points, String style)
doc
- svg documentpoints
- points that make up the polylinestyle
- public Element funcPolygon(Document doc, String points, String style)
doc
- svg documentpoints
- points that make up the polygonstyle
- public Element funcPath(Document doc, String d, double pathLength, String style)
doc
- svg documentd
- 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-20021231pathLength
- the total length of the path NOTE: negative value is an errorstyle
- public Element funcText(Document doc, String id, double x, double y, String text, String style)
doc
- svg documentx
- start x-axis coordinate for texty
- y-axis coordinate for the texttext
- style
- public Element funcText(Document doc, double x, double y, String text, String style)
doc
- svg documentx
- start x-axis coordinate for texty
- y-axis coordinate for the texttext
- style
- public Document funcAddAttribute(Document doc, String id, String attribute, String attributeValue)
Copyright © 2013. All Rights Reserved.