/*
- * Jalview - A Sequence Alignment Editor and Viewer
- * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
- *
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
+ * Copyright (C) 2008 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
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Softwarechang
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package jalview.gui;
* @version $Revision$
*/
public class AlignFrame
- extends GAlignFrame implements DropTargetListener
+ extends GAlignFrame implements DropTargetListener, IProgressIndicator
{
/** DOCUMENT ME!! */
public static final int DEFAULT_WIDTH = 700;
{
calculateMenu.remove(calculateMenu.getItemCount()-2);
}
- setShowProductsEnabled();
}
-
+ /**
+ * set up menus for the currently viewport.
+ * This may be called after any operation that affects the data in the current view (selection changed, etc) to update the menus to reflect the new state.
+ */
+ public void setMenusForViewport()
+ {
+ setMenusFromViewport(viewport);
+ }
/**
* Need to call this method when tabs are selected for multiple views,
* or when loading from Jalview2XML.java
hiddenMarkers.setState(av.showHiddenMarkers);
applyToAllGroups.setState(av.colourAppliesToAllGroups);
+ setShowProductsEnabled();
+
updateEditMenuBar();
}
Hashtable progressBars;
+ /* (non-Javadoc)
+ * @see jalview.gui.IProgressIndicator#setProgressBar(java.lang.String, long)
+ */
public void setProgressBar(String message, long id)
{
if(progressBars == null)
progressBars.put(new Long(id), progressPanel);
}
-
+ // update GUI
+ setMenusForViewport();
validate();
}
/**
Vector seqsrch = (Vector) Discoverer.services.get("SeqSearch");
// TODO: move GUI generation code onto service implementation - so a client instance attaches itself to the GUI with method call like jalview.ws.MsaWSClient.bind(servicehandle, Desktop.instance, alignframe)
Vector wsmenu = new Vector();
- final AlignFrame af = this;
+ final IProgressIndicator af = this;
if (msaws != null)
{
// Add any Multiple Sequence Alignment Services
webService.removeAll();
// Temporary hack - DBRef Fetcher always top level ws entry.
JMenuItem rfetch = new JMenuItem("Fetch DB References");
- rfetch.setToolTipText("Retrieve and parse uniprot records for the alignment or the currently selected sequences");
+ rfetch.setToolTipText("Retrieve and parse sequence database records for the alignment or the currently selected sequences");
webService.add(rfetch);
rfetch.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
- new jalview.ws.DBRefFetcher(
- alignPanel.av.getSequenceSelection(),
- alignPanel.alignFrame).fetchDBRefs(false);
+ new Thread(new Runnable() {
+
+ public void run()
+ {
+ new jalview.ws.DBRefFetcher(
+ alignPanel.av.getSequenceSelection(),
+ alignPanel.alignFrame).fetchDBRefs(false);
+ }
+ }).start();
+
}
});
public void actionPerformed(ActionEvent e)
{
// TODO: new thread for this call with vis-delay
- af.showProductsFor(sel, ds, isRegSel, dna, source);
+ af.showProductsFor(af.viewport.getSequenceSelection(), ds, isRegSel, dna, source);
}
});
{
alignPanel.adjustAnnotationHeight();
+ viewport.updateSequenceIdColours();
buildSortByAnnotationScoresMenu();
alignPanel.paintAlignment(true);
}
protected void extractScores_actionPerformed(ActionEvent e)
{
ParseProperties pp = new jalview.analysis.ParseProperties(viewport.alignment);
- if (pp.getScoresFromDescription("col", "score column ", "\\W*([-+]?\\d*\\.?\\d*e?-?\\d*)\\W+([-+]?\\d*\\.?\\d*e?-?\\d*)", true)>0)
- {
+ // TODO: verify regex and introduce GUI dialog for version 2.5
+ //if (pp.getScoresFromDescription("col", "score column ", "\\W*([-+]?\\d*\\.?\\d*e?-?\\d*)\\W+([-+]?\\d*\\.?\\d*e?-?\\d*)", true)>0)
+ if (pp.getScoresFromDescription("description column", "score in description column ", "\\W*([-+eE0-9.]+)", true)>0) {
buildSortByAnnotationScoresMenu();
}
}