add outline colour
authoramwaterhouse <Andrew Waterhouse>
Mon, 21 Mar 2005 18:46:44 +0000 (18:46 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 21 Mar 2005 18:46:44 +0000 (18:46 +0000)
src/jalview/gui/PopupMenu.java

index abd5093..166ab73 100755 (executable)
@@ -3,6 +3,7 @@ package jalview.gui;
 import jalview.datamodel.*;\r
 import jalview.analysis.*;\r
 import jalview.schemes.*;\r
+import java.awt.*;\r
 import javax.swing.*;\r
 import java.awt.event.*;\r
 import jalview.io.*;\r
@@ -40,6 +41,7 @@ public class PopupMenu extends JPopupMenu
   Sequence sequence;\r
   JMenuItem unGroupMenuItem = new JMenuItem();\r
   JMenuItem pdbMenuItem = new JMenuItem();\r
+  JMenuItem outline = new JMenuItem();\r
 \r
   public PopupMenu(AlignmentPanel ap, Sequence seq)\r
   {\r
@@ -133,6 +135,7 @@ public class PopupMenu extends JPopupMenu
         groupName_actionPerformed(e);\r
       }\r
     });\r
+    groupAnnotation.setEnabled(false);\r
     groupAnnotation.setText("Annotation");\r
     groupAnnotation.addActionListener(new java.awt.event.ActionListener()\r
     {\r
@@ -151,6 +154,8 @@ public class PopupMenu extends JPopupMenu
       }\r
     });\r
     residueMenu.setText("Residue");\r
+    annotateResidue.setEnabled(false);\r
+    annotateResidue.setActionCommand("annotate residue");\r
     annotateResidue.setText("annotate residue???");\r
     PIDColour.setFocusPainted(false);\r
     unGroupMenuItem.setText("Remove Group");\r
@@ -169,6 +174,14 @@ public class PopupMenu extends JPopupMenu
         pdbMenuItem_actionPerformed(e);\r
       }\r
     });\r
+    outline.setText("Border colour");\r
+    outline.addActionListener(new java.awt.event.ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        outline_actionPerformed(e);\r
+      }\r
+    });\r
     add(groupMenu);\r
     this.add(sequenceMenu);\r
     this.add(residueMenu);\r
@@ -179,6 +192,8 @@ public class PopupMenu extends JPopupMenu
     defineMenu.add(groupName);\r
     defineMenu.add(groupAnnotation);\r
     defineMenu.addSeparator();\r
+    defineMenu.add(outline);\r
+    defineMenu.addSeparator();\r
     defineMenu.add(noColourmenuItem);\r
     defineMenu.add(clustalColour);\r
     defineMenu.add(zappoColour);\r
@@ -381,7 +396,23 @@ public class PopupMenu extends JPopupMenu
 \r
   protected void abovePIDColour_actionPerformed(ActionEvent e)\r
   {\r
-    Desktop.setPIDSliderSource(ap, getGroup().cs, getGroup().getName());\r
+    if(abovePIDColour.isSelected())\r
+{\r
+\r
+   Desktop.setPIDSliderSource(ap, getGroup().cs, getGroup().getName());\r
+   refresh();\r
+}\r
+else // remove PIDColouring\r
+{\r
+    ColourSchemeI cs = getGroup().cs;\r
+      ResidueColourScheme rcs = (ResidueColourScheme)cs;\r
+      rcs.setThreshold(0);\r
+      getGroup().cs = rcs;\r
+      refresh();\r
+}\r
+\r
+\r
+\r
   }\r
 \r
 \r
@@ -550,4 +581,12 @@ public class PopupMenu extends JPopupMenu
     }\r
   }\r
 \r
+  protected void outline_actionPerformed(ActionEvent e)\r
+  {\r
+    SequenceGroup sg = getGroup();\r
+    Color col = JColorChooser.showDialog(this, "Select Outline Colour", Color.BLUE);\r
+    if(col!=null)\r
+      sg.setOutlineColour(col);\r
+  }\r
+\r
 }\r