public class SimpleSVGMaker extends Object
Constructor and Description |
---|
SimpleSVGMaker(StringBuilder buf) |
Modifier and Type | Method and Description |
---|---|
String |
defineClipPath(Rectangle clip)
Define clip path
|
void |
drawCircle(int x,
int y,
int radius,
Color border,
Color fill,
BasicStroke stroke,
String clipid,
Map<Object,Object> hints)
Draw circle centered on x,y with a radius given
|
void |
drawLine(int x1,
int y1,
int x2,
int y2,
Color color,
BasicStroke stroke,
String clipid,
Map<Object,Object> hints)
Draw line
|
void |
drawPolyline(int[] x,
int[] y,
int sz,
Color color,
BasicStroke stroke,
String clipid,
Map<Object,Object> hints)
Draw polyline
|
void |
drawRect(int x,
int y,
int width,
int height,
Color border,
Color fill,
BasicStroke stroke,
String clipid,
Map<Object,Object> hints)
Draw rect
|
void |
drawSquare(int x,
int y,
int sz,
Color border,
Color fill,
BasicStroke stroke,
String clipid,
Map<Object,Object> hints)
Draw square centered on x,y with a width/height given
|
void |
drawText(String text,
int x,
int y,
Color color,
Font font,
String clipid,
Map<Object,Object> hints)
Draw text
|
void |
endGroup()
End group
|
void |
endSVG()
End svg tag
|
void |
fillPolygon(int[] x,
int[] y,
int sz,
Color color,
String clipid,
Map<Object,Object> hints)
Fill polygon
|
void |
startGroup(String id,
String clz,
String att,
String val)
Start group
|
void |
startSVG(int width,
int height,
Color bgcolor,
String id,
String clz)
Start svg tag
|
public SimpleSVGMaker(StringBuilder buf)
public void startSVG(int width, int height, Color bgcolor, String id, String clz)
bgcolor
- null for noneid
- CSS id or null for noneclz
- CSS class or null for nonepublic void endSVG()
public void startGroup(String id, String clz, String att, String val)
id
- CSS id or null for noneclz
- CSS class or null for noneatt
- an attribute to add att=val, e.g. "transform", or null for noneval
- an attribute to add att=val, or null for nonepublic void endGroup()
public String defineClipPath(Rectangle clip)
public void drawCircle(int x, int y, int radius, Color border, Color fill, BasicStroke stroke, String clipid, Map<Object,Object> hints)
border
- null for nonefill
- null for noneclipid
- as returned from defineClipID() or null for nonehints
- non-nullpublic void drawSquare(int x, int y, int sz, Color border, Color fill, BasicStroke stroke, String clipid, Map<Object,Object> hints)
border
- null for nonefill
- null for noneclipid
- as returned from defineClipID() or null for nonehints
- non-nullpublic void drawRect(int x, int y, int width, int height, Color border, Color fill, BasicStroke stroke, String clipid, Map<Object,Object> hints)
border
- null for nonefill
- null for nonehints
- non-nullpublic void drawLine(int x1, int y1, int x2, int y2, Color color, BasicStroke stroke, String clipid, Map<Object,Object> hints)
color
- null to let CSS do itclipid
- as returned from defineClipID() or null for nonehints
- non-nullpublic void drawPolyline(int[] x, int[] y, int sz, Color color, BasicStroke stroke, String clipid, Map<Object,Object> hints)
color
- null to let CSS do itclipid
- as returned from defineClipID() or null for nonehints
- non-nullpublic void fillPolygon(int[] x, int[] y, int sz, Color color, String clipid, Map<Object,Object> hints)
color
- null to let CSS do itclipid
- as returned from defineClipID() or null for nonehints
- non-null