Skip to content

Commit

Permalink
Fix: (of fix!) labels for vertices and edges are now updated during c…
Browse files Browse the repository at this point in the history
…alls to

update() or updateAndWait().
  • Loading branch information
brunomnsilva committed Mar 7, 2020
1 parent d2dac77 commit e7d5f93
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Binary file modified releases/JavaFXSmartGraph-0.9.jar
Binary file not shown.
Binary file modified releases/JavaFXSmartGraph-0.9.zip
Binary file not shown.
17 changes: 12 additions & 5 deletions src/com/brunomnsilva/smartgraph/graphview/SmartGraphPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -677,16 +677,23 @@ private void updateLabels() {
theGraph.vertices().forEach((v) -> {
SmartGraphVertexNode<V> vertexNode = vertexNodes.get(v);
if (vertexNode != null) {
vertexNode.getAttachedLabel().setText(v.toString());
SmartLabel label = vertexNode.getAttachedLabel();
if(label != null) {
label.setText(v.element().toString());
}

}
});

for (Edge<E, V> e : theGraph.edges()) {
theGraph.edges().forEach((e) -> {
SmartGraphEdgeBase edgeNode = edgeNodes.get(e);
if(edgeNode != null) {
edgeNode.getAttachedLabel().setText(e.toString());
if (edgeNode != null) {
SmartLabel label = edgeNode.getAttachedLabel();
if (label != null) {
label.setText(e.element().toString());
}
}
}
});
}

/**
Expand Down

0 comments on commit e7d5f93

Please sign in to comment.