git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3f8391b
)
JAL-4055 quick patch to see how Jalview looks as a free-floating multiwindowed app...
spike/JAL-4055_retire_JDesktop
author
Jim Procter
<j.procter@dundee.ac.uk>
Fri, 29 Jul 2022 10:36:52 +0000
(11:36 +0100)
committer
Jim Procter
<j.procter@dundee.ac.uk>
Fri, 29 Jul 2022 10:36:52 +0000
(11:36 +0100)
src/jalview/gui/Desktop.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/Desktop.java
b/src/jalview/gui/Desktop.java
index
3ad5384
..
9681198
100644
(file)
--- a/
src/jalview/gui/Desktop.java
+++ b/
src/jalview/gui/Desktop.java
@@
-81,6
+81,7
@@
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JDesktopPane;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
@@
-890,15
+891,17
@@
public class Desktop extends jalview.jbgui.GDesktop
int w, int h, boolean resizable, boolean ignoreMinSize)
{
int w, int h, boolean resizable, boolean ignoreMinSize)
{
+ JFrame extFrame = new JFrame();
+ extFrame.setContentPane(frame);
// TODO: allow callers to determine X and Y position of frame (eg. via
// bounds object).
// TODO: consider fixing method to update entries in the window submenu with
// the current window title
// TODO: allow callers to determine X and Y position of frame (eg. via
// bounds object).
// TODO: consider fixing method to update entries in the window submenu with
// the current window title
- frame.setTitle(title);
- if (frame.getWidth() < 1 || frame.getHeight() < 1)
+ extFrame.setTitle(title);
+ if (extFrame.getWidth() < 1 || extFrame.getHeight() < 1)
{
{
- frame.setSize(w, h);
+ extFrame.setSize(w, h);
}
// THIS IS A PUBLIC STATIC METHOD, SO IT MAY BE CALLED EVEN IN
// A HEADLESS STATE WHEN NO DESKTOP EXISTS. MUST RETURN
}
// THIS IS A PUBLIC STATIC METHOD, SO IT MAY BE CALLED EVEN IN
// A HEADLESS STATE WHEN NO DESKTOP EXISTS. MUST RETURN
@@
-914,7
+917,7
@@
public class Desktop extends jalview.jbgui.GDesktop
if (!ignoreMinSize)
{
if (!ignoreMinSize)
{
- frame.setMinimumSize(
+ extFrame.setMinimumSize(
new Dimension(DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT));
// Set default dimension for Alignment Frame window.
new Dimension(DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT));
// Set default dimension for Alignment Frame window.
@@
-923,7
+926,7
@@
public class Desktop extends jalview.jbgui.GDesktop
// I did this here in order not to miss out on any Alignment frame.
if (frame instanceof AlignFrame)
{
// 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,
+ extFrame.setMinimumSize(new Dimension(ALIGN_FRAME_DEFAULT_MIN_WIDTH,
ALIGN_FRAME_DEFAULT_MIN_HEIGHT));
}
}
ALIGN_FRAME_DEFAULT_MIN_HEIGHT));
}
}
@@
-1004,17
+1007,16
@@
public class Desktop extends jalview.jbgui.GDesktop
setKeyBindings(frame);
setKeyBindings(frame);
- desktop.add(frame);
+ // desktop.add(frame);
windowMenu.add(menuItem);
windowMenu.add(menuItem);
- frame.toFront();
+ extFrame.pack();
+ extFrame.setVisible(true);
+ extFrame.toFront();
try
{
try
{
- frame.setSelected(true);
- frame.requestFocus();
- } catch (java.beans.PropertyVetoException ve)
- {
+ extFrame.requestFocus();
} catch (java.lang.ClassCastException cex)
{
jalview.bin.Console.warn(
} catch (java.lang.ClassCastException cex)
{
jalview.bin.Console.warn(