Skip to content

Commit e7d5f93

Browse files
author
brunomnsilva
committed
Fix: (of fix!) labels for vertices and edges are now updated during calls to
update() or updateAndWait().
1 parent d2dac77 commit e7d5f93

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

releases/JavaFXSmartGraph-0.9.jar

48 Bytes
Binary file not shown.

releases/JavaFXSmartGraph-0.9.zip

70 Bytes
Binary file not shown.

src/com/brunomnsilva/smartgraph/graphview/SmartGraphPanel.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -677,16 +677,23 @@ private void updateLabels() {
677677
theGraph.vertices().forEach((v) -> {
678678
SmartGraphVertexNode<V> vertexNode = vertexNodes.get(v);
679679
if (vertexNode != null) {
680-
vertexNode.getAttachedLabel().setText(v.toString());
680+
SmartLabel label = vertexNode.getAttachedLabel();
681+
if(label != null) {
682+
label.setText(v.element().toString());
683+
}
684+
681685
}
682686
});
683687

684-
for (Edge<E, V> e : theGraph.edges()) {
688+
theGraph.edges().forEach((e) -> {
685689
SmartGraphEdgeBase edgeNode = edgeNodes.get(e);
686-
if(edgeNode != null) {
687-
edgeNode.getAttachedLabel().setText(e.toString());
690+
if (edgeNode != null) {
691+
SmartLabel label = edgeNode.getAttachedLabel();
692+
if (label != null) {
693+
label.setText(e.element().toString());
694+
}
688695
}
689-
}
696+
});
690697
}
691698

692699
/**

0 commit comments

Comments
 (0)