From fd6c33d8f91caaef0ee25a039956ac203ac9b7a6 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 27 Apr 2007 08:20:45 +0000 Subject: [PATCH] hide annotation colouring options --- src/jalview/gui/PopupMenu.java | 44 +++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 1df8041..64339b3 100755 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -84,8 +84,9 @@ public class PopupMenu JMenu jMenu1 = new JMenu(); JMenu structureMenu = new JMenu(); JMenu viewStructureMenu = new JMenu(); - JMenu colStructureMenu = new JMenu(); + // JMenu colStructureMenu = new JMenu(); JMenuItem editSequence = new JMenuItem(); + // JMenuItem annotationMenuItem = new JMenuItem(); /** * Creates a new PopupMenu object. @@ -192,7 +193,7 @@ public class PopupMenu }); viewStructureMenu.add(menuItem); - menuItem = new JMenuItem(); + /* menuItem = new JMenuItem(); menuItem.setText(pdb.getId()); menuItem.addActionListener(new java.awt.event.ActionListener() { @@ -201,9 +202,14 @@ public class PopupMenu colourByStructure(pdb.getId()); } }); - colStructureMenu.add(menuItem); + colStructureMenu.add(menuItem);*/ } } + else + { + structureMenu.remove(viewStructureMenu); + // structureMenu.remove(colStructureMenu); + } menuItem = new JMenuItem("Hide Sequences"); menuItem.addActionListener(new java.awt.event.ActionListener() @@ -566,7 +572,7 @@ public class PopupMenu jMenu1.setText("Group"); structureMenu.setText("Structure"); viewStructureMenu.setText("View Structure"); - colStructureMenu.setText("Colour By Structure"); + // colStructureMenu.setText("Colour By Structure"); editSequence.setText("Edit Sequence..."); editSequence.addActionListener(new ActionListener() { @@ -575,6 +581,14 @@ public class PopupMenu editSequence_actionPerformed(actionEvent); } }); + /* annotationMenuItem.setText("By Annotation"); + annotationMenuItem.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent actionEvent) + { + annotationMenuItem_actionPerformed(actionEvent); + } + });*/ add(groupMenu); @@ -623,6 +637,7 @@ public class PopupMenu colourMenu.addSeparator(); colourMenu.add(abovePIDColour); colourMenu.add(conservationMenuItem); + //colourMenu.add(annotationMenuItem); editMenu.add(copy); editMenu.add(cut); editMenu.add(editSequence); @@ -641,7 +656,7 @@ public class PopupMenu jMenu1.add(outline); structureMenu.add(pdbMenu); structureMenu.add(viewStructureMenu); - structureMenu.add(colStructureMenu); + // structureMenu.add(colStructureMenu); noColourmenuItem.setText("None"); noColourmenuItem.addActionListener(new java.awt.event.ActionListener() { @@ -1009,6 +1024,23 @@ public class PopupMenu refresh(); } + public void annotationMenuItem_actionPerformed(ActionEvent actionEvent) + { + SequenceGroup sg = getGroup(); + if (sg == null) + { + return; + } + + AnnotationColourGradient acg = new AnnotationColourGradient( + sequence.getAnnotation()[0], null, AnnotationColourGradient.NO_THRESHOLD); + + acg.predefinedColours = true; + sg.cs = acg; + + refresh(); + } + /** * DOCUMENT ME! * @@ -1448,4 +1480,6 @@ public class PopupMenu } } } + + } -- 1.7.10.2