// TODO - write tests and fix AlignFrame.paste() which doesn't track if
// clipboard has come from a different alignment window than the one where
// paste has been called! JAL-4151
-
+
if (Desktop.jalviewClipboard != null)
{
// The clipboard was filled from within Jalview, we must use the
}
Desktop.addInternalFrame(af, newtitle, AlignFrame.DEFAULT_WIDTH,
- AlignFrame.DEFAULT_HEIGHT);
+ AlignFrame.DEFAULT_HEIGHT);
- } else {
- try
+ }
+ else
{
- Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();
- Transferable contents = c.getContents(this);
-
- if (contents != null)
+ try
{
- String file = (String) contents
- .getTransferData(DataFlavor.stringFlavor);
+ Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();
+ Transferable contents = c.getContents(this);
- FileFormatI format = new IdentifyFile().identify(file,
- DataSourceType.PASTE);
+ if (contents != null)
+ {
+ String file = (String) contents
+ .getTransferData(DataFlavor.stringFlavor);
- new FileLoader().LoadFile(file, DataSourceType.PASTE, format);
+ FileFormatI format = new IdentifyFile().identify(file,
+ DataSourceType.PASTE);
+ new FileLoader().LoadFile(file, DataSourceType.PASTE, format);
+
+ }
+ } catch (Exception ex)
+ {
+ System.out.println(
+ "Unable to paste alignment from system clipboard:\n" + ex);
}
- } catch (Exception ex)
- {
- System.out.println(
- "Unable to paste alignment from system clipboard:\n" + ex);
- }
}
}