CheckboxMenuItem showColourText = new CheckboxMenuItem();
+ CheckboxMenuItem displayNonconserved = new CheckboxMenuItem();
+
Menu editMenu = new Menu("Edit");
MenuItem copy = new MenuItem("Copy (Jalview Only)");
showText.setState(sg.getDisplayText());
showColourText.setState(sg.getColourText());
showBoxes.setState(sg.getDisplayBoxes());
+ displayNonconserved.setState(sg.getShowunconserved());
if (!ap.av.alignment.getGroups().contains(sg))
{
groupMenu.remove(unGroupMenuItem);
{
showBoxes_itemStateChanged();
}
+ else if (evt.getSource() == displayNonconserved)
+ {
+ this.showNonconserved_itemStateChanged();
+ }
}
public void actionPerformed(ActionEvent evt)
showBoxes.setState(true);
showBoxes.addItemListener(this);
sequenceName.addActionListener(this);
-
+ displayNonconserved.setLabel("Show Nonconserved");
+ displayNonconserved.setState(false);
+ displayNonconserved.addItemListener(this);
showText.setLabel("Text");
showText.addItemListener(this);
showColourText.setLabel("Colour Text");
menu1.add(showBoxes);
menu1.add(showText);
menu1.add(showColourText);
+ menu1.add(displayNonconserved);
toggleCase.addActionListener(this);
pdb.addActionListener(this);
hideSeqs.addActionListener(this);
refresh();
}
+ public void showNonconserved_itemStateChanged()
+ {
+ getGroup().setShowunconserved(this.displayNonconserved.getState());
+ refresh();
+ }
+
public void showBoxes_itemStateChanged()
{
getGroup().setDisplayBoxes(showBoxes.getState());
viewport.updateConsensus(alignPanel);
annotationPanelMenuItem.setState(viewport.showAnnotation);
+ displayNonconservedMenuItem.setState(viewport.getShowunconserved());
seqLimits.setState(viewport.showJVSuffix);
centreColumnLabelFlag.setState(true);
centreColumnLabelFlag_stateChanged();
}
-
try
{
param = applet.getParameter("windowWidth");
public void itemStateChanged(ItemEvent evt)
{
- if (evt.getSource() == colourTextMenuItem)
+ if (evt.getSource() == displayNonconservedMenuItem)
+ {
+ displayNonconservedMenuItem_actionPerformed();
+ }
+ else if (evt.getSource() == colourTextMenuItem)
{
colourTextMenuItem_actionPerformed();
}
alignPanel.paintAlignment(true);
}
+ protected void displayNonconservedMenuItem_actionPerformed()
+ {
+ viewport.setShowunconserved(displayNonconservedMenuItem.getState());
+ alignPanel.paintAlignment(true);
+ }
+
protected void wrapMenuItem_actionPerformed()
{
viewport.setWrapAlignment(wrapMenuItem.getState());
"For help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list",
x, y += fh);
g.drawString("If you use Jalview, please cite:", x, y += fh + 8);
- g
- .drawString(
- "\"Clamp, M., Cuff, J., Searle, S. M. and Barton, G. J. (2004), The Jalview Java Alignment Editor\"",
- x, y += fh);
- g.drawString("Bioinformatics, 2004 20;426-7.", x, y += fh);
+ g.drawString(
+ "Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)",x,y+=fh);
+ g.drawString("Jalview Version 2 - a multiple sequence alignment editor and analysis workbench",x,y+=fh);
+ g.drawString("Bioinformatics doi: 10.1093/bioinformatics/btp033",x,y+=fh);
}
}
CheckboxMenuItem colourTextMenuItem = new CheckboxMenuItem();
+ CheckboxMenuItem displayNonconservedMenuItem = new CheckboxMenuItem();
+
MenuItem alProperties = new MenuItem("Alignment Properties...");
MenuItem overviewMenuItem = new MenuItem();
annotationPanelMenuItem.addItemListener(this);
colourTextMenuItem.setLabel("Colour Text");
colourTextMenuItem.addItemListener(this);
+ displayNonconservedMenuItem.setLabel("Show non-conserved");
+ displayNonconservedMenuItem.addItemListener(this);
alProperties.addActionListener(this);
overviewMenuItem.setLabel("Overview Window");
overviewMenuItem.addActionListener(this);
formatMenu.add(viewBoxesMenuItem);
formatMenu.add(viewTextMenuItem);
formatMenu.add(colourTextMenuItem);
+ formatMenu.add(displayNonconservedMenuItem);
formatMenu.add(renderGapsMenuItem);
formatMenu.add(centreColumnLabelFlag);
selectMenu.add(findMenuItem);
showConsensus = Boolean.valueOf(param).booleanValue();
}
+ param = applet.getParameter("showUnconserved");
+ if (param != null)
+ {
+ this.showUnconserved = Boolean.valueOf(param).booleanValue();
+ }
+
param = applet.getParameter("upperCase");
if (param != null)
{
public boolean getFollowHighlight() {
return followHighlight;
}
+ /**
+ * show non-conserved residues only
+ */
+ public boolean showUnconserved=false;
+
+ /**
+ * @return the showUnconserved
+ */
+ public boolean getShowunconserved()
+ {
+ return showUnconserved;
+ }
+
+ /**
+ * @param showUnconserved the showUnconserved to set
+ */
+ public void setShowunconserved(boolean displayNonconserved)
+ {
+ this.showUnconserved = displayNonconserved;
+ }
}
}
}
-
+
public Color findSequenceColour(SequenceI seq, int i)
{
allGroups = av.alignment.findAllGroups(seq);
getBoxColour(currentSequenceGroup.cs, seq, i);
graphics.setColor(resBoxColour.darker());
}
+ if (currentSequenceGroup.getShowunconserved())
+ {
+ // cheat - use this if we have a consensus for each group: s = getDisplayChar(currentSequenceGroup.getConsensus(), i, s, '.');
+ s = getDisplayChar(av.consensus, i, s, '.');
+ }
}
else
{
graphics.setColor(resBoxColour);
}
}
+ if (av.getShowunconserved())
+ {
+ s = getDisplayChar(av.consensus, i, s, '.');
+
+ }
}
if (av.upperCasebold)
}
}
-
+
charOffset = (av.charWidth - fm.charWidth(s)) / 2;
graphics.drawString(String.valueOf(s), charOffset + av.charWidth
* (i - start), y1);
}
+
+ private char getDisplayChar(AlignmentAnnotation consensus, int position, char s, char c)
+ {
+ char conschar = consensus.annotations[position].displayCharacter.charAt(0);
+ if (conschar!='-' && s==conschar)
+ {
+ s= c;
+ }
+ return s;
+ }
+
boolean inCurrentSequenceGroup(int res)
{
if (allGroups == null)