X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FDesktop.java;h=374f0eab3d8b5625289414d1786f0bb81afa7d4d;hb=3bdd4947c87108581abe34d05c878ee110b60f72;hp=6ac9b76896c2f38831715a575108ef0eb766eedf;hpb=e44514b727077d5cd7edb5d8184ab85cbc2eed13;p=jalview.git diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 6ac9b76..374f0ea 100755 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -48,6 +48,7 @@ public class Desktop extends jalview.jbgui.GDesktop public static Object [] jalviewClipboard; + static int fileLoadingCount= 0; /** * Creates a new Desktop object. @@ -80,7 +81,8 @@ public class Desktop extends jalview.jbgui.GDesktop setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); desktop = new JDesktopPane(); desktop.setBackground(Color.white); - setContentPane(desktop); + getContentPane().setLayout(new BorderLayout()); + getContentPane().add(desktop, BorderLayout.CENTER); desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); // This line prevents Windows Look&Feel resizing all new windows to maximum @@ -511,7 +513,7 @@ public class Desktop extends jalview.jbgui.GDesktop "\nFor all issues relating to Jalview, email help@jalview.org" + "\n\nIf you use JalView, please cite:" + "\n\"Clamp, M., Cuff, J., Searle, S. M. and Barton, G. J. (2004), The Jalview Java Alignment Editor\"" + - "\nBioinformatics, 2004 12;426-7."); + "\nBioinformatics, 2004 20;426-7."); JOptionPane.showInternalMessageDialog(Desktop.desktop, @@ -626,5 +628,42 @@ public class Desktop extends jalview.jbgui.GDesktop { new SequenceFetcher(null); } + + JPanel progressPanel; + + public void startLoading(final String fileName) + { + if (fileLoadingCount == 0) + { + progressPanel = new JPanel(new BorderLayout()); + JProgressBar progressBar = new JProgressBar(); + progressBar.setIndeterminate(true); + + progressPanel.add(new JLabel("Loading File: " + fileName + " "), + BorderLayout.WEST); + + progressPanel.add(progressBar, BorderLayout.CENTER); + + instance.getContentPane().add(progressPanel, BorderLayout.SOUTH); + } + fileLoadingCount++; + validate(); + } + + public void stopLoading() + { + fileLoadingCount--; + if (fileLoadingCount < 1) + { + if(progressPanel!=null) + { + this.getContentPane().remove(progressPanel); + progressPanel = null; + } + fileLoadingCount = 0; + } + validate(); + } + }