X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fappletgui%2FAPopupMenu.java;h=6299c626ee28783a778553b8fa39d922037e8238;hb=406c75985c3585f3c6bf8d6f4778d9fb28c7bf2c;hp=018b227dad487f49c5d24069d7063f0ff33ca947;hpb=fd7eebe6dcf2346692d718ef91bb468cc12ebf44;p=jalview.git
diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java
index 018b227..6299c62 100644
--- a/src/jalview/appletgui/APopupMenu.java
+++ b/src/jalview/appletgui/APopupMenu.java
@@ -20,6 +20,25 @@
*/
package jalview.appletgui;
+import java.awt.CheckboxMenuItem;
+import java.awt.Frame;
+import java.awt.Menu;
+import java.awt.MenuItem;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.Vector;
+
import jalview.analysis.AAFrequency;
import jalview.analysis.AlignmentAnnotationUtils;
import jalview.analysis.AlignmentUtils;
@@ -39,11 +58,11 @@ import jalview.io.DataSourceType;
import jalview.io.FileFormatI;
import jalview.io.FileFormats;
import jalview.io.SequenceAnnotationReport;
+import jalview.renderer.ResidueShader;
+import jalview.renderer.ResidueShaderI;
import jalview.schemes.Blosum62ColourScheme;
import jalview.schemes.BuriedColourScheme;
import jalview.schemes.ClustalxColourScheme;
-import jalview.schemes.CollectionColourScheme;
-import jalview.schemes.CollectionColourSchemeI;
import jalview.schemes.HelixColourScheme;
import jalview.schemes.HydrophobicColourScheme;
import jalview.schemes.JalviewColourScheme;
@@ -57,26 +76,8 @@ import jalview.schemes.ZappoColourScheme;
import jalview.util.MessageManager;
import jalview.util.UrlLink;
-import java.awt.CheckboxMenuItem;
-import java.awt.Frame;
-import java.awt.Menu;
-import java.awt.MenuItem;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import java.util.Vector;
-
-public class APopupMenu extends java.awt.PopupMenu implements
- ActionListener, ItemListener
+public class APopupMenu extends java.awt.PopupMenu
+ implements ActionListener, ItemListener
{
Menu groupMenu = new Menu();
@@ -210,7 +211,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
Menu menu1 = new Menu();
public APopupMenu(AlignmentPanel apanel, final SequenceI seq,
- Vector links)
+ List links)
{
// /////////////////////////////////////////////////////////
// If this is activated from the sequence panel, the user may want to
@@ -243,8 +244,27 @@ public class APopupMenu extends java.awt.PopupMenu implements
SequenceGroup sg = ap.av.getSelectionGroup();
if (sg != null && sg.getSize() > 0)
{
- editGroupName.setLabel(MessageManager.formatMessage(
- "label.name_param", new Object[] { sg.getName() }));
+ if (sg.isNucleotide())
+ {
+ conservationColour.setEnabled(false);
+ clustalColour.setEnabled(false);
+ BLOSUM62Colour.setEnabled(false);
+ zappoColour.setEnabled(false);
+ taylorColour.setEnabled(false);
+ hydrophobicityColour.setEnabled(false);
+ helixColour.setEnabled(false);
+ strandColour.setEnabled(false);
+ turnColour.setEnabled(false);
+ buriedColour.setEnabled(false);
+ }
+ else
+ {
+ purinePyrimidineColour.setEnabled(false);
+ nucleotideColour.setEnabled(false);
+ }
+ editGroupName.setLabel(
+ MessageManager.formatMessage("label.name_param", new Object[]
+ { sg.getName() }));
showText.setState(sg.getDisplayText());
showColourText.setState(sg.getColourText());
showBoxes.setState(sg.getDisplayBoxes());
@@ -285,17 +305,18 @@ public class APopupMenu extends java.awt.PopupMenu implements
seqMenu.setLabel(seq.getName());
if (seq == ap.av.getAlignment().getSeqrep())
{
- makeReferenceSeq.setLabel(MessageManager
- .getString("action.unmark_as_reference"));// Unmark
- // representative");
+ makeReferenceSeq.setLabel(
+ MessageManager.getString("action.unmark_as_reference"));// Unmark
+ // representative");
}
else
{
- makeReferenceSeq.setLabel(MessageManager
- .getString("action.set_as_reference")); // );
+ makeReferenceSeq.setLabel(
+ MessageManager.getString("action.set_as_reference")); // );
}
- repGroup.setLabel(MessageManager.formatMessage(
- "label.represent_group_with", new Object[] { seq.getName() }));
+ repGroup.setLabel(MessageManager
+ .formatMessage("label.represent_group_with", new Object[]
+ { seq.getName() }));
}
else
{
@@ -330,7 +351,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
*
* @param cs
*/
- protected void setSelectedColour(CollectionColourSchemeI cs)
+ protected void setSelectedColour(ResidueShaderI cs)
{
if (cs == null || cs.getColourScheme() == null)
{
@@ -362,7 +383,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
void addFeatureLinks(final SequenceI seq, List links)
{
Menu linkMenu = new Menu(MessageManager.getString("action.link"));
- Map> linkset = new LinkedHashMap>();
+ Map> linkset = new LinkedHashMap<>();
for (String link : links)
{
@@ -427,8 +448,9 @@ public class APopupMenu extends java.awt.PopupMenu implements
/*
* First for the currently selected sequence (if there is one):
*/
- final List selectedSequence = (seq == null ? Collections
- . emptyList() : Arrays.asList(seq));
+ final List selectedSequence = (seq == null
+ ? Collections. emptyList()
+ : Arrays.asList(seq));
buildAnnotationTypesMenus(seqShowAnnotationsMenu,
seqHideAnnotationsMenu, selectedSequence);
configureReferenceAnnotationsMenu(seqAddReferenceAnnotations,
@@ -437,9 +459,9 @@ public class APopupMenu extends java.awt.PopupMenu implements
/*
* and repeat for the current selection group (if there is one):
*/
- final List selectedGroup = (ap.av.getSelectionGroup() == null ? Collections
- . emptyList() : ap.av.getSelectionGroup()
- .getSequences());
+ final List selectedGroup = (ap.av.getSelectionGroup() == null
+ ? Collections. emptyList()
+ : ap.av.getSelectionGroup().getSequences());
buildAnnotationTypesMenus(groupShowAnnotationsMenu,
groupHideAnnotationsMenu, selectedGroup);
configureReferenceAnnotationsMenu(groupAddReferenceAnnotations,
@@ -463,11 +485,11 @@ public class APopupMenu extends java.awt.PopupMenu implements
* Temporary store to hold distinct calcId / type pairs for the tooltip.
* Using TreeMap means calcIds are shown in alphabetical order.
*/
- SortedMap tipEntries = new TreeMap();
- final Map> candidates = new LinkedHashMap>();
+ SortedMap tipEntries = new TreeMap<>();
+ final Map> candidates = new LinkedHashMap<>();
AlignmentI al = this.ap.av.getAlignment();
- AlignmentUtils.findAddableReferenceAnnotations(forSequences,
- tipEntries, candidates, al);
+ AlignmentUtils.findAddableReferenceAnnotations(forSequences, tipEntries,
+ candidates, al);
if (!candidates.isEmpty())
{
StringBuilder tooltip = new StringBuilder(64);
@@ -732,9 +754,10 @@ public class APopupMenu extends java.awt.PopupMenu implements
seq = sg.getSequenceAt(0);
}
- EditNameDialog dialog = new EditNameDialog(seq.getSequenceAsString(
- sg.getStartRes(), sg.getEndRes() + 1), null,
- "Edit Sequence ", null,
+ EditNameDialog dialog = new EditNameDialog(
+ seq.getSequenceAsString(sg.getStartRes(),
+ sg.getEndRes() + 1),
+ null, "Edit Sequence ", null,
ap.alignFrame, "Edit Sequence", 500, 100, true);
@@ -742,16 +765,16 @@ public class APopupMenu extends java.awt.PopupMenu implements
{
EditCommand editCommand = new EditCommand(
MessageManager.getString("label.edit_sequences"),
- Action.REPLACE, dialog.getName().replace(' ',
- ap.av.getGapCharacter()),
+ Action.REPLACE,
+ dialog.getName().replace(' ', ap.av.getGapCharacter()),
sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
sg.getStartRes(), sg.getEndRes() + 1,
ap.av.getAlignment());
ap.alignFrame.addHistoryItem(editCommand);
- ap.av.firePropertyChange("alignment", null, ap.av.getAlignment()
- .getSequences());
+ ap.av.firePropertyChange("alignment", null,
+ ap.av.getAlignment().getSequences());
}
}
}
@@ -788,8 +811,8 @@ public class APopupMenu extends java.awt.PopupMenu implements
ap.alignFrame.addHistoryItem(caseCommand);
- ap.av.firePropertyChange("alignment", null, ap.av.getAlignment()
- .getSequences());
+ ap.av.firePropertyChange("alignment", null,
+ ap.av.getAlignment().getSequences());
}
}
@@ -801,9 +824,9 @@ public class APopupMenu extends java.awt.PopupMenu implements
return;
}
- int rsize = 0, gSize = sg.getSize();
- SequenceI[] rseqs, seqs = new SequenceI[gSize];
- SequenceFeature[] tfeatures, features = new SequenceFeature[gSize];
+ int gSize = sg.getSize();
+ List seqs = new ArrayList<>();
+ List features = new ArrayList<>();
for (int i = 0; i < gSize; i++)
{
@@ -811,26 +834,22 @@ public class APopupMenu extends java.awt.PopupMenu implements
int end = sg.findEndRes(sg.getSequenceAt(i));
if (start <= end)
{
- seqs[rsize] = sg.getSequenceAt(i);
- features[rsize] = new SequenceFeature(null, null, null, start,
- end, "Jalview");
- rsize++;
+ seqs.add(sg.getSequenceAt(i));
+ features.add(new SequenceFeature(null, null, start, end,
+ "Jalview"));
}
}
- rseqs = new SequenceI[rsize];
- tfeatures = new SequenceFeature[rsize];
- System.arraycopy(seqs, 0, rseqs, 0, rsize);
- System.arraycopy(features, 0, tfeatures, 0, rsize);
- features = tfeatures;
- seqs = rseqs;
-
- if (ap.seqPanel.seqCanvas.getFeatureRenderer().amendFeatures(seqs,
- features, true, ap))
+
+ if (!seqs.isEmpty())
{
- ap.alignFrame.sequenceFeatures.setState(true);
- ap.av.setShowSequenceFeatures(true);
- ;
- ap.highlightSearchResults(null);
+ if (ap.seqPanel.seqCanvas.getFeatureRenderer().amendFeatures(seqs,
+ features, true, ap))
+ {
+ ap.alignFrame.sequenceFeatures.setState(true);
+ ap.av.setShowSequenceFeatures(true);
+ ap.av.setSearchResults(null); // clear highlighting
+ ap.repaint(); // draw new/amended features
+ }
}
}
else
@@ -846,15 +865,15 @@ public class APopupMenu extends java.awt.PopupMenu implements
Frame frame = new Frame();
frame.add(cap);
- JalviewLite.addFrame(frame, MessageManager.formatMessage(
- "label.selection_output_command",
- new Object[] { e.getActionCommand() }), 600, 500);
+ JalviewLite.addFrame(frame, MessageManager
+ .formatMessage("label.selection_output_command", new Object[]
+ { e.getActionCommand() }), 600, 500);
// JBPNote: getSelectionAsNewSequence behaviour has changed - this method
// now returns a full copy of sequence data
// TODO consider using getSequenceSelection instead here
- FileFormatI fileFormat = FileFormats.getInstance().forName(
- e.getActionCommand());
+ FileFormatI fileFormat = FileFormats.getInstance()
+ .forName(e.getActionCommand());
cap.setText(new AppletFormatAdapter().formatSequences(fileFormat,
ap.av.getShowJVSuffix(), ap, true));
@@ -878,25 +897,23 @@ public class APopupMenu extends java.awt.PopupMenu implements
StringBuilder contents = new StringBuilder(128);
for (SequenceI seq : sequences)
{
- contents.append(MessageManager.formatMessage(
- "label.annotation_for_displayid",
- new Object[] { seq.getDisplayId(true) }));
- new SequenceAnnotationReport(null).createSequenceAnnotationReport(
- contents,
- seq,
- true,
- true,
- (ap.seqPanel.seqCanvas.fr != null) ? ap.seqPanel.seqCanvas.fr
- .getMinMax() : null);
+ contents.append(MessageManager
+ .formatMessage("label.annotation_for_displayid", new Object[]
+ { seq.getDisplayId(true) }));
+ new SequenceAnnotationReport(false).createSequenceAnnotationReport(
+ contents, seq, true, true, ap.seqPanel.seqCanvas.fr);
contents.append("
");
}
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame, "Sequence Details for "
- + (sequences.length == 1 ? sequences[0].getDisplayId(true)
- : "Selection"), 600, 500);
- cap.setText(MessageManager.formatMessage("label.html_content",
- new Object[] { contents.toString() }));
+ jalview.bin.JalviewLite.addFrame(frame,
+ "Sequence Details for " + (sequences.length == 1
+ ? sequences[0].getDisplayId(true)
+ : "Selection"),
+ 600, 500);
+ cap.setText(
+ MessageManager.formatMessage("label.html_content", new Object[]
+ { contents.toString() }));
}
void editName()
@@ -910,7 +927,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
{
seq.setName(dialog.getName());
seq.setDescription(dialog.getDescription());
- ap.paintAlignment(false);
+ ap.paintAlignment(false, false);
}
}
@@ -928,21 +945,22 @@ public class APopupMenu extends java.awt.PopupMenu implements
}
else
{
- new MCview.AppletPDBViewer(entry, new SequenceI[] { seq }, null,
- ap, DataSourceType.URL);
+ new MCview.AppletPDBViewer(entry, new SequenceI[] { seq }, null, ap,
+ DataSourceType.URL);
}
}
else
{
- CutAndPasteTransfer cap = new CutAndPasteTransfer(true, ap.alignFrame);
+ CutAndPasteTransfer cap = new CutAndPasteTransfer(true,
+ ap.alignFrame);
cap.setText(MessageManager.getString("label.paste_pdb_file"));
cap.setPDBImport(seq);
Frame frame = new Frame();
frame.add(cap);
JalviewLite.addFrame(frame, MessageManager.formatMessage(
- "label.paste_pdb_file_for_sequence",
- new Object[] { seq.getName() }), 400, 300);
+ "label.paste_pdb_file_for_sequence", new Object[]
+ { seq.getName() }), 400, 300);
}
}
@@ -952,12 +970,12 @@ public class APopupMenu extends java.awt.PopupMenu implements
sequenceFeature.addActionListener(this);
editGroupName.addActionListener(this);
- unGroupMenuItem.setLabel(MessageManager
- .getString("action.remove_group"));
+ unGroupMenuItem
+ .setLabel(MessageManager.getString("action.remove_group"));
unGroupMenuItem.addActionListener(this);
- createGroupMenuItem.setLabel(MessageManager
- .getString("action.create_group"));
+ createGroupMenuItem
+ .setLabel(MessageManager.getString("action.create_group"));
createGroupMenuItem.addActionListener(this);
modifyPID.setEnabled(abovePIDColour.getState());
@@ -969,8 +987,8 @@ public class APopupMenu extends java.awt.PopupMenu implements
sequenceName.addActionListener(this);
sequenceDetails.addActionListener(this);
selSeqDetails.addActionListener(this);
- displayNonconserved.setLabel(MessageManager
- .getString("label.show_non_conserved"));
+ displayNonconserved
+ .setLabel(MessageManager.getString("label.show_non_conserved"));
displayNonconserved.setState(false);
displayNonconserved.addItemListener(this);
showText.setLabel(MessageManager.getString("action.text"));
@@ -981,8 +999,9 @@ public class APopupMenu extends java.awt.PopupMenu implements
seqMenu.setLabel(MessageManager.getString("label.sequence"));
pdb.setLabel(MessageManager.getString("label.view_pdb_structure"));
hideSeqs.setLabel(MessageManager.getString("action.hide_sequences"));
- repGroup.setLabel(MessageManager.formatMessage(
- "label.represent_group_with", new Object[] { "" }));
+ repGroup.setLabel(MessageManager
+ .formatMessage("label.represent_group_with", new Object[]
+ { "" }));
revealAll.setLabel(MessageManager.getString("action.reveal_all"));
revealSeq.setLabel(MessageManager.getString("action.reveal_sequences"));
menu1.setLabel(MessageManager.getString("label.group:"));
@@ -1028,28 +1047,28 @@ public class APopupMenu extends java.awt.PopupMenu implements
/*
* setName allows setSelectedColour to do its thing
*/
- clustalColour.setLabel(MessageManager
- .getString("label.colourScheme_clustal"));
+ clustalColour.setLabel(
+ MessageManager.getString("label.colourScheme_clustal"));
clustalColour.setName(JalviewColourScheme.Clustal.toString());
clustalColour.addItemListener(this);
- BLOSUM62Colour.setLabel(MessageManager
- .getString("label.colourScheme_blosum62"));
+ BLOSUM62Colour.setLabel(
+ MessageManager.getString("label.colourScheme_blosum62"));
BLOSUM62Colour.setName(JalviewColourScheme.Blosum62.toString());
BLOSUM62Colour.addItemListener(this);
- PIDColour.setLabel(MessageManager
- .getString("label.colourScheme_%_identity"));
+ PIDColour.setLabel(
+ MessageManager.getString("label.colourScheme_%_identity"));
PIDColour.setName(JalviewColourScheme.PID.toString());
PIDColour.addItemListener(this);
- zappoColour.setLabel(MessageManager
- .getString("label.colourScheme_zappo"));
+ zappoColour
+ .setLabel(MessageManager.getString("label.colourScheme_zappo"));
zappoColour.setName(JalviewColourScheme.Zappo.toString());
zappoColour.addItemListener(this);
- taylorColour.setLabel(MessageManager
- .getString("label.colourScheme_taylor"));
+ taylorColour.setLabel(
+ MessageManager.getString("label.colourScheme_taylor"));
taylorColour.setName(JalviewColourScheme.Taylor.toString());
taylorColour.addItemListener(this);
- hydrophobicityColour.setLabel(MessageManager
- .getString("label.colourScheme_hydrophobic"));
+ hydrophobicityColour.setLabel(
+ MessageManager.getString("label.colourScheme_hydrophobic"));
hydrophobicityColour
.setName(JalviewColourScheme.Hydrophobic.toString());
hydrophobicityColour.addItemListener(this);
@@ -1061,36 +1080,36 @@ public class APopupMenu extends java.awt.PopupMenu implements
.getString("label.colourScheme_strand_propensity"));
strandColour.setName(JalviewColourScheme.Strand.toString());
strandColour.addItemListener(this);
- turnColour.setLabel(MessageManager
- .getString("label.colourScheme_turn_propensity"));
+ 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.setLabel(
+ MessageManager.getString("label.colourScheme_buried_index"));
buriedColour.setName(JalviewColourScheme.Buried.toString());
buriedColour.addItemListener(this);
- nucleotideColour.setLabel(MessageManager
- .getString("label.colourScheme_nucleotide"));
+ 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
+ .setName(JalviewColourScheme.PurinePyrimidine.toString());
purinePyrimidineColour.addItemListener(this);
- userDefinedColour.setLabel(MessageManager
- .getString("action.user_defined"));
+ userDefinedColour
+ .setLabel(MessageManager.getString("action.user_defined"));
userDefinedColour.addActionListener(this);
- abovePIDColour.setLabel(MessageManager
- .getString("label.above_identity_threshold"));
+ abovePIDColour.setLabel(
+ MessageManager.getString("label.above_identity_threshold"));
abovePIDColour.addItemListener(this);
- modifyPID.setLabel(MessageManager
- .getString("label.modify_identity_threshold"));
+ modifyPID.setLabel(
+ MessageManager.getString("label.modify_identity_threshold"));
modifyPID.addActionListener(this);
- conservationColour.setLabel(MessageManager
- .getString("action.by_conservation"));
+ conservationColour
+ .setLabel(MessageManager.getString("action.by_conservation"));
conservationColour.addItemListener(this);
modifyConservation.setLabel(MessageManager
.getString("label.modify_conservation_threshold"));
@@ -1141,69 +1160,68 @@ public class APopupMenu extends java.awt.PopupMenu implements
void refresh()
{
- ap.paintAlignment(true);
+ ap.paintAlignment(true, true);
}
protected void clustalColour_actionPerformed()
{
SequenceGroup sg = getGroup();
- sg.cs = new CollectionColourScheme(new ClustalxColourScheme(sg,
- ap.av.getHiddenRepSequences()));
+ sg.cs = new ResidueShader(
+ new ClustalxColourScheme(sg, ap.av.getHiddenRepSequences()));
refresh();
}
protected void zappoColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new ZappoColourScheme());
+ getGroup().cs = new ResidueShader(new ZappoColourScheme());
refresh();
}
protected void taylorColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new TaylorColourScheme());
+ getGroup().cs = new ResidueShader(new TaylorColourScheme());
refresh();
}
protected void hydrophobicityColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new HydrophobicColourScheme());
+ getGroup().cs = new ResidueShader(new HydrophobicColourScheme());
refresh();
}
protected void helixColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new HelixColourScheme());
+ getGroup().cs = new ResidueShader(new HelixColourScheme());
refresh();
}
protected void strandColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new StrandColourScheme());
+ getGroup().cs = new ResidueShader(new StrandColourScheme());
refresh();
}
protected void turnColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new TurnColourScheme());
+ getGroup().cs = new ResidueShader(new TurnColourScheme());
refresh();
}
protected void buriedColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new BuriedColourScheme());
+ getGroup().cs = new ResidueShader(new BuriedColourScheme());
refresh();
}
public void nucleotideMenuItem_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new NucleotideColourScheme());
+ getGroup().cs = new ResidueShader(new NucleotideColourScheme());
refresh();
}
public void purinePyrimidineColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(
- new PurinePyrimidineColourScheme());
+ getGroup().cs = new ResidueShader(new PurinePyrimidineColourScheme());
refresh();
}
@@ -1217,10 +1235,11 @@ public class APopupMenu extends java.awt.PopupMenu implements
if (abovePIDColour.getState())
{
- sg.cs.setConsensus(AAFrequency.calculate(sg.getSequences(ap.av
- .getHiddenRepSequences()), 0, ap.av.getAlignment().getWidth()));
- int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
- .getName());
+ sg.cs.setConsensus(AAFrequency.calculate(
+ sg.getSequences(ap.av.getHiddenRepSequences()), 0,
+ ap.av.getAlignment().getWidth()));
+ int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs,
+ getGroup().getName());
sg.cs.setThreshold(threshold, ap.av.isIgnoreGapsConsensus());
@@ -1245,9 +1264,10 @@ public class APopupMenu extends java.awt.PopupMenu implements
protected void PIDColour_actionPerformed()
{
SequenceGroup sg = getGroup();
- sg.cs = new CollectionColourScheme(new PIDColourScheme());
- sg.cs.setConsensus(AAFrequency.calculate(sg.getSequences(ap.av
- .getHiddenRepSequences()), 0, ap.av.getAlignment().getWidth()));
+ sg.cs = new ResidueShader(new PIDColourScheme());
+ sg.cs.setConsensus(AAFrequency.calculate(
+ sg.getSequences(ap.av.getHiddenRepSequences()), 0,
+ ap.av.getAlignment().getWidth()));
refresh();
}
@@ -1255,10 +1275,11 @@ public class APopupMenu extends java.awt.PopupMenu implements
{
SequenceGroup sg = getGroup();
- sg.cs = new CollectionColourScheme(new Blosum62ColourScheme());
+ sg.cs = new ResidueShader(new Blosum62ColourScheme());
- sg.cs.setConsensus(AAFrequency.calculate(sg.getSequences(ap.av
- .getHiddenRepSequences()), 0, ap.av.getAlignment().getWidth()));
+ sg.cs.setConsensus(AAFrequency.calculate(
+ sg.getSequences(ap.av.getHiddenRepSequences()), 0,
+ ap.av.getAlignment().getWidth()));
refresh();
}
@@ -1280,10 +1301,9 @@ public class APopupMenu extends java.awt.PopupMenu implements
if (conservationColour.getState())
{
Conservation conservation = Conservation.calculateConservation(
- "Group", sg
- .getSequences(ap.av.getHiddenRepSequences()), 0, ap.av
- .getAlignment().getWidth(), false, ap.av.getConsPercGaps(),
- false);
+ "Group", sg.getSequences(ap.av.getHiddenRepSequences()), 0,
+ ap.av.getAlignment().getWidth(), false,
+ ap.av.getConsPercGaps(), false);
sg.getGroupColourScheme().setConservation(conservation);
SliderPanel.setConservationSlider(ap, sg.cs, sg.getName());
SliderPanel.showConservationSlider();
@@ -1316,7 +1336,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
SequenceGroup sg = ap.av.getSelectionGroup();
ap.av.getAlignment().deleteGroup(sg);
ap.av.setSelectionGroup(null);
- ap.paintAlignment(true);
+ ap.paintAlignment(true, true);
}
void createGroupMenuItem_actionPerformed()
@@ -1398,9 +1418,11 @@ public class APopupMenu extends java.awt.PopupMenu implements
showMenu.removeAll();
hideMenu.removeAll();
- final List all = Arrays.asList(new String[] { MessageManager
- .getString("label.all") });
- addAnnotationTypeToShowHide(showMenu, forSequences, "", all, true, true);
+ final List all = Arrays
+ .asList(new String[]
+ { MessageManager.getString("label.all") });
+ addAnnotationTypeToShowHide(showMenu, forSequences, "", all, true,
+ true);
addAnnotationTypeToShowHide(hideMenu, forSequences, "", all, true,
false);
showMenu.addSeparator();
@@ -1415,8 +1437,8 @@ public class APopupMenu extends java.awt.PopupMenu implements
* the insertion order, which is the order of the annotations on the
* alignment.
*/
- Map>> shownTypes = new LinkedHashMap>>();
- Map>> hiddenTypes = new LinkedHashMap>>();
+ Map>> shownTypes = new LinkedHashMap<>();
+ Map>> hiddenTypes = new LinkedHashMap<>();
AlignmentAnnotationUtils.getShownHiddenTypes(shownTypes, hiddenTypes,
AlignmentAnnotationUtils.asList(annotations), forSequences);