JAL-3180 Disabled 'By Annotation' group colour menu item feature/JAL-3180colourAnnotationMenu
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 8 Jan 2019 11:41:22 +0000 (11:41 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 8 Jan 2019 11:41:22 +0000 (11:41 +0000)
resources/lang/Messages.properties
resources/lang/Messages_es.properties
src/jalview/gui/PopupMenu.java

index acf6fba..f9f7004 100644 (file)
@@ -1363,3 +1363,4 @@ label.most_bound_molecules = Most Bound Molecules
 label.most_polymer_residues = Most Polymer Residues
 label.cached_structures = Cached Structures
 label.free_text_search = Free Text Search
+label.by_annotation_tooltip = Annotation Colour is configured from the main Colour menu
index 555977d..406ea3c 100644 (file)
@@ -1364,3 +1364,4 @@ label.most_bound_molecules = M
 label.most_polymer_residues = Más Residuos de Polímeros
 label.cached_structures = Estructuras en Caché
 label.free_text_search = Búsqueda de texto libre
+label.by_annotation_tooltip = El color de anotación se configura desde el menú principal de colores
index ed3d29a..5e9f0a6 100644 (file)
@@ -46,6 +46,7 @@ import jalview.schemes.Blosum62ColourScheme;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ColourSchemes;
 import jalview.schemes.PIDColourScheme;
+import jalview.schemes.ResidueColourScheme;
 import jalview.util.GroupUrlLink;
 import jalview.util.GroupUrlLink.UrlStringTooLongException;
 import jalview.util.MessageManager;
@@ -68,11 +69,13 @@ import java.util.SortedMap;
 import java.util.TreeMap;
 import java.util.Vector;
 
+import javax.swing.ButtonGroup;
 import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JColorChooser;
 import javax.swing.JMenu;
 import javax.swing.JMenuItem;
 import javax.swing.JPopupMenu;
+import javax.swing.JRadioButtonMenuItem;
 
 /**
  * DOCUMENT ME!
@@ -92,6 +95,8 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
 
   protected JCheckBoxMenuItem conservationMenuItem = new JCheckBoxMenuItem();
 
+  protected JRadioButtonMenuItem annotationColour;
+
   protected JMenuItem modifyConservation = new JMenuItem();
 
   AlignmentPanel ap;
@@ -1401,6 +1406,13 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
       }
     });
 
+    annotationColour = new JRadioButtonMenuItem(
+            MessageManager.getString("action.by_annotation"));
+    annotationColour.setName(ResidueColourScheme.ANNOTATION_COLOUR);
+    annotationColour.setEnabled(false);
+    annotationColour.setToolTipText(
+            MessageManager.getString("label.by_annotation_tooltip"));
+
     modifyConservation.setText(MessageManager
             .getString("label.modify_conservation_threshold"));
     modifyConservation.addActionListener(new ActionListener()
@@ -1431,7 +1443,10 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
     colourMenu.add(textColour);
     colourMenu.addSeparator();
 
-    ColourMenuHelper.addMenuItems(colourMenu, this, sg, false);
+    ButtonGroup bg = ColourMenuHelper.addMenuItems(colourMenu, this, sg,
+            false);
+    bg.add(annotationColour);
+    colourMenu.add(annotationColour);
 
     colourMenu.addSeparator();
     colourMenu.add(conservationMenuItem);