From: gmungoc Date: Fri, 20 Jan 2017 09:47:20 +0000 (+0000) Subject: Merge branch 'develop' into features/JAL-2360colourSchemeApplicability X-Git-Tag: Release_2_10_3b1~357^2~10^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=06ce849ffedc7ab10a3c54cda96b9a7dec58c136;p=jalview.git Merge branch 'develop' into features/JAL-2360colourSchemeApplicability Conflicts: src/jalview/appletgui/APopupMenu.java src/jalview/gui/AlignFrame.java src/jalview/gui/PopupMenu.java src/jalview/jbgui/GAlignFrame.java --- 06ce849ffedc7ab10a3c54cda96b9a7dec58c136 diff --cc resources/lang/Messages.properties index 296a23f,a86154c..c451f07 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@@ -325,7 -323,7 +325,7 @@@ label.size = Size label.style = Style: label.calculating = Calculating.... label.modify_conservation_visibility = Modify conservation visibility - label.colour_residues_above_occurence = Colour residues above % occurence -label.colour_residues_above_occurence = Colour residues above % occurrence ++label.colour_residues_above_occurrence = Colour residues above % occurrence label.set_this_label_text = set this label text label.sequences_from = Sequences from {0} label.successfully_loaded_file = Successfully loaded file {0} diff --cc src/jalview/appletgui/APopupMenu.java index 4eaa18a,209ca22..1f3d318 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@@ -111,8 -103,12 +111,14 @@@ public class APopupMenu extends java.aw protected CheckboxMenuItem abovePIDColour = new CheckboxMenuItem(); + MenuItem modifyPID = new MenuItem(); + - protected CheckboxMenuItem conservationMenuItem = new CheckboxMenuItem(); + protected CheckboxMenuItem conservationColour = new CheckboxMenuItem(); + MenuItem modifyConservation = new MenuItem(); + ++ MenuItem noColourmenuItem = new MenuItem(); ++ final AlignmentPanel ap; MenuItem unGroupMenuItem = new MenuItem(); @@@ -254,10 -252,11 +260,12 @@@ if (sg.cs != null) { abovePIDColour.setState(sg.cs.getThreshold() > 0); + conservationColour.setState(sg.cs.conservationApplied()); + modifyPID.setEnabled(abovePIDColour.getState()); - conservationMenuItem.setState(sg.cs.conservationApplied()); - modifyConservation.setEnabled(conservationMenuItem.getState()); ++ modifyConservation.setEnabled(conservationColour.getState()); } } + setSelectedColour(sg.cs); } else { @@@ -593,47 -578,31 +601,55 @@@ { nucleotideMenuItem_actionPerformed(); } - - else if (source == userDefinedColour) + else if (source == purinePyrimidineColour) { - userDefinedColour_actionPerformed(); + purinePyrimidineColour_actionPerformed(); } - else if (source == PIDColour) + else if (source == abovePIDColour) { - PIDColour_actionPerformed(); + abovePIDColour_itemStateChanged(); } - else if (source == BLOSUM62Colour) + else if (source == conservationColour) { - BLOSUM62Colour_actionPerformed(); + conservationMenuItem_itemStateChanged(); } - else if (source == noColourmenuItem) + else if (source == showColourText) { - noColourmenuItem_actionPerformed(); + showColourText_itemStateChanged(); + } + else if (source == showText) + { + showText_itemStateChanged(); + } + else if (source == showBoxes) + { + showBoxes_itemStateChanged(); + } + else if (source == displayNonconserved) + { + this.showNonconserved_itemStateChanged(); + } + } + + /** + * Actions on clicking a menu item + */ + @Override + public void actionPerformed(ActionEvent evt) + { + Object source = evt.getSource(); + if (source == userDefinedColour) + { + userDefinedColour_actionPerformed(); } + else if (source == modifyConservation) + { + conservationMenuItem_itemStateChanged(); + } + else if (source == modifyPID) + { + abovePIDColour_itemStateChanged(); + } else if (source == unGroupMenuItem) { unGroupMenuItem_actionPerformed(); @@@ -899,14 -868,14 +915,14 @@@ void addPDB() { Vector pdbs = seq.getAllPDBEntries(); -- if (pdbs != null&& !pdbs.isEmpty()) ++ if (pdbs != null && !pdbs.isEmpty()) { PDBEntry entry = pdbs.firstElement(); if (ap.av.applet.jmolAvailable) { -- new jalview.appletgui.AppletJmol(entry, new SequenceI[] { seq }, -- null, ap, DataSourceType.URL); ++ new AppletJmol(entry, new SequenceI[] { seq }, null, ap, ++ DataSourceType.URL); } else { @@@ -922,7 -891,7 +938,7 @@@ cap.setPDBImport(seq); Frame frame = new Frame(); frame.add(cap); -- jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage( ++ JalviewLite.addFrame(frame, MessageManager.formatMessage( "label.paste_pdb_file_for_sequence", new Object[] { seq.getName() }), 400, 300); } @@@ -993,80 -975,50 +1009,88 @@@ colourMenu.add(strandColour); colourMenu.add(turnColour); colourMenu.add(buriedColour); - colourMenu.add(nucleotideMenuItem); + colourMenu.add(nucleotideColour); + colourMenu.add(purinePyrimidineColour); colourMenu.add(userDefinedColour); colourMenu.addSeparator(); - colourMenu.add(abovePIDColour); + colourMenu.add(conservationColour); ++ colourMenu.add(modifyConservation); + colourMenu.add(abovePIDColour); + colourMenu.add(modifyPID); - colourMenu.add(conservationMenuItem); - colourMenu.add(modifyConservation); - noColourmenuItem.setLabel(MessageManager.getString("label.none")); - noColourmenuItem.addActionListener(this); + noColour.setLabel(MessageManager.getString("label.none")); + noColour.addItemListener(this); + /* + * setName allows setSelectedColour to do its thing + */ clustalColour.setLabel(MessageManager - .getString("label.clustalx_colours")); - clustalColour.addActionListener(this); - zappoColour.setLabel(MessageManager.getString("label.zappo")); - zappoColour.addActionListener(this); - taylorColour.setLabel(MessageManager.getString("label.taylor")); - taylorColour.addActionListener(this); + .getString("label.colourScheme_clustal")); + clustalColour.setName(JalviewColourScheme.Clustal.toString()); + clustalColour.addItemListener(this); + BLOSUM62Colour.setLabel(MessageManager + .getString("label.colourScheme_blosum62")); + BLOSUM62Colour.setName(JalviewColourScheme.Blosum62.toString()); + BLOSUM62Colour.addItemListener(this); + PIDColour.setLabel(MessageManager + .getString("label.colourScheme_%_identity")); + PIDColour.setName(JalviewColourScheme.PID.toString()); + PIDColour.addItemListener(this); + zappoColour.setLabel(MessageManager + .getString("label.colourScheme_zappo")); + zappoColour.setName(JalviewColourScheme.Zappo.toString()); + zappoColour.addItemListener(this); + taylorColour.setLabel(MessageManager + .getString("label.colourScheme_taylor")); + taylorColour.setName(JalviewColourScheme.Taylor.toString()); + taylorColour.addItemListener(this); hydrophobicityColour.setLabel(MessageManager - .getString("label.hydrophobicity")); - hydrophobicityColour.addActionListener(this); - helixColour - .setLabel(MessageManager.getString("label.helix_propensity")); - helixColour.addActionListener(this); + .getString("label.colourScheme_hydrophobic")); + hydrophobicityColour + .setName(JalviewColourScheme.Hydrophobic.toString()); + hydrophobicityColour.addItemListener(this); + helixColour.setLabel(MessageManager + .getString("label.colourScheme_helix_propensity")); + helixColour.setName(JalviewColourScheme.Helix.toString()); + helixColour.addItemListener(this); strandColour.setLabel(MessageManager - .getString("label.strand_propensity")); - strandColour.addActionListener(this); - turnColour.setLabel(MessageManager.getString("label.turn_propensity")); - turnColour.addActionListener(this); - buriedColour.setLabel(MessageManager.getString("label.buried_index")); - buriedColour.addActionListener(this); - abovePIDColour.setLabel(MessageManager - .getString("label.above_identity_percentage")); + .getString("label.colourScheme_strand_propensity")); + strandColour.setName(JalviewColourScheme.Strand.toString()); + strandColour.addItemListener(this); + turnColour.setLabel(MessageManager + .getString("label.colourScheme_turn_propensity")); + turnColour.setName(JalviewColourScheme.Turn.toString()); + turnColour.addItemListener(this); + buriedColour.setLabel(MessageManager + .getString("label.colourScheme_buried_index")); + buriedColour.setName(JalviewColourScheme.Buried.toString()); + buriedColour.addItemListener(this); + nucleotideColour.setLabel(MessageManager + .getString("label.colourScheme_nucleotide")); + nucleotideColour.setName(JalviewColourScheme.Nucleotide.toString()); + nucleotideColour.addItemListener(this); + purinePyrimidineColour.setLabel(MessageManager + .getString("label.colourScheme_purine/pyrimidine")); + purinePyrimidineColour.setName(JalviewColourScheme.PurinePyrimidine + .toString()); + purinePyrimidineColour.addItemListener(this); userDefinedColour.setLabel(MessageManager .getString("action.user_defined")); userDefinedColour.addActionListener(this); - PIDColour.setLabel(MessageManager - .getString("label.percentage_identity")); - PIDColour.addActionListener(this); - BLOSUM62Colour.setLabel("BLOSUM62"); - BLOSUM62Colour.addActionListener(this); - conservationMenuItem.setLabel(MessageManager - .getString("label.conservation")); + + abovePIDColour.setLabel(MessageManager + .getString("label.above_identity_threshold")); + abovePIDColour.addItemListener(this); ++ modifyPID.setLabel(MessageManager ++ .getString("label.modify_identity_threshold")); ++ modifyPID.addActionListener(this); + conservationColour.setLabel(MessageManager - .getString("label.conservation")); ++ .getString("action.by_conservation")); + conservationColour.addItemListener(this); ++ modifyConservation.setLabel(MessageManager ++ .getString("label.modify_conservation_threshold")); ++ modifyConservation.addActionListener(this); editMenu.add(copy); copy.addActionListener(this); @@@ -1256,9 -1202,10 +1280,10 @@@ else // remove ConservationColouring { + SliderPanel.hideConservationSlider(); sg.cs.setConservation(null); } - - modifyConservation.setEnabled(conservationMenuItem.getState()); ++ modifyConservation.setEnabled(conservationColour.getState()); refresh(); } diff --cc src/jalview/appletgui/SliderPanel.java index 35c2a22,5ee665a..5179eb0 --- a/src/jalview/appletgui/SliderPanel.java +++ b/src/jalview/appletgui/SliderPanel.java @@@ -122,7 -125,7 +125,7 @@@ public class SliderPanel extends Panel SliderPanel pid = null; if (PIDSlider == null) { -- pid = new SliderPanel(ap, 50, false, cs); ++ pid = new SliderPanel(ap, cs.getThreshold(), false, cs); PIDSlider = new Frame(); PIDSlider.add(pid); } @@@ -174,6 -178,17 +178,29 @@@ } ++ /** ++ * Hides the PID slider panel if it is shown ++ */ + public static void hidePIDSlider() + { - PIDSlider.setVisible(false); ++ if (PIDSlider != null) ++ { ++ PIDSlider.setVisible(false); ++ } + PIDSlider = null; + } + ++ /** ++ * Hides the Conservation slider panel if it is shown ++ */ + public static void hideConservationSlider() + { - conservationSlider.setVisible(false); ++ if (conservationSlider != null) ++ { ++ conservationSlider.setVisible(false); ++ } + conservationSlider = null; + } public SliderPanel(AlignmentPanel ap, int value, boolean forConserve, ColourSchemeI cs) { diff --cc src/jalview/gui/AlignFrame.java index 514d486,44a2318..40ab6bb --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@@ -845,9 -857,12 +845,10 @@@ public class AlignFrame extends GAlignF showReverse.setVisible(nucleotide); showReverseComplement.setVisible(nucleotide); conservationMenuItem.setEnabled(!nucleotide); -- modifyConservation.setEnabled(!nucleotide); ++ modifyConservation.setEnabled(!nucleotide ++ && conservationMenuItem.isSelected()); showGroupConservation.setEnabled(!nucleotide); - rnahelicesColour.setEnabled(nucleotide); - nucleotideColour.setEnabled(nucleotide); - purinePyrimidineColour.setEnabled(nucleotide); - RNAInteractionColour.setEnabled(nucleotide); + showComplementMenuItem.setText(nucleotide ? MessageManager .getString("label.protein") : MessageManager .getString("label.nucleotide")); diff --cc src/jalview/gui/PopupMenu.java index ac2fbc2,3a99f9e..310266e --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@@ -85,10 -94,42 +85,14 @@@ public class PopupMenu extends JPopupMe JMenuItem groupName = new JMenuItem(); - protected JRadioButtonMenuItem clustalColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem hydrophobicityColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem userDefinedColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem PIDColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem RNAInteractionColour = new JRadioButtonMenuItem(); - - JRadioButtonMenuItem noColourmenuItem = new JRadioButtonMenuItem(); - protected JCheckBoxMenuItem abovePIDColour = new JCheckBoxMenuItem(); + protected JMenuItem modifyPID = new JMenuItem(); + protected JCheckBoxMenuItem conservationMenuItem = new JCheckBoxMenuItem(); + protected JMenuItem modifyConservation = new JMenuItem(); + AlignmentPanel ap; JMenu sequenceMenu = new JMenu(); @@@ -982,6 -1097,7 +986,7 @@@ sequenceSelectionDetails_actionPerformed(); } }); - PIDColour.setFocusPainted(false); ++ unGroupMenuItem .setText(MessageManager.getString("action.remove_group")); unGroupMenuItem.addActionListener(new ActionListener() @@@ -1230,25 -1407,138 +1235,26 @@@ jMenu1.add(showColourText); jMenu1.add(outline); jMenu1.add(displayNonconserved); - noColourmenuItem.setText(MessageManager.getString("label.none")); - noColourmenuItem.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - noColourmenuItem_actionPerformed(); - } - }); - - clustalColour.setText(MessageManager - .getString("label.clustalx_colours")); - clustalColour.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - clustalColour_actionPerformed(); - } - }); - zappoColour.setText(MessageManager.getString("label.zappo")); - zappoColour.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - zappoColour_actionPerformed(); - } - }); - taylorColour.setText(MessageManager.getString("label.taylor")); - taylorColour.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - taylorColour_actionPerformed(); - } - }); - hydrophobicityColour.setText(MessageManager - .getString("label.hydrophobicity")); - hydrophobicityColour.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - hydrophobicityColour_actionPerformed(); - } - }); - helixColour.setText(MessageManager.getString("label.helix_propensity")); - helixColour.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - helixColour_actionPerformed(); - } - }); - strandColour.setText(MessageManager - .getString("label.strand_propensity")); - strandColour.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - strandColour_actionPerformed(); - } - }); - turnColour.setText(MessageManager.getString("label.turn_propensity")); - turnColour.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - turnColour_actionPerformed(); - } - }); - buriedColour.setText(MessageManager.getString("label.buried_index")); - buriedColour.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - buriedColour_actionPerformed(); - } - }); - userDefinedColour.setText(MessageManager - .getString("action.user_defined")); - userDefinedColour.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - userDefinedColour_actionPerformed(e); - } - }); - PIDColour - .setText(MessageManager.getString("label.percentage_identity")); - PIDColour.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - PIDColour_actionPerformed(); - } - }); - BLOSUM62Colour.setText(MessageManager.getString("label.blosum62")); - BLOSUM62Colour.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - BLOSUM62Colour_actionPerformed(); - } - }); - purinePyrimidineColour.setText(MessageManager - .getString("label.purine_pyrimidine")); - purinePyrimidineColour.addActionListener(new ActionListener() + } - ++ + /** + * Constructs the entries for the colour menu + */ + protected void initColourMenu() + { + colourMenu.setText(MessageManager.getString("label.group_colour")); + textColour.setText(MessageManager.getString("label.text_colour")); + textColour.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - purinePyrimidineColour_actionPerformed(); + textColour_actionPerformed(); } }); + - /* - * covariationColour.addActionListener(new ActionListener() { - * public void actionPerformed(ActionEvent e) { - * covariationColour_actionPerformed(); } }); - */ abovePIDColour.setText(MessageManager - .getString("label.above_identity_percentage")); + .getString("label.above_identity_threshold")); abovePIDColour.addActionListener(new ActionListener() { @Override @@@ -1258,8 -1548,19 +1264,19 @@@ } }); + modifyPID.setText(MessageManager + .getString("label.modify_identity_threshold")); + modifyPID.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + modifyPID_actionPerformed(); + } + }); + conservationMenuItem.setText(MessageManager - .getString("label.conservation")); + .getString("action.by_conservation")); conservationMenuItem.addActionListener(new ActionListener() { @Override @@@ -1268,31 -1569,41 +1285,68 @@@ conservationMenuItem_actionPerformed(); } }); + + modifyConservation.setText(MessageManager + .getString("label.modify_conservation_threshold")); + modifyConservation.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + modifyConservation_actionPerformed(); + } + }); } + /** + * Builds the group colour sub-menu, including any user-defined colours which + * were loaded at startup or during the Jalview session + */ + protected void buildColourMenu() + { + SequenceGroup sg = ap.av.getSelectionGroup(); + if (sg == null) + { + /* + * popup menu with no sequence group scope + */ + return; + } + colourMenu.removeAll(); + colourMenu.add(textColour); + colourMenu.addSeparator(); + + ColourMenuHelper.addMenuItems(colourMenu, this, sg, false); + + colourMenu.addSeparator(); + colourMenu.add(conservationMenuItem); ++ colourMenu.add(modifyConservation); + colourMenu.add(abovePIDColour); ++ colourMenu.add(modifyPID); ++ } ++ + protected void modifyConservation_actionPerformed() + { + SequenceGroup sg = getGroup(); + if (sg.cs != null) + { + SliderPanel.setConservationSlider(ap, sg.cs, sg.getName()); + SliderPanel.showConservationSlider(); + } + } + + protected void modifyPID_actionPerformed() + { + SequenceGroup sg = getGroup(); + if (sg.cs != null) + { + // int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup() + // .getName()); + // sg.cs.setThreshold(threshold, ap.av.isIgnoreGapsConsensus()); + SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup() + .getName()); + SliderPanel.showPIDSlider(); + } } /** diff --cc src/jalview/gui/SliderPanel.java index a381e8b,af77c48..83193dc --- a/src/jalview/gui/SliderPanel.java +++ b/src/jalview/gui/SliderPanel.java @@@ -157,7 -159,29 +159,41 @@@ public class SliderPanel extends GSlide return sp.getValue(); } + /** ++ * Hides the PID slider panel if it is shown ++ */ + public static void hidePIDSlider() + { - try - { - PIDSlider.setClosed(true); - PIDSlider = null; - } catch (PropertyVetoException ex) ++ if (PIDSlider != null) + { ++ try ++ { ++ PIDSlider.setClosed(true); ++ PIDSlider = null; ++ } catch (PropertyVetoException ex) ++ { ++ } + } + } + ++ /** ++ * Hides the conservation slider panel if it is shown ++ */ + public static void hideConservationSlider() + { - try - { - conservationSlider.setClosed(true); - conservationSlider = null; - } catch (PropertyVetoException ex) ++ if (conservationSlider != null) + { ++ try ++ { ++ conservationSlider.setClosed(true); ++ conservationSlider = null; ++ } catch (PropertyVetoException ex) ++ { ++ } + } + } + + /** * DOCUMENT ME! */ public static void showConservationSlider() diff --cc src/jalview/jbgui/GAlignFrame.java index a320a9c,6530d3d..c8aa94f --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@@ -65,8 -66,8 +65,6 @@@ public class GAlignFrame extends JInter protected JMenuItem closeMenuItem = new JMenuItem(); -- protected JMenu colourMenu = new JMenu(); -- protected JMenu webService = new JMenu(); protected JMenuItem webServiceNoServices; @@@ -81,26 -82,59 +79,20 @@@ protected JMenu outputTextboxMenu = new JMenu(); - protected JRadioButtonMenuItem textColour; - - protected JRadioButtonMenuItem clustalColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem hydrophobicityColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem userDefinedColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem PIDColour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem(); + protected JCheckBoxMenuItem annotationPanelMenuItem = new JCheckBoxMenuItem(); - protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem(); + protected JCheckBoxMenuItem colourTextMenuItem = new JCheckBoxMenuItem(); - protected JRadioButtonMenuItem RNAInteractionColour = new JRadioButtonMenuItem(); - - // protected JRadioButtonMenuItem covariationColour = new - // JRadioButtonMenuItem(); - - protected JRadioButtonMenuItem tcoffeeColour = new JRadioButtonMenuItem(); - - public JCheckBoxMenuItem annotationPanelMenuItem = new JCheckBoxMenuItem(); - - public JCheckBoxMenuItem colourTextMenuItem = new JCheckBoxMenuItem(); - - public JCheckBoxMenuItem showNonconservedMenuItem = new JCheckBoxMenuItem(); + protected JCheckBoxMenuItem showNonconservedMenuItem = new JCheckBoxMenuItem(); protected JMenuItem undoMenuItem = new JMenuItem(); protected JMenuItem redoMenuItem = new JMenuItem(); - protected JCheckBoxMenuItem conservationMenuItem; - - public JCheckBoxMenuItem conservationMenuItem = new JCheckBoxMenuItem(); - - JRadioButtonMenuItem noColourmenuItem = new JRadioButtonMenuItem(); + protected JCheckBoxMenuItem wrapMenuItem = new JCheckBoxMenuItem(); - public JCheckBoxMenuItem wrapMenuItem = new JCheckBoxMenuItem(); - - public JCheckBoxMenuItem renderGapsMenuItem = new JCheckBoxMenuItem(); - - public JCheckBoxMenuItem abovePIDThreshold = new JCheckBoxMenuItem(); + protected JCheckBoxMenuItem renderGapsMenuItem = new JCheckBoxMenuItem(); - protected JCheckBoxMenuItem abovePIDThreshold; - public JCheckBoxMenuItem showSeqFeatures = new JCheckBoxMenuItem(); JMenuItem copy = new JMenuItem(); @@@ -109,21 -143,19 +101,29 @@@ JMenu pasteMenu = new JMenu(); - protected JCheckBoxMenuItem applyToAllGroups; - - public JCheckBoxMenuItem applyToAllGroups = new JCheckBoxMenuItem(); + protected JCheckBoxMenuItem seqLimits = new JCheckBoxMenuItem(); + + protected JCheckBoxMenuItem scaleAbove = new JCheckBoxMenuItem(); - public JCheckBoxMenuItem seqLimits = new JCheckBoxMenuItem(); + protected JCheckBoxMenuItem scaleLeft = new JCheckBoxMenuItem(); - public JCheckBoxMenuItem scaleAbove = new JCheckBoxMenuItem(); + protected JCheckBoxMenuItem scaleRight = new JCheckBoxMenuItem(); + - protected JMenuItem modifyPID; ++ protected JCheckBoxMenuItem applyToAllGroups; ++ ++ protected JMenu colourMenu = new JMenu(); + - public JCheckBoxMenuItem scaleLeft = new JCheckBoxMenuItem(); ++ protected JRadioButtonMenuItem textColour; + - public JCheckBoxMenuItem scaleRight = new JCheckBoxMenuItem(); ++ protected JCheckBoxMenuItem conservationMenuItem; - protected JMenuItem modifyConservation = new JMenuItem(); + protected JMenuItem modifyConservation; - protected JMenuItem modifyPID = new JMenuItem(); ++ protected JCheckBoxMenuItem abovePIDThreshold; ++ ++ protected JMenuItem modifyPID; ++ + protected JMenuItem annotationColour; protected JMenu sortByTreeMenu = new JMenu(); @@@ -752,6 -1113,25 +752,17 @@@ }; addMenuActionAndAccelerator(keyStroke, redoMenuItem, al); + conservationMenuItem.setText(MessageManager + .getString("action.by_conservation")); + conservationMenuItem.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + conservationMenuItem_actionPerformed(); + } + }); - noColourmenuItem.setText(MessageManager.getString("label.none")); - noColourmenuItem.addActionListener(new ActionListener() - { - @Override - public void actionPerformed(ActionEvent e) - { - noColourmenuItem_actionPerformed(e); - } - }); ++ wrapMenuItem.setText(MessageManager.getString("label.wrap")); wrapMenuItem.addActionListener(new ActionListener() { @@@ -804,6 -1184,16 +815,17 @@@ }; addMenuActionAndAccelerator(keyStroke, findMenuItem, al); + abovePIDThreshold.setText(MessageManager + .getString("label.above_identity_threshold")); + abovePIDThreshold.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + abovePIDThreshold_actionPerformed(); + } + }); ++ showSeqFeatures.setText(MessageManager .getString("label.show_sequence_features")); showSeqFeatures.addActionListener(new ActionListener() @@@ -1195,6 -1606,26 +1217,27 @@@ }); + modifyPID = new JMenuItem( + MessageManager.getString("label.modify_identity_threshold")); + modifyPID.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + modifyPID_actionPerformed(); + } + }); + modifyConservation.setText(MessageManager + .getString("label.modify_conservation_threshold")); + modifyConservation.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + modifyConservation_actionPerformed(); + } + }); ++ sortByTreeMenu .setText(MessageManager.getString("action.by_tree_order")); sort.setText(MessageManager.getString("action.sort")); diff --cc src/jalview/util/ParseHtmlBodyAndLinks.java index f1b83b8,f1b83b8..139ee19 --- a/src/jalview/util/ParseHtmlBodyAndLinks.java +++ b/src/jalview/util/ParseHtmlBodyAndLinks.java @@@ -97,12 -97,12 +97,12 @@@ public class ParseHtmlBodyAndLink public ParseHtmlBodyAndLinks(String description, boolean removeHTML, String newline) { -- StringBuilder sb = new StringBuilder(description.length()); if (description == null || description.length() == 0) { htmlContent = false; return; } ++ StringBuilder sb = new StringBuilder(description.length()); if (description.toUpperCase().indexOf("") == -1) { htmlContent = false;