From: kiramt Date: Tue, 16 May 2017 15:10:07 +0000 (+0100) Subject: JAL-2536 Overview window sizing not subject to min size restrictions X-Git-Tag: Release_2_10_2~3^2~58^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbug%2FJAL-2536;p=jalview.git JAL-2536 Overview window sizing not subject to min size restrictions --- 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);