Skip to content

Commit

Permalink
Update owl tree nodes if rendering of equivalent entities has changed
Browse files Browse the repository at this point in the history
Each element of equivalent entities, e.g., resulted from
OWLEquivalentClasses(:A :B) is rendered in the asserted hierarchy as
the list of rendering of all equivalent classes, e.g.:

> A = B
> B = A

When rendering of one of the entities has changed, e.g., due to
editing of rdfs:label, other equivalent entities did not get
automatically updated in the model.
In particular, their rendering in the hierarchy could get
truncated if the label becomes longer.

See: #910 (comment)

This commit notifies the tree model about the changes of every
node for equivalent entities.

Also, use nodeChanged() instead of nodeStructureChanged() because
rendering does not change children or parents of nodes.
  • Loading branch information
ykazakov committed Jun 12, 2024
1 parent a25f9be commit 1ea8ed0
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ private void handleRenderingChanged(OWLEntity entity) {
try {
for (OWLObjectTreeNode<N> node : getNodes(entity)) {
DefaultTreeModel model = (DefaultTreeModel) getModel();
model.nodeStructureChanged(node);
model.nodeChanged(node);
for (N equivalentEntity: node.getEquivalentObjects()) {
for (OWLObjectTreeNode<N> equivalentNode : getNodes(equivalentEntity)) {
model.nodeChanged(equivalentNode);
}
}
}
}
catch (ClassCastException e) {
Expand Down

0 comments on commit 1ea8ed0

Please sign in to comment.