Modifier and Type | Field and Description |
---|---|
protected static String |
CLASS |
protected ComponentLibrary |
componentLibrary |
protected static String |
FONT_FAMILY |
protected static int |
FONT_SIZE |
protected static int |
FONT_VOLTAGE_LEVEL_LABEL_SIZE |
protected static double |
LABEL_OFFSET |
protected LayoutParameters |
layoutParameters |
protected static org.slf4j.Logger |
LOGGER |
protected static String |
MIDDLE |
protected static String |
POINTS |
protected static String |
POLYLINE |
protected static String |
ROTATE |
protected static String |
TEXT_ANCHOR |
protected static String |
TRANSFORM |
protected static String |
TRANSLATE |
protected static int |
VALUE_MAX_NB_CHARS |
Constructor and Description |
---|
DefaultSVGWriter(ComponentLibrary componentLibrary,
LayoutParameters layoutParameters) |
Modifier and Type | Method and Description |
---|---|
protected void |
addStyle(Document document,
DiagramStyleProvider styleProvider,
DiagramLabelProvider labelProvider,
List<Graph> graphs,
Set<String> listUsedComponentSVG) |
protected boolean |
canInsertComponentSVG(Node node) |
protected void |
createDefsSVGComponents(Document document,
Set<String> listUsedComponentSVG)
Creation of the defs area for the SVG components
|
protected Element |
drawBus(BusNode node,
Element g) |
protected void |
drawEdges(String prefixId,
Element root,
Graph graph,
List<Edge> edges,
GraphMetadata metadata,
AnchorPointProvider anchorPointProvider,
DiagramLabelProvider initProvider,
DiagramStyleProvider styleProvider) |
protected void |
drawGraphLabel(String prefixId,
Element root,
Graph graph,
GraphMetadata metadata) |
protected Element |
drawGrid(String prefixId,
Graph graph,
Document document,
GraphMetadata metadata) |
protected Element |
drawGridHorizontalLine(Document document,
Graph graph,
int maxH,
double y) |
protected Element |
drawGridLine(Document document,
double x1,
double y1,
double x2,
double y2) |
protected Element |
drawGridVerticalLine(Document document,
Graph graph,
int maxV,
double x) |
protected void |
drawLabel(String idLabel,
String str,
boolean rotated,
double xShift,
double yShift,
Element g,
int fontSize,
boolean centered,
int shiftAngle,
boolean adjustLength) |
protected void |
drawMultiTerminalNodes(String prefixId,
Element root,
SubstationGraph graph,
GraphMetadata metadata,
DiagramStyleProvider styleProvider,
AnchorPointProvider anchorPointProvider) |
protected void |
drawNodeDecorators(String prefixId,
Element g,
Node node,
DiagramLabelProvider labelProvider,
DiagramStyleProvider styleProvider) |
protected void |
drawNodeLabel(String prefixId,
Element g,
Node node,
DiagramLabelProvider labelProvider) |
protected void |
drawNodes(String prefixId,
Element root,
Graph graph,
GraphMetadata metadata,
AnchorPointProvider anchorPointProvider,
DiagramLabelProvider initProvider,
DiagramStyleProvider styleProvider,
List<Node> nodes) |
protected void |
drawSnakeLines(String prefixId,
Element root,
SubstationGraph graph,
GraphMetadata metadata,
DiagramStyleProvider styleProvider,
AnchorPointProvider anchorPointProvider) |
protected void |
drawSubstation(String prefixId,
SubstationGraph graph,
Element root,
GraphMetadata metadata,
DiagramLabelProvider initProvider,
DiagramStyleProvider styleProvider) |
protected void |
drawVoltageLevel(String prefixId,
Graph graph,
Element root,
GraphMetadata metadata,
DiagramLabelProvider initProvider,
DiagramStyleProvider styleProvider) |
ComponentLibrary |
getComponentLibrary() |
LayoutParameters |
getLayoutParameters() |
protected void |
incorporateComponents(String prefixId,
Node node,
Element g,
DiagramStyleProvider styleProvider) |
protected void |
insertArrowsAndLabels(String prefixId,
String wireId,
List<Double> points,
Element root,
Node n,
GraphMetadata metadata,
DiagramLabelProvider initProvider,
DiagramStyleProvider styleProvider) |
protected void |
insertArrowSVGIntoDocumentSVG(String prefixId,
Element g,
double angle,
ComponentSize componentSize,
String componentDefsId) |
protected void |
insertComponentSVGIntoDocumentSVG(String prefixId,
String componentType,
Element g,
Node node,
DiagramStyleProvider styleProvider,
String componentDefsId) |
protected void |
insertDecoratorSVGIntoDocumentSVG(String prefixId,
DiagramLabelProvider.NodeDecorator nodeDecorator,
Element g,
Node node,
DiagramStyleProvider styleProvider) |
protected void |
insertSVGComponentIntoDefsArea(Element group,
Map<String,org.apache.batik.anim.dom.SVGOMDocument> subComponents) |
protected void |
insertSVGIntoDocumentSVG(String componentType,
Element g,
String componentDefsId,
BiConsumer<Element,String> elementAttributesSetter) |
protected String |
pointsListToString(List<Double> pol) |
protected void |
setMetadata(GraphMetadata metadata,
Node node,
String nodeId,
Graph graph,
BusCell.Direction direction,
AnchorPointProvider anchorPointProvider) |
protected void |
transformArrow(List<Double> points,
ComponentSize componentSize,
double shift,
Element g) |
protected void |
transformComponent(Node node,
Element g) |
protected void |
transformDocument(Document document,
Writer writer) |
GraphMetadata |
write(String prefixId,
Graph graph,
DiagramLabelProvider initProvider,
DiagramStyleProvider styleProvider,
Path svgFile)
Create the SVGDocument corresponding to the graph
|
GraphMetadata |
write(String prefixId,
Graph graph,
DiagramLabelProvider labelProvider,
DiagramStyleProvider styleProvider,
Writer writer)
Create the SVGDocument corresponding to the graph
|
GraphMetadata |
write(String prefixId,
SubstationGraph graph,
DiagramLabelProvider initProvider,
DiagramStyleProvider styleProvider,
Path svgFile)
Create the SVGDocument corresponding to the substation graph
|
GraphMetadata |
write(String prefixId,
SubstationGraph graph,
DiagramLabelProvider labelProvider,
DiagramStyleProvider styleProvider,
Writer writer)
Create the SVGDocument corresponding to the substation graph
|
GraphMetadata |
write(String prefixId,
ZoneGraph graph,
DiagramLabelProvider initProvider,
DiagramStyleProvider styleProvider,
Path svgFile) |
GraphMetadata |
write(String prefixId,
ZoneGraph graph,
DiagramLabelProvider labelProvider,
DiagramStyleProvider styleProvider,
Writer writer) |
protected GraphMetadata |
writeGraph(String prefixId,
Graph graph,
Document document,
DiagramLabelProvider initProvider,
DiagramStyleProvider styleProvider)
Create the SVGDocument corresponding to the graph
|
protected GraphMetadata |
writeGraph(String prefixId,
SubstationGraph graph,
Document document,
DiagramLabelProvider initProvider,
DiagramStyleProvider styleProvider)
Create the SVGDocument corresponding to the substation graph
|
protected static final org.slf4j.Logger LOGGER
protected static final String CLASS
protected static final String TRANSFORM
protected static final String TRANSLATE
protected static final String ROTATE
protected static final int FONT_SIZE
protected static final String FONT_FAMILY
protected static final double LABEL_OFFSET
protected static final int FONT_VOLTAGE_LEVEL_LABEL_SIZE
protected static final String POLYLINE
protected static final String POINTS
protected static final String TEXT_ANCHOR
protected static final String MIDDLE
protected static final int VALUE_MAX_NB_CHARS
protected final ComponentLibrary componentLibrary
protected final LayoutParameters layoutParameters
public DefaultSVGWriter(ComponentLibrary componentLibrary, LayoutParameters layoutParameters)
public GraphMetadata write(String prefixId, Graph graph, DiagramLabelProvider initProvider, DiagramStyleProvider styleProvider, Path svgFile)
public GraphMetadata write(String prefixId, Graph graph, DiagramLabelProvider labelProvider, DiagramStyleProvider styleProvider, Writer writer)
protected void addStyle(Document document, DiagramStyleProvider styleProvider, DiagramLabelProvider labelProvider, List<Graph> graphs, Set<String> listUsedComponentSVG)
protected GraphMetadata writeGraph(String prefixId, Graph graph, Document document, DiagramLabelProvider initProvider, DiagramStyleProvider styleProvider)
protected void drawVoltageLevel(String prefixId, Graph graph, Element root, GraphMetadata metadata, DiagramLabelProvider initProvider, DiagramStyleProvider styleProvider)
public GraphMetadata write(String prefixId, SubstationGraph graph, DiagramLabelProvider initProvider, DiagramStyleProvider styleProvider, Path svgFile)
public GraphMetadata write(String prefixId, SubstationGraph graph, DiagramLabelProvider labelProvider, DiagramStyleProvider styleProvider, Writer writer)
public LayoutParameters getLayoutParameters()
getLayoutParameters
in interface SVGWriter
public ComponentLibrary getComponentLibrary()
getComponentLibrary
in interface SVGWriter
protected GraphMetadata writeGraph(String prefixId, SubstationGraph graph, Document document, DiagramLabelProvider initProvider, DiagramStyleProvider styleProvider)
protected void drawSubstation(String prefixId, SubstationGraph graph, Element root, GraphMetadata metadata, DiagramLabelProvider initProvider, DiagramStyleProvider styleProvider)
protected Element drawGrid(String prefixId, Graph graph, Document document, GraphMetadata metadata)
protected Element drawGridHorizontalLine(Document document, Graph graph, int maxH, double y)
protected Element drawGridVerticalLine(Document document, Graph graph, int maxV, double x)
protected Element drawGridLine(Document document, double x1, double y1, double x2, double y2)
protected void drawNodes(String prefixId, Element root, Graph graph, GraphMetadata metadata, AnchorPointProvider anchorPointProvider, DiagramLabelProvider initProvider, DiagramStyleProvider styleProvider, List<Node> nodes)
protected void setMetadata(GraphMetadata metadata, Node node, String nodeId, Graph graph, BusCell.Direction direction, AnchorPointProvider anchorPointProvider)
protected void drawNodeLabel(String prefixId, Element g, Node node, DiagramLabelProvider labelProvider)
protected void drawNodeDecorators(String prefixId, Element g, Node node, DiagramLabelProvider labelProvider, DiagramStyleProvider styleProvider)
protected void drawGraphLabel(String prefixId, Element root, Graph graph, GraphMetadata metadata)
protected void drawLabel(String idLabel, String str, boolean rotated, double xShift, double yShift, Element g, int fontSize, boolean centered, int shiftAngle, boolean adjustLength)
protected boolean canInsertComponentSVG(Node node)
protected void incorporateComponents(String prefixId, Node node, Element g, DiagramStyleProvider styleProvider)
protected void insertComponentSVGIntoDocumentSVG(String prefixId, String componentType, Element g, Node node, DiagramStyleProvider styleProvider, String componentDefsId)
protected void insertArrowSVGIntoDocumentSVG(String prefixId, Element g, double angle, ComponentSize componentSize, String componentDefsId)
protected void insertDecoratorSVGIntoDocumentSVG(String prefixId, DiagramLabelProvider.NodeDecorator nodeDecorator, Element g, Node node, DiagramStyleProvider styleProvider)
protected void insertSVGIntoDocumentSVG(String componentType, Element g, String componentDefsId, BiConsumer<Element,String> elementAttributesSetter)
protected void transformArrow(List<Double> points, ComponentSize componentSize, double shift, Element g)
protected void insertArrowsAndLabels(String prefixId, String wireId, List<Double> points, Element root, Node n, GraphMetadata metadata, DiagramLabelProvider initProvider, DiagramStyleProvider styleProvider)
protected void drawEdges(String prefixId, Element root, Graph graph, List<Edge> edges, GraphMetadata metadata, AnchorPointProvider anchorPointProvider, DiagramLabelProvider initProvider, DiagramStyleProvider styleProvider)
protected void drawSnakeLines(String prefixId, Element root, SubstationGraph graph, GraphMetadata metadata, DiagramStyleProvider styleProvider, AnchorPointProvider anchorPointProvider)
protected void createDefsSVGComponents(Document document, Set<String> listUsedComponentSVG)
protected void insertSVGComponentIntoDefsArea(Element group, Map<String,org.apache.batik.anim.dom.SVGOMDocument> subComponents)
public GraphMetadata write(String prefixId, ZoneGraph graph, DiagramLabelProvider initProvider, DiagramStyleProvider styleProvider, Path svgFile)
public GraphMetadata write(String prefixId, ZoneGraph graph, DiagramLabelProvider labelProvider, DiagramStyleProvider styleProvider, Writer writer)
protected void drawMultiTerminalNodes(String prefixId, Element root, SubstationGraph graph, GraphMetadata metadata, DiagramStyleProvider styleProvider, AnchorPointProvider anchorPointProvider)
Copyright © 2020. All rights reserved.