treepanel is now internalframe
authoramwaterhouse <Andrew Waterhouse>
Fri, 18 Feb 2005 12:26:49 +0000 (12:26 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 18 Feb 2005 12:26:49 +0000 (12:26 +0000)
src/jalview/gui/AlignFrame.java
src/jalview/gui/TreePanel.java

index a20a3fe..ebaacda 100755 (executable)
@@ -52,7 +52,6 @@ public class AlignFrame extends GAlignFrame
      }\r
    });\r
 \r
-   AlignmentUtil.fetchSequenceFeatures(al, alignPanel);\r
   }\r
 \r
   protected void saveAs_actionPerformed(ActionEvent e)\r
@@ -611,6 +610,11 @@ public class AlignFrame extends GAlignFrame
   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
@@ -973,7 +977,6 @@ if ( viewport.getConservationSelected() )
       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
@@ -986,8 +989,7 @@ if ( viewport.getConservationSelected() )
                          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
index 936eebe..4b605bf 100755 (executable)
@@ -9,6 +9,9 @@ import java.util.*;
 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
@@ -250,25 +253,52 @@ public void propertiesInit() {
 \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