|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.visualization.svg.SVGPath
public class SVGPath
Element used for building an SVG path using a string buffer.
Field Summary | |
---|---|
private StringBuffer |
buf
String buffer for building the path. |
private String |
lastaction
The last action we did, to not add unnecessary commands |
static String |
PATH_CUBIC_TO_RELATIVE
The lower case version (relative) cubic line to command. |
static String |
PATH_HORIZONTAL_LINE_TO_RELATIVE
The lower case version (relative) horizontal line to command. |
static String |
PATH_LINE_TO_RELATIVE
The lower case version (relative) line to command. |
static String |
PATH_MOVE_RELATIVE
The lower case version (relative) move command. |
static String |
PATH_QUAD_TO_RELATIVE
The lower case version (relative) quadratic interpolation to command. |
static String |
PATH_SMOOTH_CUBIC_TO
The absolute "smooth cubic to" SVG path command (missing from SVGConstants). |
static String |
PATH_SMOOTH_CUBIC_TO_RELATIVE
The lower case version (relative) smooth cubic to command. |
static String |
PATH_SMOOTH_QUAD_TO_RELATIVE
The lower case version (relative) smooth quadratic interpolation to command. |
static String |
PATH_VERTICAL_LINE_TO_RELATIVE
The lower case version (relative) vertical line to command. |
Constructor Summary | |
---|---|
SVGPath()
Empty path constructor. |
|
SVGPath(double x,
double y)
Constructor with initial point. |
Method Summary | |
---|---|
private void |
append(String action,
double... ds)
Append an action to the current path. |
SVGPath |
close()
Close the path. |
SVGPath |
cubicTo(double c1x,
double c1y,
double c2x,
double c2y,
double x,
double y)
Cubic Bezier line to the given coordinates. |
SVGPath |
drawTo(double x,
double y)
Draw a line given a series of coordinates. |
SVGPath |
horizontalLineTo(double x)
Draw a horizontal line to the given x coordinate. |
SVGPath |
lineTo(double x,
double y)
Draw a line to the given coordinates. |
Element |
makeElement(Document document)
Turn the path buffer into an SVG element. |
Element |
makeElement(SVGPlot plot)
Turn the path buffer into an SVG element. |
SVGPath |
moveTo(double x,
double y)
Move to the given coordinates. |
SVGPath |
quadTo(double c1x,
double c1y,
double x,
double y)
Quadratic Bezier line to the given coordinates. |
SVGPath |
relativeCubicTo(double c1x,
double c1y,
double c2x,
double c2y,
double x,
double y)
Cubic Bezier line to the given relative coordinates. |
SVGPath |
relativeHorizontalLineTo(double x)
Draw a horizontal line to the given relative x coordinate. |
SVGPath |
relativeLineTo(double x,
double y)
Draw a line to the given relative coordinates. |
SVGPath |
relativeMoveTo(double x,
double y)
Move to the given relative coordinates. |
SVGPath |
relativeQuadTo(double c1x,
double c1y,
double x,
double y)
Quadratic Bezier line to the given relative coordinates. |
SVGPath |
relativeSmoothCubicTo(double c2x,
double c2y,
double x,
double y)
Smooth Cubic Bezier line to the given relative coordinates. |
SVGPath |
relativeSmoothQuadTo(double x,
double y)
Smooth quadratic Bezier line to the given relative coordinates. |
SVGPath |
relativeVerticalLineTo(double y)
Draw a vertical line to the given relative y coordinate. |
SVGPath |
smoothCubicTo(double c2x,
double c2y,
double x,
double y)
Smooth Cubic Bezier line to the given coordinates. |
SVGPath |
smoothQuadTo(double x,
double y)
Smooth quadratic Bezier line to the given coordinates. |
String |
toString()
Return the SVG serialization of the path. |
SVGPath |
verticalLineTo(double y)
Draw a vertical line to the given y coordinate. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private StringBuffer buf
private String lastaction
public static final String PATH_SMOOTH_CUBIC_TO
public static final String PATH_LINE_TO_RELATIVE
public static final String PATH_MOVE_RELATIVE
public static final String PATH_HORIZONTAL_LINE_TO_RELATIVE
public static final String PATH_VERTICAL_LINE_TO_RELATIVE
public static final String PATH_CUBIC_TO_RELATIVE
public static final String PATH_SMOOTH_CUBIC_TO_RELATIVE
public static final String PATH_QUAD_TO_RELATIVE
public static final String PATH_SMOOTH_QUAD_TO_RELATIVE
Constructor Detail |
---|
public SVGPath()
public SVGPath(double x, double y)
x
- initial coordinatesy
- initial coordinatesMethod Detail |
---|
public SVGPath drawTo(double x, double y)
x
- new coordinatesy
- new coordinates
public SVGPath lineTo(double x, double y)
x
- new coordinatesy
- new coordinates
public SVGPath relativeLineTo(double x, double y)
x
- relative coordinatesy
- relative coordinates
public SVGPath horizontalLineTo(double x)
x
- new coordinates
public SVGPath relativeHorizontalLineTo(double x)
x
- new coordinates
public SVGPath verticalLineTo(double y)
y
- new coordinate
public SVGPath relativeVerticalLineTo(double y)
y
- new coordinate
public SVGPath moveTo(double x, double y)
x
- new coordinatesy
- new coordinates
public SVGPath relativeMoveTo(double x, double y)
x
- new coordinatesy
- new coordinates
public SVGPath cubicTo(double c1x, double c1y, double c2x, double c2y, double x, double y)
c1x
- first control point xc1y
- first control point yc2x
- second control point xc2y
- second control point yx
- new coordinatesy
- new coordinates
public SVGPath relativeCubicTo(double c1x, double c1y, double c2x, double c2y, double x, double y)
c1x
- first control point xc1y
- first control point yc2x
- second control point xc2y
- second control point yx
- new coordinatesy
- new coordinates
public SVGPath smoothCubicTo(double c2x, double c2y, double x, double y)
c2x
- second control point xc2y
- second control point yx
- new coordinatesy
- new coordinates
public SVGPath relativeSmoothCubicTo(double c2x, double c2y, double x, double y)
c2x
- second control point xc2y
- second control point yx
- new coordinatesy
- new coordinates
public SVGPath quadTo(double c1x, double c1y, double x, double y)
c1x
- first control point xc1y
- first control point yx
- new coordinatesy
- new coordinates
public SVGPath relativeQuadTo(double c1x, double c1y, double x, double y)
c1x
- first control point xc1y
- first control point yx
- new coordinatesy
- new coordinates
public SVGPath smoothQuadTo(double x, double y)
x
- new coordinatesy
- new coordinates
public SVGPath relativeSmoothQuadTo(double x, double y)
x
- new coordinatesy
- new coordinates
private void append(String action, double... ds)
action
- Current actionds
- coordinates.public SVGPath close()
public Element makeElement(Document document)
document
- Document context (= element factory)
public Element makeElement(SVGPlot plot)
plot
- Plot context (= element factory)
public String toString()
toString
in class Object
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |