package jalview.gui;
import jalview.io.*;
+
import java.awt.*;
import java.awt.datatransfer.*;
import java.awt.dnd.*;
*/
public class Desktop
extends jalview.jbgui.GDesktop implements DropTargetListener,
- ClipboardOwner
+ ClipboardOwner, IProgressIndicator
{
/** DOCUMENT ME!! */
public static Desktop instance;
*/
public Desktop()
{
+ /**
+ * A note to implementors. It is ESSENTIAL that any
+ * activities that might block are spawned off as threads rather
+ * than waited for during this constructor.
+ */
instance = this;
doVamsasClientCheck();
doGroovyCheck();
this.setDropTarget(new java.awt.dnd.DropTarget(desktop, this));
+ // Spawn a thread that shows the splashscreen
+ new SplashScreen();
- /////////Add a splashscreen on startup
- /////////Add a splashscreen on startup
- new SplashScreen();
discoverer = new jalview.ws.Discoverer(); // Only gets started if gui is displayed.
public void inputSequence_actionPerformed(ActionEvent e)
{
- new SequenceFetcher(null);
+ new SequenceFetcher(this);
}
JPanel progressPanel;
public void checkForQuestionnaire(String url)
{
UserQuestionnaireCheck jvq = new UserQuestionnaireCheck(url);
- javax.swing.SwingUtilities.invokeLater(jvq);
+ //javax.swing.SwingUtilities.invokeLater(jvq);
+ new Thread(jvq).start();
}
/**
* Proxy class for JDesktopPane which optionally
JOptionPane.ERROR_MESSAGE);
}
}
+
+ /**
+ * Progress bars managed by the IProgressIndicator method.
+ */
+ private Hashtable progressBars;
+ /* (non-Javadoc)
+ * @see jalview.gui.IProgressIndicator#setProgressBar(java.lang.String, long)
+ */
+ public void setProgressBar(String message, long id)
+ {
+ if(progressBars == null)
+ {
+ progressBars = new Hashtable();
+ }
+
+ if(progressBars.get( new Long(id) )!=null)
+ {
+ JProgressBar progressPanel = (JProgressBar)progressBars.remove( new Long(id) );
+ removeProgressPanel(progressPanel);
+ } else {
+ progressBars.put(new Long(id), addProgressPanel(message));
+ }
+ }
}