hide annotation colouring options
authoramwaterhouse <Andrew Waterhouse>
Fri, 27 Apr 2007 08:20:45 +0000 (08:20 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 27 Apr 2007 08:20:45 +0000 (08:20 +0000)
src/jalview/gui/PopupMenu.java

index 1df8041..64339b3 100755 (executable)
@@ -84,8 +84,9 @@ public class PopupMenu
   JMenu jMenu1 = new JMenu();\r
   JMenu structureMenu = new JMenu();\r
   JMenu viewStructureMenu = new JMenu();\r
-  JMenu colStructureMenu = new JMenu();\r
+ // JMenu colStructureMenu = new JMenu();\r
   JMenuItem editSequence = new JMenuItem();\r
+ // JMenuItem annotationMenuItem = new JMenuItem();\r
 \r
   /**\r
    * Creates a new PopupMenu object.\r
@@ -192,7 +193,7 @@ public class PopupMenu
           });\r
           viewStructureMenu.add(menuItem);\r
 \r
-          menuItem = new JMenuItem();\r
+       /*   menuItem = new JMenuItem();\r
           menuItem.setText(pdb.getId());\r
           menuItem.addActionListener(new java.awt.event.ActionListener()\r
           {\r
@@ -201,9 +202,14 @@ public class PopupMenu
               colourByStructure(pdb.getId());\r
             }\r
           });\r
-          colStructureMenu.add(menuItem);\r
+          colStructureMenu.add(menuItem);*/\r
         }\r
       }\r
+      else\r
+      {\r
+        structureMenu.remove(viewStructureMenu);\r
+       // structureMenu.remove(colStructureMenu);\r
+      }\r
 \r
       menuItem = new JMenuItem("Hide Sequences");\r
       menuItem.addActionListener(new java.awt.event.ActionListener()\r
@@ -566,7 +572,7 @@ public class PopupMenu
     jMenu1.setText("Group");\r
     structureMenu.setText("Structure");\r
     viewStructureMenu.setText("View Structure");\r
-    colStructureMenu.setText("Colour By Structure");\r
+  //  colStructureMenu.setText("Colour By Structure");\r
     editSequence.setText("Edit Sequence...");\r
     editSequence.addActionListener(new ActionListener()\r
     {\r
@@ -575,6 +581,14 @@ public class PopupMenu
         editSequence_actionPerformed(actionEvent);\r
       }\r
     });\r
+   /* annotationMenuItem.setText("By Annotation");\r
+    annotationMenuItem.addActionListener(new ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent actionEvent)\r
+      {\r
+        annotationMenuItem_actionPerformed(actionEvent);\r
+      }\r
+    });*/\r
 \r
     add(groupMenu);\r
 \r
@@ -623,6 +637,7 @@ public class PopupMenu
     colourMenu.addSeparator();\r
     colourMenu.add(abovePIDColour);\r
     colourMenu.add(conservationMenuItem);\r
+    //colourMenu.add(annotationMenuItem);\r
     editMenu.add(copy);\r
     editMenu.add(cut);\r
     editMenu.add(editSequence);\r
@@ -641,7 +656,7 @@ public class PopupMenu
     jMenu1.add(outline);\r
     structureMenu.add(pdbMenu);\r
     structureMenu.add(viewStructureMenu);\r
-    structureMenu.add(colStructureMenu);\r
+   // structureMenu.add(colStructureMenu);\r
     noColourmenuItem.setText("None");\r
     noColourmenuItem.addActionListener(new java.awt.event.ActionListener()\r
     {\r
@@ -1009,6 +1024,23 @@ public class PopupMenu
     refresh();\r
   }\r
 \r
+  public void annotationMenuItem_actionPerformed(ActionEvent actionEvent)\r
+  {\r
+    SequenceGroup sg = getGroup();\r
+    if (sg == null)\r
+    {\r
+      return;\r
+    }\r
+\r
+    AnnotationColourGradient acg = new AnnotationColourGradient(\r
+        sequence.getAnnotation()[0], null, AnnotationColourGradient.NO_THRESHOLD);\r
+\r
+    acg.predefinedColours = true;\r
+    sg.cs = acg;\r
+\r
+    refresh();\r
+  }\r
+\r
   /**\r
    * DOCUMENT ME!\r
    *\r
@@ -1448,4 +1480,6 @@ public class PopupMenu
         }\r
       }\r
   }\r
+\r
+\r
 }\r