MCPcopy Create free account
hub / github.com/rambaut/figtree / doCopy

Method doCopy

src/figtree/application/FigTreeFrame.java:1324–1341  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1322 }
1323
1324 public void doCopy() {
1325 StringWriter writer = new StringWriter();
1326 try {
1327 if (treeViewer.getSelectionMode() == TreePaneSelector.SelectionMode.TAXA) {
1328 writeTaxa(writer);
1329 } else {
1330 writeTreeFile(writer, ExportTreeDialog.Format.NEXUS, true, false, false, true, true);
1331 }
1332 } catch (IOException e) {
1333 e.printStackTrace();
1334 }
1335
1336 Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
1337
1338 StringSelection selection = new StringSelection(writer.toString());
1339
1340 clipboard.setContents(selection, selection);
1341 }
1342
1343 public void doPaste() {
1344 Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();

Callers

nothing calls this directly

Calls 4

writeTaxaMethod · 0.95
writeTreeFileMethod · 0.95
getSelectionModeMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected