From: amwaterhouse Date: Tue, 4 Apr 2006 09:35:34 +0000 (+0000) Subject: Autocalculate consensus X-Git-Tag: Release_2_08~78 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a9ef2d2b865889e9f75faf8e14597c8f508d0ce1;p=jalview.git Autocalculate consensus --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index b2c8901..9d2cf0f 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -263,7 +263,7 @@ public class AlignFrame java.io.File.separatorChar) + 1); } - Jalview2XML.SaveAlignment(this, file, shortName); + new Jalview2XML().SaveAlignment(this, file, shortName); // USE Jalview2XML to save this file return true; @@ -912,6 +912,11 @@ public class AlignFrame */ public void deselectAllSequenceMenuItem_actionPerformed(ActionEvent e) { + if(viewport.cursorMode) + { + alignPanel.seqPanel.keyboardNo1 = null; + alignPanel.seqPanel.keyboardNo2 = null; + } viewport.setSelectionGroup(null); viewport.getColumnSelection().clear(); viewport.setSelectionGroup(null); @@ -1134,7 +1139,10 @@ public class AlignFrame public void alignmentChanged() { - if(viewport.vconsensus!=null) + if(viewport.padGaps) + viewport.getAlignment().padGaps(); + + if(viewport.vconsensus!=null && viewport.autoCalculateConsensus) { viewport.updateConsensus(); viewport.updateConservation(); @@ -1196,7 +1204,10 @@ public class AlignFrame { addHistoryItem(new HistoryItem("Pad Gaps", viewport.alignment, HistoryItem.HIDE)); - if (viewport.getAlignment().padGaps()) + + viewport.padGaps = padGapsMenuitem.isSelected(); + + if (viewport.padGaps) alignmentChanged(); } @@ -1928,6 +1939,13 @@ public class AlignFrame new PCAPanel(viewport); } + + public void autoCalculate_actionPerformed(ActionEvent e) + { + viewport.autoCalculateConsensus = autoCalculate.isSelected(); + } + + /** * DOCUMENT ME! * @@ -1977,7 +1995,7 @@ public class AlignFrame */ void NewTreePanel(String type, String pwType, String title) { - final TreePanel tp; + TreePanel tp; if ( (viewport.getSelectionGroup() != null) && (viewport.getSelectionGroup().getSize() > 3)) @@ -2029,7 +2047,6 @@ public class AlignFrame } addTreeMenuItem(tp, title); - viewport.setCurrentTree(tp.getTree()); Desktop.addInternalFrame(tp, title + " from " + this.title, 600, 500); } diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index a92517c..2c8172b 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -86,6 +86,7 @@ public class AlignViewport AlignmentAnnotation consensus; AlignmentAnnotation conservation; AlignmentAnnotation quality; + boolean autoCalculateConsensus = true; /** DOCUMENT ME!! */ public int ConsPercGaps = 25; // JBPNote : This should be a scalable property! @@ -99,6 +100,8 @@ public class AlignViewport boolean antiAlias = false; + boolean padGaps = false; + public AlignViewport(AlignmentI al, boolean dataset) { diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index bddc504..f0e5e67 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -110,7 +110,7 @@ public class GAlignFrame protected JMenu sort = new JMenu(); JMenu calculate = new JMenu(); JMenu jMenu2 = new JMenu(); - JMenuItem padGapsMenuitem = new JMenuItem(); + protected JCheckBoxMenuItem padGapsMenuitem = new JCheckBoxMenuItem(); protected ButtonGroup colours = new ButtonGroup(); JMenuItem vamsasStore = new JMenuItem(); protected JCheckBoxMenuItem showTranslation = new JCheckBoxMenuItem(); @@ -124,6 +124,7 @@ public class GAlignFrame JMenuItem associatedData = new JMenuItem(); + protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem(); public GAlignFrame() { @@ -977,6 +978,15 @@ public class GAlignFrame associatedData_actionPerformed(e); } }); + autoCalculate.setText("Autocalculate Consensus"); + autoCalculate.setState(true); + autoCalculate.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + autoCalculate_actionPerformed(e); + } + }); alignFrameMenuBar.add(fileMenu); alignFrameMenuBar.add(editMenu); alignFrameMenuBar.add(searchMenu); @@ -1063,6 +1073,7 @@ public class GAlignFrame calculateMenu.add(PCAMenuItem); calculateMenu.addSeparator(); calculateMenu.add(showTranslation); + calculateMenu.add(autoCalculate); webServiceNoServices=new JMenuItem(""); webService.add(webServiceNoServices); this.getContentPane().add(statusBar, BorderLayout.SOUTH); @@ -1373,11 +1384,6 @@ public class GAlignFrame } - public void tabSelected() - { - - } - public void featureSettings_actionPerformed(ActionEvent e) { @@ -1407,4 +1413,9 @@ public class GAlignFrame { } + + public void autoCalculate_actionPerformed(ActionEvent e) + { + + } }