|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcckit.renderer.SVGRenderer
Renderer creating Scalable Vector Graphics (SVG) from
GraphicalElements
.
SVG is an XML-based standard for vector graphics as recommended by
W3C.
There is no coordinate transformation of GraphPoints
except that the sign of the y-coordinate is flipped
because in SVG the y-axis points downwards.
The renderer writes the XML elements into a StringBuffer.
An appropriated header and root element has to be written elsewhere
(e.g. by the class SVGPlotter
).
Shapes will be outlined in black if neither a fill color nor a line color
is defined. A zero line thickness is translated into
a stroke width of 10
The Java standard font names Serif, SansSerif, and Monospaced are mapped onto the SVG font families serif, sans-serif, and monospace, respectively. The default font family is sans-serif. The default font color is black and the default font size is 1% of the paper size (as specified in the constructor).
Constructor Summary | |
SVGRenderer()
|
Method Summary | |
void |
finishRendering(GraphicalComposite composite)
Ends renderering of the specified composite. |
SVGRenderer |
init(java.lang.StringBuffer buffer,
int initialIndentLevel,
double paperSize)
Initializes this instance. |
void |
render(Oval oval)
Renders an oval. |
void |
render(Polygon polygon)
Renders a polygon. |
void |
render(Rectangle rectangle)
Renders a rectangle. |
void |
render(Text text)
Renders text. |
void |
startRendering(GraphicalComposite composite)
Starts renderering of the specified composite. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SVGRenderer()
Method Detail |
public SVGRenderer init(java.lang.StringBuffer buffer, int initialIndentLevel, double paperSize)
buffer
- The buffer into which the XML elements are written.initialIndentLevel
- Initial level of indentation. Nested XML
elements are indented.paperSize
- The size of the paper. It is needed to determine
the default font size.
public void startRendering(GraphicalComposite composite)
If composite has
a ClippingShape
a clip-path attribute
is added with an URL which points onto a clipPath element.
The id of this element is of the form pathnumber
where number is an index counting all clip paths
starting at zero. The clip path is defined by a rect element
determined by the bounding box of the clipping shape.
startRendering
in interface GraphicalCompositeRenderer
public void finishRendering(GraphicalComposite composite)
finishRendering
in interface GraphicalCompositeRenderer
public void render(Polygon polygon)
render
in interface PolygonRenderer
public void render(Rectangle rectangle)
render
in interface RectangleRenderer
public void render(Oval oval)
render
in interface OvalRenderer
public void render(Text text)
render
in interface TextRenderer
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |