From: jprocter Date: Fri, 15 Aug 2008 10:02:43 +0000 (+0000) Subject: check for crossreferences every time the menus are updated X-Git-Tag: Release_2_4~21 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d8d676a2af8f486688b1c1778466c52500a65f81;p=jalview.git check for crossreferences every time the menus are updated --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index e64b8e4..10a9c95 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -515,11 +515,17 @@ public class AlignFrame { 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 @@ -550,6 +556,8 @@ public class AlignFrame hiddenMarkers.setState(av.showHiddenMarkers); applyToAllGroups.setState(av.colourAppliesToAllGroups); + setShowProductsEnabled(); + updateEditMenuBar(); } @@ -595,7 +603,8 @@ public class AlignFrame progressBars.put(new Long(id), progressPanel); } - + // update GUI + setMenusForViewport(); validate(); } /** @@ -3543,9 +3552,16 @@ public class AlignFrame public void actionPerformed(ActionEvent e) { - new jalview.ws.DBRefFetcher( - alignPanel.av.getSequenceSelection(), - alignPanel.alignFrame).fetchDBRefs(false); + javax.swing.SwingUtilities.invokeLater(new Runnable() { + + public void run() + { + new jalview.ws.DBRefFetcher( + alignPanel.av.getSequenceSelection(), + alignPanel.alignFrame).fetchDBRefs(false); + } + + }); } }); @@ -3613,7 +3629,7 @@ public class AlignFrame 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); } });