-
Notifications
You must be signed in to change notification settings - Fork 13
Migration guide v1.5.0
The Graph.substitue(node1, node2)
is deprecated (spelling mistake) and Graph.substitute(node1, node2)
should be used instead.
Graph.replace(oldNode, newNode)
is a shortcut for adding and substituting a node in the graph. The line graph.add(newNode)
followed by graph.substitute(oldNode, newNode)
can thus be replaced by graph.replace(oldNode, newNode)
.
At this release, the NodeLabelConfiguration
and DiagramInitialValueProvider
classes have been merged into a class named DiagramLabelProvider
. In previous releases, the labels of a given node were defined in both files:
- the labels themselves, that is the String, through the method
DiagramInitialValueProvider.getNodeLabelValue(node)
, which returned aList<String>
, - the label positions through the method
NodeLabelConfiguration.getLabelsPosition(node)
, which returned aList<LabelPosition>
.
Starting from this release, the label is defined only through the method DiagramLabelProvider.getNodeLabels(node)
, which should return a List<NodeLabel>
. The NodeLabel class is the POJO containing the label String
and label position LabelPosition
.
The DiagramLabelProvider contains the following methods:
-
InitialValue getInitialValue(node)
, which was before inDiagramInitialValueProvider
, -
List<NodeLabel> getNodeLabels(node)
, which concatenates the previous methodsDiagramInitialValueProvider.getNodeLabelValue(node)
andNodeLabelConfiguration.getLabelsPosition(node)
, -
List<NodeDecorator> getNodeDecorators(node)
, which adds the node decorator feature.
As a consequence, all the SVGWriter.write()
methods
- do not expect the
NodeLabelConfiguration
parameter, - expect a
DiagramLabelProvider
parameter instead of theDiagramInitialValueProvider
parameter.
For instance:
-
SVGWriter.write(prefixId, graph, initProvider, styleProvider, nodeLabelConfiguration, svgPath)
becomesSVGWriter.write(prefixId, graph, labelProvider, styleProvider, svgPath)
-
SVGWriter.write(prefixId, substationGraph, initProvider, styleProvider, nodeLabelConfiguration, svgPath)
becomesSVGWriter.write(prefixId, substationGraph, labelProvider, styleProvider, svgPath)