features = sq.getFeatures()
+ .getPositionalFeatures(labelClass);
+ for (SequenceFeature feature : features)
+ {
+ if (newname == null)
+ {
+ newname = feature.getDescription();
+ }
+ else
+ {
+ newname = newname + "; " + feature.getDescription();
+ }
+ }
}
-
- jalview.bin.Cache.setProperty("LAST_DIRECTORY",
- chooser.getSelectedFile().getParent());
-
- FileOutputStream out = new FileOutputStream(chooser.getSelectedFile());
-
- BufferedImage bi = new BufferedImage(width, height,
- BufferedImage.TYPE_INT_RGB);
- Graphics png = bi.getGraphics();
-
- treeCanvas.draw(png, width, height);
-
- ImageIO.write(bi, "png", out);
- out.close();
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
+ }
+ if (newname != null)
+ {
+ // String oldname = ((SequenceNode) node).getName();
+ // TODO : save oldname in the undo object for this modification.
+ ((SequenceNode) node).setName(newname);
+ }
}
+ }
+ });
+ }
+
+ /**
+ * Formats a localised title for the tree panel, like
+ *
+ * Neighbour Joining Using BLOSUM62
+ *
+ * For a tree loaded from file, just uses the file name
+ *
+ * @return
+ */
+ public String getPanelTitle() // to be moved/fixed
+ {
+ if (treeTitle != null)
+ {
+ return treeTitle;
+ }
+ else
+ {
+ /*
+ * i18n description of Neighbour Joining or Average Distance method
+ */
+ String treecalcnm = MessageManager
+ .getString("label.tree_calc_" + treeType.toLowerCase());
+
+ /*
+ * short score model name (long description can be too long)
+ */
+ String smn = substitutionMatrix;
+
+ /*
+ * put them together as Using
+ */
+ final String ttl = MessageManager
+ .formatMessage("label.treecalc_title", treecalcnm, smn);
+ return ttl;
}
+ }
}