X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FDesktop.java;h=1226f6794c645999f65931b873dfa926d7c29882;hb=e7ed63f1ea56432246a6ed1553f0fe56d26f56ea;hp=d2c9b5cebbfb9caf9137914a397026d649ff9747;hpb=00f6edbbdddf16f77142e98e375363675be807fe;p=jalview.git diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index d2c9b5c..1226f67 100755 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -90,30 +90,15 @@ setVisible(true); this.setDropTarget(new java.awt.dnd.DropTarget(desktop, this)); - +/////////Add a splashscreen on startup /////////Add a splashscreen on startup JInternalFrame frame = new JInternalFrame(); SplashScreen splash = new SplashScreen(frame, image); frame.setContentPane(splash); - desktop.add(frame); - - openFrameCount++; - try - { - frame.setSelected(true); - } - catch (java.beans.PropertyVetoException e) - {} - frame.setResizable(true); - frame.setSize(750, 160); + frame.setLayer(JLayeredPane.PALETTE_LAYER); + addInternalFrame(frame, "", 750,160, false); frame.setLocation( (int)((getWidth()-750) /2), (int)((getHeight()-160) /2)); - frame.setClosable(false); - frame.setIconifiable(false); - frame.setMaximizable(false); - frame.setFrameIcon(null); - frame.setVisible(true); - } public static void addInternalFrame(final JInternalFrame frame, String title, int w, int h) { @@ -205,27 +190,44 @@ this.setDropTarget(new java.awt.dnd.DropTarget(desktop, this)); public void LoadFile(String file, String protocol, String format) { - SequenceI [] sequences = null; + LoadingThread loader = new LoadingThread(file, protocol, format); + loader.start(); + } - if (FormatProperties.contains(format)) - sequences = FormatAdapter.read(file, protocol, format); + class LoadingThread extends Thread + { + String file, protocol, format; - if (sequences != null && sequences.length>0) + public LoadingThread(String file, String protocol, String format) { - AlignFrame af = new AlignFrame(new Alignment(sequences)); - addInternalFrame(af, file, AlignFrame.NEW_WINDOW_WIDTH, AlignFrame.NEW_WINDOW_HEIGHT); - af.statusBar.setText("Successfully loaded file " + file); - + this.file = file; + this.protocol = protocol; + this.format = format; } - else - JOptionPane.showInternalMessageDialog(Desktop.desktop, "Couldn't open file.\n" - + "Formats currently supported are\n" - + "Fasta, MSF, Clustal, BLC, PIR, MSP or PFAM" // JBPNote - message should be generated through FormatAdapter! - ,"Error loading file", - JOptionPane.WARNING_MESSAGE); + public void run() + { + SequenceI [] sequences = null; + + if (FormatProperties.contains(format)) + sequences = FormatAdapter.read(file, protocol, format); + + if (sequences != null && sequences.length>0) + { + AlignFrame af = new AlignFrame(new Alignment(sequences)); + addInternalFrame(af, file, AlignFrame.NEW_WINDOW_WIDTH, AlignFrame.NEW_WINDOW_HEIGHT); + af.statusBar.setText("Successfully loaded file " + file); + } + else + JOptionPane.showInternalMessageDialog(Desktop.desktop, "Couldn't open file.\n" + + "Formats currently supported are\n" + + "Fasta, MSF, Clustal, BLC, PIR, MSP or PFAM" // JBPNote - message should be generated through FormatAdapter! + ,"Error loading file", + JOptionPane.WARNING_MESSAGE); + } } + public void inputURLMenuItem_actionPerformed(ActionEvent e) { String url = JOptionPane.showInternalInputDialog(Desktop.desktop,"Enter url of input file", @@ -329,3 +331,5 @@ this.setDropTarget(new java.awt.dnd.DropTarget(desktop, this)); } } } + +