From 1ea8ed0bd814319f79162e884641071c80f70e38 Mon Sep 17 00:00:00 2001 From: Yevgeny Kazakov Date: Wed, 12 Jun 2024 13:06:45 +0200 Subject: [PATCH] Update owl tree nodes if rendering of equivalent entities has changed 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: https://github.com/protegeproject/protege/issues/910#issuecomment-2162709234 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. --- .../protege/editor/owl/ui/tree/OWLModelManagerTree.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/protege-editor-owl/src/main/java/org/protege/editor/owl/ui/tree/OWLModelManagerTree.java b/protege-editor-owl/src/main/java/org/protege/editor/owl/ui/tree/OWLModelManagerTree.java index ac31b018e..e297e6108 100644 --- a/protege-editor-owl/src/main/java/org/protege/editor/owl/ui/tree/OWLModelManagerTree.java +++ b/protege-editor-owl/src/main/java/org/protege/editor/owl/ui/tree/OWLModelManagerTree.java @@ -125,7 +125,12 @@ private void handleRenderingChanged(OWLEntity entity) { try { for (OWLObjectTreeNode node : getNodes(entity)) { DefaultTreeModel model = (DefaultTreeModel) getModel(); - model.nodeStructureChanged(node); + model.nodeChanged(node); + for (N equivalentEntity: node.getEquivalentObjects()) { + for (OWLObjectTreeNode equivalentNode : getNodes(equivalentEntity)) { + model.nodeChanged(equivalentNode); + } + } } } catch (ClassCastException e) {