*
*
* @author $author$
- * @version $Revision$
+ * @version $Revision: 1.155 $
*/
public class Desktop extends jalview.jbgui.GDesktop implements
- DropTargetListener, ClipboardOwner, IProgressIndicator
+ DropTargetListener, ClipboardOwner, IProgressIndicator, jalview.api.StructureSelectionManagerProvider
{
private JalviewChangeSupport changeSupport = new JalviewChangeSupport();
showMemusage.setSelected(selmemusage);
desktop.setBackground(Color.white);
getContentPane().setLayout(new BorderLayout());
+ // alternate config - have scrollbars - see notes in JAL-153
+ //JScrollPane sp = new JScrollPane();
+ //sp.getViewport().setView(desktop);
+ //getContentPane().add(sp, BorderLayout.CENTER);
getContentPane().add(desktop, BorderLayout.CENTER);
- desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
-
+ desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
+
// This line prevents Windows Look&Feel resizing all new windows to maximum
// if previous window was maximised
desktop.setDesktopManager(new MyDesktopManager(
} catch (java.beans.PropertyVetoException ve)
{
}
+ catch (java.lang.ClassCastException cex)
+ {
+ Cache.log.warn("Squashed a possible GUI implementation error. If you can recreate this, please look at http://issues.jalview.org/browse/JAL-869",cex);
+ }
}
public void lostOwnership(Clipboard clipboard, Transferable contents)
}
// TODO: update this text for each release or centrally store it for lite
// and application
- message.append("\nAuthors: Jim Procter, Andrew Waterhouse, Michele Clamp, James Cuff, Steve Searle,\n David Martin & Geoff Barton."
+ message.append("\nAuthors: Jim Procter, Jan Engelhardt, Lauren Lui, Andrew Waterhouse, Michele Clamp, James Cuff, Steve Searle,\n David Martin & Geoff Barton."
+ "\nDevelopment managed by The Barton Group, University of Dundee, Scotland, UK.\n"
+ "\nFor help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list\n"
+ "\nIf you use Jalview, please cite:"
if (value == JalviewFileChooser.APPROVE_OPTION)
{
- java.io.File choice = chooser.getSelectedFile();
+ final Desktop me = this;
+ final java.io.File choice = chooser.getSelectedFile();
+ new Thread(new Runnable()
+ {
+ public void run()
+ {
+
setProgressBar("Saving jalview project " + choice.getName(),
choice.hashCode());
jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice.getParent());
// TODO catch and handle errors for savestate
+ // TODO prevent user from messing with the Desktop whilst we're saving
try
{
new Jalview2XML().SaveState(choice);
Cache.log
.error("Problems whilst trying to save to "
+ choice.getName(), ex);
- JOptionPane.showMessageDialog(this,
+ JOptionPane.showMessageDialog(me,
"Error whilst saving current state to " + choice.getName(),
"Couldn't save project", JOptionPane.WARNING_MESSAGE);
}
setProgressBar(null, choice.hashCode());
-
+ }
+ }).start();
}
}