git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TreePanel takes viewport
[jalview.git]
/
src
/
jalview
/
gui
/
Desktop.java
diff --git
a/src/jalview/gui/Desktop.java
b/src/jalview/gui/Desktop.java
index
642a872
..
97c6a20
100755
(executable)
--- a/
src/jalview/gui/Desktop.java
+++ b/
src/jalview/gui/Desktop.java
@@
-113,10
+113,12
@@
public class Desktop extends jalview.jbgui.GDesktop
SplashScreen splash = new SplashScreen(frame, image);
frame.setContentPane(splash);
frame.setLayer(JLayeredPane.PALETTE_LAYER);
SplashScreen splash = new SplashScreen(frame, image);
frame.setContentPane(splash);
frame.setLayer(JLayeredPane.PALETTE_LAYER);
- addInternalFrame(frame, "", 750, 160, false);
frame.setLocation((int) ((getWidth() - 750) / 2),
(int) ((getHeight() - 160) / 2));
frame.setLocation((int) ((getWidth() - 750) / 2),
(int) ((getHeight() - 160) / 2));
- discoverer=new jalview.ws.Discoverer(); // Only gets started if gui is displayed.
+
+ addInternalFrame(frame, "", 750, 160, false);
+
+ discoverer=new jalview.ws.Discoverer(); // Only gets started if gui is displayed.
}
/**
}
/**
@@
-127,7
+129,7
@@
public class Desktop extends jalview.jbgui.GDesktop
* @param w DOCUMENT ME!
* @param h DOCUMENT ME!
*/
* @param w DOCUMENT ME!
* @param h DOCUMENT ME!
*/
- public static void addInternalFrame(final JInternalFrame frame,
+ public static synchronized void addInternalFrame(final JInternalFrame frame,
String title, int w, int h)
{
addInternalFrame(frame, title, w, h, true);
String title, int w, int h)
{
addInternalFrame(frame, title, w, h, true);
@@
-142,13
+144,15
@@
public class Desktop extends jalview.jbgui.GDesktop
* @param h DOCUMENT ME!
* @param resizable DOCUMENT ME!
*/
* @param h DOCUMENT ME!
* @param resizable DOCUMENT ME!
*/
- public static void addInternalFrame(final JInternalFrame frame,
+ public static synchronized void addInternalFrame(final JInternalFrame frame,
String title, int w, int h, boolean resizable)
{
frame.setTitle(title);
String title, int w, int h, boolean resizable)
{
frame.setTitle(title);
- frame.setSize(w, h);
-
+ if(frame.getWidth()<1 || frame.getHeight()<1)
+ {
+ frame.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
// IF JALVIEW IS RUNNING HEADLESS
// THIS IS A PUBLIC STATIC METHOD, SO IT MAY BE CALLED EVEN IN
// A HEADLESS STATE WHEN NO DESKTOP EXISTS. MUST RETURN
// IF JALVIEW IS RUNNING HEADLESS
@@
-160,24
+164,23
@@
public class Desktop extends jalview.jbgui.GDesktop
}
}
- desktop.add(frame);
openFrameCount++;
openFrameCount++;
- try
- {
- frame.setSelected(true);
- }
- catch (java.beans.PropertyVetoException e)
- {
- }
-
+ frame.setVisible(true);
frame.setClosable(true);
frame.setResizable(resizable);
frame.setMaximizable(resizable);
frame.setIconifiable(resizable);
frame.setFrameIcon(null);
frame.setClosable(true);
frame.setResizable(resizable);
frame.setMaximizable(resizable);
frame.setIconifiable(resizable);
frame.setFrameIcon(null);
- frame.setLocation(xOffset * openFrameCount, yOffset * openFrameCount);
- frame.toFront();
+
+ if (frame.getX()<1 && frame.getY()<1)
+ {
+ frame.setLocation(xOffset * openFrameCount, yOffset * ((openFrameCount-1)%10)+yOffset);
+ }
+
+ desktop.add(frame);
+ frame.toFront();
+
final JMenuItem menuItem = new JMenuItem(title);
frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
final JMenuItem menuItem = new JMenuItem(title);
frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
@@
-202,13
+205,11
@@
public class Desktop extends jalview.jbgui.GDesktop
}
catch (java.beans.PropertyVetoException ex)
{
}
catch (java.beans.PropertyVetoException ex)
{
- }
- ;
+ }
}
});
}
});
- frame.setVisible(true);
windowMenu.add(menuItem);
}
windowMenu.add(menuItem);
}