+ public void setTreeFont(Font f)
+ {
+ if (treeCanvas != null)
+ {
+ treeCanvas.setFont(f);
+ }
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param e
+ * DOCUMENT ME!
+ */
+ @Override
+ public void distanceMenu_actionPerformed(ActionEvent e)
+ {
+ treeCanvas.setShowDistances(distanceMenu.isSelected());
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param e
+ * DOCUMENT ME!
+ */
+ @Override
+ public void bootstrapMenu_actionPerformed(ActionEvent e)
+ {
+ treeCanvas.setShowBootstrap(bootstrapMenu.isSelected());
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param e
+ * DOCUMENT ME!
+ */
+ @Override
+ public void placeholdersMenu_actionPerformed(ActionEvent e)
+ {
+ treeCanvas.setMarkPlaceholders(placeholdersMenu.isSelected());
+ }
+
+ /**
+ * Outputs the Tree in image format (currently EPS or PNG). The user is
+ * prompted for the file to save to, and for EPS (unless a preference is
+ * already set) for the choice of Text or Lineart for character rendering.
+ */
+ @Override
+ public void writeTreeImage(TYPE imageFormat)
+ {
+ int width = treeCanvas.getWidth();
+ int height = treeCanvas.getHeight();
+ ImageWriterI writer = new ImageWriterI()
+ {
+ @Override
+ public void exportImage(Graphics g) throws Exception
+ {
+ treeCanvas.draw(g, width, height);
+ }
+ };
+ String tree = MessageManager.getString("label.tree");
+ ImageExporter exporter = new ImageExporter(writer, null, imageFormat,
+ tree);
+ exporter.doExport(null, this, width, height, tree.toLowerCase());
+ }
+
+ /**
+ * change node labels to the annotation referred to by labelClass TODO:
+ * promote to a datamodel modification that can be undone TODO: make argument
+ * one case of a generic transformation function ie { undoStep = apply(Tree,
+ * TransformFunction)};
+ *
+ * @param labelClass
+ */
+ public void changeNames(final String labelClass)
+ {
+ tree.applyToNodes(new NodeTransformI()
+ {