X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FDesktop.java;h=d076ba06a9d601da326fe76f71554463a84ea04c;hb=c5e7525fa1ce59385fd3e249c2fe4056f4b5371e;hp=4877d7f7f56f908b30eb4b70a1e11bdf57aa2488;hpb=36e7c887ef91f49f6065dea063180f7de146b3e1;p=jalview.git diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 4877d7f..d076ba0 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -133,6 +133,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements private static int DEFAULT_MIN_HEIGHT = 250; + private static int ALIGN_FRAME_DEFAULT_MIN_WIDTH = 600; + + private static int ALIGN_FRAME_DEFAULT_MIN_HEIGHT = 70; + private static final String EXPERIMENTAL_FEATURES = "EXPERIMENTAL_FEATURES"; private JalviewChangeSupport changeSupport = new JalviewChangeSupport(); @@ -749,7 +753,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); } /** @@ -771,7 +775,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); } /** @@ -792,7 +796,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); } /** @@ -811,10 +815,12 @@ public class Desktop extends jalview.jbgui.GDesktop implements * height * @param resizable * Allow resize + * @param ignoreMinSize + * Do not set the default minimum size for frame */ 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 @@ -840,8 +846,23 @@ 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)); + + // Set default dimension for Alignment Frame window. + // The Alignment Frame window could be added from a number of places, + // hence, + // I did this here in order not to miss out on any Alignment frame. + if (frame instanceof AlignFrame) + { + frame.setMinimumSize(new Dimension(ALIGN_FRAME_DEFAULT_MIN_WIDTH, + ALIGN_FRAME_DEFAULT_MIN_HEIGHT)); + } + } + + frame.setVisible(makeVisible); frame.setClosable(true); frame.setResizable(resizable);