From 560f72110d9709c01652e917fdeb0bed7a8d8786 Mon Sep 17 00:00:00 2001 From: Bjorn Pijnacker Date: Sat, 27 Feb 2021 20:02:38 +0100 Subject: [PATCH] parented dialogs in AutoPositionAction to the DiagramPanel This ensures they spawn at the center of the panel and not centered on the computer's primary display --- .../erme/control/actions/AutoPositionAction.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/nl/andrewlalis/erme/control/actions/AutoPositionAction.java b/src/main/java/nl/andrewlalis/erme/control/actions/AutoPositionAction.java index 37165a6..cfe5d56 100644 --- a/src/main/java/nl/andrewlalis/erme/control/actions/AutoPositionAction.java +++ b/src/main/java/nl/andrewlalis/erme/control/actions/AutoPositionAction.java @@ -41,7 +41,7 @@ public class AutoPositionAction extends AbstractAction { public void actionPerformed(ActionEvent actionEvent) { if (model.getRelations().size() == 0) { JOptionPane.showMessageDialog( - null, + this.diagramPanel, "Cannot position all relations when there are no relations present", "Relations Required", JOptionPane.WARNING_MESSAGE @@ -50,7 +50,7 @@ public class AutoPositionAction extends AbstractAction { } String[] choices = new String[]{"Alphabeticaly", "Custom Order"}; String choice = (String) JOptionPane.showInputDialog( - null, + this.diagramPanel, "Select how to sort the relations", "Position Relations", JOptionPane.PLAIN_MESSAGE, @@ -62,7 +62,7 @@ public class AutoPositionAction extends AbstractAction { positionRelations(getAlphabeticRelationList()); } else if (choice.equals(choices[1])) { JOptionPane.showConfirmDialog( - null, + this.diagramPanel, OrderableListPanel.getInstance(), "teststring", JOptionPane.OK_CANCEL_OPTION,