From d83c0095dae033f5b4b7c81eb1493083b5cbe346 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 16 Sep 2011 16:09:10 +0100 Subject: [PATCH] JAL-574 added option to enable/disable 'follow selection' function but commenting out for 2.7 release --- src/jalview/gui/AlignFrame.java | 8 +++++++- src/jalview/jbgui/GAlignFrame.java | 24 +++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 30026ef..3011393 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -701,7 +701,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, showDbRefsMenuitem.setSelected(av.isShowDbRefs()); autoCalculate.setSelected(av.autoCalculateConsensus); sortByTree.setSelected(av.sortByTree); - + listenToViewSelections.setSelected(av.followSelection); + setShowProductsEnabled(); updateEditMenuBar(); @@ -3427,6 +3428,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, viewport.sortByTree = sortByTree.isSelected(); } + @Override + protected void listenToViewSelections_actionPerformed(ActionEvent e) + { + viewport.followSelection = listenToViewSelections.isSelected(); + } /** * DOCUMENT ME! * diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 22d27e9..44e34e2 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -223,6 +223,8 @@ public class GAlignFrame extends JInternalFrame protected JCheckBoxMenuItem sortByTree = new JCheckBoxMenuItem(); + protected JCheckBoxMenuItem listenToViewSelections = new JCheckBoxMenuItem(); + JMenu addSequenceMenu = new JMenu(); JMenuItem addFromFile = new JMenuItem(); @@ -1416,7 +1418,18 @@ public class GAlignFrame extends JInternalFrame sortByTreeOption_actionPerformed(e); } }); - + + listenToViewSelections.setText("Listen for selections"); + listenToViewSelections.setToolTipText("When selected, selections in this view will mirror
selections made on the same sequences in other views."); + listenToViewSelections.setState(false); + listenToViewSelections.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + listenToViewSelections_actionPerformed(e); + } + }); + addSequenceMenu.setText("Add Sequences"); addFromFile.setText("From File"); addFromFile.addActionListener(new ActionListener() @@ -1819,6 +1832,15 @@ public class GAlignFrame extends JInternalFrame selectMenu.add(invertColSel); selectMenu.add(deleteGroups); selectMenu.add(grpsFromSelection); + // TODO - determine if the listenToViewSelections button is needed : see bug JAL-754 + //selectMenu.addSeparator(); + //selectMenu.add(listenToViewSelections); + } + + protected void listenToViewSelections_actionPerformed(ActionEvent e) + { + // TODO Auto-generated method stub + } protected void showAllhidden_actionPerformed(ActionEvent e) -- 1.7.10.2