Package org.gephi.preview.api
Interface SVGTarget
-
- All Superinterfaces:
RenderTarget
public interface SVGTarget extends RenderTarget
Rendering target to SVG format.This target is used by renderers objects to render a graph to a SVG DOM and uses the Batik library to transcode the SVG DOM in a SVG document.
To allow further document further manipulation the DOM is organized with top elements. Top elements are
nodes,edges,node-labels,edge-labelsandarrowsand are elements to append items to. For instance when a node label element is created it should be appended to thenode-labelelement instead of directly to the root. Use thegetTopElement()method to retrieve or create top elements.- Author:
- Mathieu Bastian
-
-
Field Summary
Fields Modifier and Type Field Description static StringSCALE_STROKESSVGBooleanproperty whether to rescale stroke's width/thickness.static StringTOP_ARROWSDefault top element name for arrowsstatic StringTOP_EDGE_LABELSDefault top element name for edge labelsstatic StringTOP_EDGE_LABELS_OUTLINEDefault top element name for edge labels outlinestatic StringTOP_EDGESDefault top element name for edgesstatic StringTOP_NODE_LABELSDefault top element name for node labelsstatic StringTOP_NODE_LABELS_OUTLINEDefault top element name for node labels outlinestatic StringTOP_NODESDefault top element name for nodes-
Fields inherited from interface org.gephi.preview.api.RenderTarget
G2D_TARGET, PDF_TARGET, SVG_TARGET
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ElementcreateElement(String qualifiedName)Create a new elementqualifiedNamein the document.TextcreateTextNode(String data)Create a new text node withdatain it.DocumentgetDocument()Returns the SVG documentfloatgetScaleRatio()WhenSCALE_STROKESproperty istruereturns the scale ratio to scale strokes with.ElementgetTopElement(String name)Returns the top elementnamein the document.StringtoHexString(Color color)Returnscolorin the hex format (e.g.
-
-
-
Field Detail
-
SCALE_STROKES
static final String SCALE_STROKES
SVGBooleanproperty whether to rescale stroke's width/thickness.- See Also:
- Constant Field Values
-
TOP_NODES
static final String TOP_NODES
Default top element name for nodes- See Also:
- Constant Field Values
-
TOP_EDGES
static final String TOP_EDGES
Default top element name for edges- See Also:
- Constant Field Values
-
TOP_NODE_LABELS
static final String TOP_NODE_LABELS
Default top element name for node labels- See Also:
- Constant Field Values
-
TOP_NODE_LABELS_OUTLINE
static final String TOP_NODE_LABELS_OUTLINE
Default top element name for node labels outline- See Also:
- Constant Field Values
-
TOP_EDGE_LABELS
static final String TOP_EDGE_LABELS
Default top element name for edge labels- See Also:
- Constant Field Values
-
TOP_EDGE_LABELS_OUTLINE
static final String TOP_EDGE_LABELS_OUTLINE
Default top element name for edge labels outline- See Also:
- Constant Field Values
-
TOP_ARROWS
static final String TOP_ARROWS
Default top element name for arrows- See Also:
- Constant Field Values
-
-
Method Detail
-
createElement
Element createElement(String qualifiedName)
Create a new elementqualifiedNamein the document.- Parameters:
qualifiedName- the name of the element- Returns:
- the newly created element
-
createTextNode
Text createTextNode(String data)
Create a new text node withdatain it.- Parameters:
data- the text data- Returns:
- the newly created text node
-
getTopElement
Element getTopElement(String name)
Returns the top elementnamein the document. Top elements are direct children of the root node and help to organize the SVG document (e.g. all edges in the same parent DOM node). Create the top element if it missing.- Parameters:
name- the top element name to lookup- Returns:
- the top element
-
getDocument
Document getDocument()
Returns the SVG document- Returns:
- the SVG document
-
getScaleRatio
float getScaleRatio()
WhenSCALE_STROKESproperty istruereturns the scale ratio to scale strokes with.- Returns:
- the current scale ratio
-
-