\r
this.setDropTarget(new java.awt.dnd.DropTarget(desktop, this));\r
\r
-\r
+/////////Add a splashscreen on startup\r
/////////Add a splashscreen on startup\r
JInternalFrame frame = new JInternalFrame();\r
\r
SplashScreen splash = new SplashScreen(frame, image);\r
frame.setContentPane(splash);\r
- desktop.add(frame);\r
-\r
- openFrameCount++;\r
- try\r
- {\r
- frame.setSelected(true);\r
- }\r
- catch (java.beans.PropertyVetoException e)\r
- {}\r
- frame.setResizable(true);\r
- frame.setSize(750, 160);\r
+ frame.setLayer(JLayeredPane.PALETTE_LAYER);\r
+ addInternalFrame(frame, "", 750,160, false);\r
frame.setLocation( (int)((getWidth()-750) /2), (int)((getHeight()-160) /2));\r
- frame.setClosable(false);\r
- frame.setIconifiable(false);\r
- frame.setMaximizable(false);\r
- frame.setFrameIcon(null);\r
- frame.setVisible(true);\r
-\r
}\r
public static void addInternalFrame(final JInternalFrame frame, String title, int w, int h)\r
{\r
\r
public void LoadFile(String file, String protocol, String format)\r
{\r
- SequenceI [] sequences = null;\r
+ LoadingThread loader = new LoadingThread(file, protocol, format);\r
+ loader.start();\r
+ }\r
\r
- if (FormatProperties.contains(format))\r
- sequences = FormatAdapter.read(file, protocol, format);\r
+ class LoadingThread extends Thread\r
+ {\r
+ String file, protocol, format;\r
\r
- if (sequences != null && sequences.length>0)\r
+ public LoadingThread(String file, String protocol, String format)\r
{\r
- AlignFrame af = new AlignFrame(new Alignment(sequences));\r
- addInternalFrame(af, file, AlignFrame.NEW_WINDOW_WIDTH, AlignFrame.NEW_WINDOW_HEIGHT);\r
- af.statusBar.setText("Successfully loaded file " + file);\r
-\r
+ this.file = file;\r
+ this.protocol = protocol;\r
+ this.format = format;\r
}\r
- else\r
- JOptionPane.showInternalMessageDialog(Desktop.desktop, "Couldn't open file.\n"\r
- + "Formats currently supported are\n"\r
- + "Fasta, MSF, Clustal, BLC, PIR, MSP or PFAM" // JBPNote - message should be generated through FormatAdapter!\r
- ,"Error loading file",\r
- JOptionPane.WARNING_MESSAGE);\r
+ public void run()\r
+ {\r
+ SequenceI [] sequences = null;\r
+\r
+ if (FormatProperties.contains(format))\r
+ sequences = FormatAdapter.read(file, protocol, format);\r
+\r
+ if (sequences != null && sequences.length>0)\r
+ {\r
+ AlignFrame af = new AlignFrame(new Alignment(sequences));\r
+ addInternalFrame(af, file, AlignFrame.NEW_WINDOW_WIDTH, AlignFrame.NEW_WINDOW_HEIGHT);\r
+ af.statusBar.setText("Successfully loaded file " + file);\r
+ }\r
+ else\r
+ JOptionPane.showInternalMessageDialog(Desktop.desktop, "Couldn't open file.\n"\r
+ + "Formats currently supported are\n"\r
+ + "Fasta, MSF, Clustal, BLC, PIR, MSP or PFAM" // JBPNote - message should be generated through FormatAdapter!\r
+ ,"Error loading file",\r
+ JOptionPane.WARNING_MESSAGE);\r
\r
+ }\r
}\r
\r
+\r
public void inputURLMenuItem_actionPerformed(ActionEvent e)\r
{\r
String url = JOptionPane.showInternalInputDialog(Desktop.desktop,"Enter url of input file",\r
}\r
}\r
}\r
+\r
+\r