From 521ee92c0ac798d2a0d358a5ff645f7e1f048037 Mon Sep 17 00:00:00 2001 From: Bjorn Pijnacker Date: Fri, 26 Feb 2021 21:49:30 +0100 Subject: [PATCH] Implemented a fix for the custom sort not seeing relations after loading a model --- src/main/java/nl/andrewlalis/erme/model/MappingModel.java | 1 - src/main/java/nl/andrewlalis/erme/view/DiagramPanel.java | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/nl/andrewlalis/erme/model/MappingModel.java b/src/main/java/nl/andrewlalis/erme/model/MappingModel.java index 9fc16da..b7763d0 100644 --- a/src/main/java/nl/andrewlalis/erme/model/MappingModel.java +++ b/src/main/java/nl/andrewlalis/erme/model/MappingModel.java @@ -28,7 +28,6 @@ public class MappingModel implements Serializable, Viewable { public MappingModel() { this.relations = new HashSet<>(); this.changeListeners = new HashSet<>(); - this.addChangeListener(OrderableListPanel.getInstance()); } public void addRelation(Relation r) { diff --git a/src/main/java/nl/andrewlalis/erme/view/DiagramPanel.java b/src/main/java/nl/andrewlalis/erme/view/DiagramPanel.java index d2ebd37..49406d6 100644 --- a/src/main/java/nl/andrewlalis/erme/view/DiagramPanel.java +++ b/src/main/java/nl/andrewlalis/erme/view/DiagramPanel.java @@ -64,6 +64,7 @@ public class DiagramPanel extends JPanel implements ModelChangeListener { this.addMouseListener(listener); this.addMouseMotionListener(listener); this.updateActionModels(); + newModel.addChangeListener(OrderableListPanel.getInstance()); this.centerModel(); this.repaint(); }