From: gmungoc Date: Tue, 8 Jan 2019 11:41:22 +0000 (+0000) Subject: JAL-3180 Disabled 'By Annotation' group colour menu item X-Git-Tag: Release_2_11_0~17^2~55^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1aa2f97dbda5915fee0871270495596afc2c1011;p=jalview.git JAL-3180 Disabled 'By Annotation' group colour menu item --- diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index acf6fba..f9f7004 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -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 diff --git a/resources/lang/Messages_es.properties b/resources/lang/Messages_es.properties index 555977d..406ea3c 100644 --- a/resources/lang/Messages_es.properties +++ b/resources/lang/Messages_es.properties @@ -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 diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index ed3d29a..5e9f0a6 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -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);