public class SvgPainter extends Object implements GraphPainter
| Constructor and Description |
|---|
SvgPainter(int height,
int width,
Color background)
Creates a new svg painter,which will build a large string containing an svg file to be
written to file when completed.
|
| Modifier and Type | Method and Description |
|---|---|
void |
drawLine(double x0,
double y0,
double x1,
double y1)
For drawing plain lines.
|
void |
drawPath(Shape s)
For drawing arbitrary shapes, This will fill with the background color if
fill is set to true.
|
void |
drawString(String s,
double x,
double y) |
void |
drawVerticalString(String s,
double x,
double y) |
void |
endGroup() |
void |
fill(Shape s)
Filling an arbitrary shape with the forground color.
|
void |
finish() |
void |
finish(File f) |
Color |
getColor() |
String |
getOutput() |
int |
getStringWidth(String label) |
void |
restoreLineWidth() |
void |
setClip(int x,
int y,
int w,
int h) |
void |
setColor(Color c) |
void |
setDashes(float[] dashes) |
void |
setFill(boolean fill) |
void |
setFont(LGFont font) |
void |
setLineWidth(double d) |
void |
startGroup() |
static String |
svgColorString(Color c) |
public SvgPainter(int height,
int width,
Color background)
height - of output graph in pxwidth - of output graph in pxbackground - background color, primarily used for filling hollow strokes.public void drawPath(Shape s)
drawPath in interface GraphPainters - shape to be drawn.public void setColor(Color c)
setColor in interface GraphPainterpublic void drawLine(double x0,
double y0,
double x1,
double y1)
drawLine in interface GraphPainterx0 - y0 - x1 - y1 - public void fill(Shape s)
fill in interface GraphPainters - public void setClip(int x,
int y,
int w,
int h)
setClip in interface GraphPainterpublic void drawString(String s, double x, double y)
drawString in interface GraphPainterpublic void finish(File f)
public void finish()
public String getOutput()
public Color getColor()
getColor in interface GraphPainterpublic void setLineWidth(double d)
setLineWidth in interface GraphPainterpublic void restoreLineWidth()
restoreLineWidth in interface GraphPainterpublic void setDashes(float[] dashes)
setDashes in interface GraphPainterdashes - length/offest combo's for formatting line dashes. set to null for none.public void setFill(boolean fill)
setFill in interface GraphPainterpublic void startGroup()
startGroup in interface GraphPainterpublic void endGroup()
endGroup in interface GraphPainterpublic void setFont(LGFont font)
setFont in interface GraphPainterpublic int getStringWidth(String label)
getStringWidth in interface GraphPainterpublic void drawVerticalString(String s, double x, double y)
drawVerticalString in interface GraphPainterCopyright © 2017. All rights reserved.