From 968c3bcde941e502fcf7d497343600f4f58f6c9a Mon Sep 17 00:00:00 2001 From: kiramt Date: Tue, 16 May 2017 16:10:07 +0100 Subject: [PATCH] JAL-2536 Overview window sizing not subject to min size restrictions --- src/jalview/gui/AlignFrame.java | 2 +- src/jalview/gui/Desktop.java | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 4073e3e..cd61edb 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -3280,7 +3280,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, frame.setContentPane(overview); Desktop.addInternalFrame(frame, MessageManager.formatMessage( "label.overview_params", new Object[] { this.getTitle() }), - frame.getWidth(), frame.getHeight()); + true, frame.getWidth(), frame.getHeight(), true, true); frame.pack(); frame.setLayer(JLayeredPane.PALETTE_LAYER); frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index d6c25a8..b669ebf 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -745,7 +745,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements public static synchronized void addInternalFrame( final JInternalFrame frame, String title, int w, int h) { - addInternalFrame(frame, title, true, w, h, true); + addInternalFrame(frame, title, true, w, h, true, false); } /** @@ -767,7 +767,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements final JInternalFrame frame, String title, boolean makeVisible, int w, int h) { - addInternalFrame(frame, title, makeVisible, w, h, true); + addInternalFrame(frame, title, makeVisible, w, h, true, false); } /** @@ -788,7 +788,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements final JInternalFrame frame, String title, int w, int h, boolean resizable) { - addInternalFrame(frame, title, true, w, h, resizable); + addInternalFrame(frame, title, true, w, h, resizable, false); } /** @@ -807,10 +807,12 @@ public class Desktop extends jalview.jbgui.GDesktop implements * height * @param resizable * Allow resize + * @param ignoreMinSize + * No minimum size is set for the dialog */ public static synchronized void addInternalFrame( final JInternalFrame frame, String title, boolean makeVisible, - int w, int h, boolean resizable) + int w, int h, boolean resizable, boolean ignoreMinSize) { // TODO: allow callers to determine X and Y position of frame (eg. via @@ -836,8 +838,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements openFrameCount++; - frame.setMinimumSize(new Dimension(DEFAULT_MIN_WIDTH, - DEFAULT_MIN_HEIGHT)); + if (!ignoreMinSize) + { + frame.setMinimumSize(new Dimension(DEFAULT_MIN_WIDTH, + DEFAULT_MIN_HEIGHT)); + } frame.setVisible(makeVisible); frame.setClosable(true); frame.setResizable(resizable); -- 1.7.10.2