}\r
});\r
\r
- AlignmentUtil.fetchSequenceFeatures(al, alignPanel);\r
}\r
\r
protected void saveAs_actionPerformed(ActionEvent e)\r
public void sequenceFeatures_actionPerformed(ActionEvent evt)\r
{\r
viewport.showSequenceFeatures(sequenceFeatures.isSelected());\r
+ if(viewport.showSequenceFeatures && !((Alignment)viewport.alignment).featuresAdded)\r
+ {\r
+ AlignmentUtil.fetchSequenceFeatures( viewport.alignment , alignPanel);\r
+ ((Alignment)viewport.alignment).featuresAdded = true;\r
+ }\r
alignPanel.RefreshPanels();\r
}\r
\r
return;\r
}\r
\r
- JInternalFrame frame = new javax.swing.JInternalFrame();\r
TreePanel tp=null;\r
if (viewport.getSelection() != null && viewport.getSelection().size() > 3)\r
{\r
type, pwType, 0, viewport.alignment.getWidth());\r
}\r
\r
- frame.setContentPane(tp);\r
- Desktop.addInternalFrame(frame, title, 600, 500);\r
+ Desktop.addInternalFrame(tp, title, 600, 500);\r
}\r
\r
\r
import java.io.*;\r
import jalview.util.*;\r
import javax.swing.*;\r
+import java.awt.print.*;\r
+import java.awt.*;\r
+\r
\r
\r
public class TreePanel extends GTreePanel\r
\r
}\r
\r
- public void showDistanceCheckbox_actionPerformed(ActionEvent e)\r
+\r
+ protected void saveMenu_actionPerformed(ActionEvent e)\r
{\r
- treeCanvas.setShowDistances(showDistanceCheckbox.isSelected());\r
+\r
+ }\r
+\r
+ protected void printMenu_actionPerformed(ActionEvent e)\r
+ {\r
+\r
+ //Putting in a thread avoids Swing painting problems\r
+ treeCanvas.startPrinting();\r
}\r
\r
- public void fontSizeCombobox_actionPerformed(ActionEvent e)\r
+ protected void fontSize_actionPerformed(ActionEvent e)\r
{\r
if( treeCanvas==null )\r
return;\r
\r
- int size = Integer.parseInt( fontSizeCombobox.getSelectedItem().toString() );\r
- treeCanvas.setFontSize( size );\r
-\r
+ String size = fontSize.getText().substring( fontSize.getText().indexOf("-")+1);\r
+\r
+ Object selection = JOptionPane.showInternalInputDialog(Desktop.desktop,\r
+ "Select font size",\r
+ "Font size",\r
+ JOptionPane.QUESTION_MESSAGE,\r
+ null, new String[]{"1","2","4","6","8","10","12","14","16","18","20"}\r
+ ,"Font Size - "+size);\r
+ if(selection!=null)\r
+ {\r
+ fontSize.setText("Font Size - " + selection);\r
+\r
+ int i = Integer.parseInt(selection.toString());\r
+ treeCanvas.setFontSize(i);\r
+ }\r
scrollPane.setViewportView(treeCanvas);\r
+\r
+ }\r
+\r
+ protected void distanceMenu_actionPerformed(ActionEvent e)\r
+ {\r
+ treeCanvas.setShowDistances(distanceMenu.isSelected());\r
}\r
\r
- public void bootStrapCheckBox_actionPerformed(ActionEvent e)\r
+ protected void bootstrapMenu_actionPerformed(ActionEvent e)\r
{\r
- treeCanvas.setShowBootstrap(bootStrapCheckBox.isSelected());\r
+ treeCanvas.setShowBootstrap(bootstrapMenu.isSelected());\r
}\r
\r
+\r
}\r