com.jgraph.io.svg
public class SVGGraphWriter extends Object
Field Summary | |
---|---|
protected SVGEdgeWriter | edgeFactory
Holds the object that creates the SVG code for edges. |
static double | FONT_PROPORTION_FACTOR
The assumes proportion between the font height and the average character
width. |
protected Map | gradients
Holds the gradients created dynamically during the rendering process and
added later to the defs part of the SVG output. |
static Font | TITLE_FONT
Specifies the font used for the title of the diagram. |
static String | TITLE_HEXCOLOR
Specifies the color the diagram title. |
static int | TITLE_VSPACING
Specifies the spacing between the title and the diagram. |
protected SVGVertexWriter | vertexFactory
Holds object that creates the SVG code for vertices. |
protected Rectangle | viewBox
Holds the bounds of the graph. |
Method Summary | |
---|---|
protected Node | createDropShadowFilter(Document document, int fuzziness, int dx, int dy)
This implements the official recommended way of a drop shadow. |
protected Node | createGradient(Document document, String id, String startColor, String endColor)
Creates a new gradient element to be used my multiple cells.
|
protected Node | createNode(Document document, String title, GraphLayoutCache cache, int inset) |
protected Node | createRoot(Document document, double w, double h, int inset)
Creates the root SVG node with the basic information.
|
Node | createShapeNode(Document document, int shapeType, Rectangle2D bounds, double dx, double dy, String hexBackground, String hexGradient, String hexLineColor, float lineWidth, double opacity, boolean dropShadow)
Creates a rect or ellipse element based on the specified values.
|
Node | createTextNode(Document document, String label, String align, Font font, String hexFontColor, int middleX, int y)
Creates a new text element for the specified details.
|
Node | getGradient(Document document, String startColor, String endColor)
Returns or creates a gradient object for the specified colors.
|
Object[] | getLabels(CellView view)
Returns the labels for a graph cell as an object array.
|
void | write(OutputStream out, String title, GraphLayoutCache cache, int inset)
Writes the SVG. |
Parameters: document id startColor endColor
Returns: a node detailing the gradient on a cell element
Parameters: document w h inset
Returns: a SVG node describing the SVG diagram
Parameters: document shapeType bounds dx dy hexBackground hexGradient hexLineColor lineWidth opacity dropShadow
Returns: a node detailing the shape on a vertex element
Parameters: document label align font hexFontColor middleX y
Returns: a node detailing the label on a cell element
Parameters: document startColor endColor
Returns: a node detailing the gradient on a cell element
Parameters: view
Returns: the labels displayed for the specified cell view