/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
+ * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
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);
continue;
}
final String target = urlLink.getTarget(); // link.substring(0,
- // link.indexOf("|"));
+ // link.indexOf("|"));
final String label = urlLink.getLabel();
if (urlLink.isDynamic())
{
// collect id string too
String id = seq.getName();
String descr = seq.getDescription();
- if (descr!=null && descr.length()<1)
+ if (descr != null && descr.length() < 1)
{
descr = null;
}
}
// addshowLink(linkMenu, target, url_pref + id + url_suff);
}
- // Now construct URLs from description but only try to do it for regex URL links
- if (descr != null && urlLink.getRegexReplace()!=null)
+ // Now construct URLs from description but only try to do it for regex
+ // URL links
+ if (descr != null && urlLink.getRegexReplace() != null)
{
// create link for this URL from description only if regex matches
String[] urls = urlLink.makeUrls(descr, true);
* final String url;
*
* if (link.indexOf("$SEQUENCE_ID$") > -1) { // Substitute SEQUENCE_ID
- * string and any matching database reference accessions String url_pref =
- * link.substring(link.indexOf("|") + 1, link.indexOf("$SEQUENCE_ID$"));
+ * string and any matching database reference accessions String url_pref
+ * = link.substring(link.indexOf("|") + 1,
+ * link.indexOf("$SEQUENCE_ID$"));
*
* String url_suff = link.substring(link.indexOf("$SEQUENCE_ID$") + 13);
- * // collect matching db-refs DBRefEntry[] dbr =
+ * // collect matching db-refs DBRefEntry[] dbr =
* jalview.util.DBRefUtils.selectRefs(seq.getDBRef(), new
* String[]{target}); // collect id string too String id =
* seq.getName(); if (id.indexOf("|") > -1) { id =
* link.substring(link.lastIndexOf("|")+1)); }
*/
}
-
- if (seq != null)
- {
- seqMenu.add(linkMenu);
- }
- else
+ if (linkMenu.getItemCount() > 0)
{
- add(linkMenu);
+ if (seq != null)
+ {
+ seqMenu.add(linkMenu);
+ }
+ else
+ {
+ add(linkMenu);
+ }
}
}
if (seq != null)
* add a show URL menu item to the given linkMenu
*
* @param linkMenu
- * @param target -
- * menu label string
- * @param url -
- * url to open
+ * @param target
+ * - menu label string
+ * @param url
+ * - url to open
*/
private void addshowLink(Menu linkMenu, final String target,
final String url)
* add a show URL menu item to the given linkMenu
*
* @param linkMenu
- * @param target -
- * URL target window
- * @param label -
- * menu label string
- * @param url -
- * url to open
+ * @param target
+ * - URL target window
+ * @param label
+ * - menu label string
+ * @param url
+ * - url to open
*/
private void addshowLink(Menu linkMenu, final String target,
final String label, final String url)
{
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());