java.io.File.separatorChar) + 1);\r
}\r
\r
- Jalview2XML.SaveAlignment(this, file, shortName);\r
+ new Jalview2XML().SaveAlignment(this, file, shortName);\r
\r
// USE Jalview2XML to save this file\r
return true;\r
*/\r
public void deselectAllSequenceMenuItem_actionPerformed(ActionEvent e)\r
{\r
+ if(viewport.cursorMode)\r
+ {\r
+ alignPanel.seqPanel.keyboardNo1 = null;\r
+ alignPanel.seqPanel.keyboardNo2 = null;\r
+ }\r
viewport.setSelectionGroup(null);\r
viewport.getColumnSelection().clear();\r
viewport.setSelectionGroup(null);\r
\r
public void alignmentChanged()\r
{\r
- if(viewport.vconsensus!=null)\r
+ if(viewport.padGaps)\r
+ viewport.getAlignment().padGaps();\r
+\r
+ if(viewport.vconsensus!=null && viewport.autoCalculateConsensus)\r
{\r
viewport.updateConsensus();\r
viewport.updateConservation();\r
{\r
addHistoryItem(new HistoryItem("Pad Gaps", viewport.alignment,\r
HistoryItem.HIDE));\r
- if (viewport.getAlignment().padGaps())\r
+\r
+ viewport.padGaps = padGapsMenuitem.isSelected();\r
+\r
+ if (viewport.padGaps)\r
alignmentChanged();\r
}\r
\r
new PCAPanel(viewport);\r
}\r
\r
+\r
+ public void autoCalculate_actionPerformed(ActionEvent e)\r
+ {\r
+ viewport.autoCalculateConsensus = autoCalculate.isSelected();\r
+ }\r
+\r
+\r
/**\r
* DOCUMENT ME!\r
*\r
*/\r
void NewTreePanel(String type, String pwType, String title)\r
{\r
- final TreePanel tp;\r
+ TreePanel tp;\r
\r
if ( (viewport.getSelectionGroup() != null) &&\r
(viewport.getSelectionGroup().getSize() > 3))\r
}\r
\r
addTreeMenuItem(tp, title);\r
- viewport.setCurrentTree(tp.getTree());\r
\r
Desktop.addInternalFrame(tp, title + " from " + this.title, 600, 500);\r
}\r
AlignmentAnnotation consensus;\r
AlignmentAnnotation conservation;\r
AlignmentAnnotation quality;\r
+ boolean autoCalculateConsensus = true;\r
\r
/** DOCUMENT ME!! */\r
public int ConsPercGaps = 25; // JBPNote : This should be a scalable property!\r
\r
boolean antiAlias = false;\r
\r
+ boolean padGaps = false;\r
+\r
\r
public AlignViewport(AlignmentI al, boolean dataset)\r
{\r
protected JMenu sort = new JMenu();\r
JMenu calculate = new JMenu();\r
JMenu jMenu2 = new JMenu();\r
- JMenuItem padGapsMenuitem = new JMenuItem();\r
+ protected JCheckBoxMenuItem padGapsMenuitem = new JCheckBoxMenuItem();\r
protected ButtonGroup colours = new ButtonGroup();\r
JMenuItem vamsasStore = new JMenuItem();\r
protected JCheckBoxMenuItem showTranslation = new JCheckBoxMenuItem();\r
\r
\r
JMenuItem associatedData = new JMenuItem();\r
+ protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem();\r
public GAlignFrame()\r
{\r
\r
associatedData_actionPerformed(e);\r
}\r
});\r
+ autoCalculate.setText("Autocalculate Consensus");\r
+ autoCalculate.setState(true);\r
+ autoCalculate.addActionListener(new ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent e)\r
+ {\r
+ autoCalculate_actionPerformed(e);\r
+ }\r
+ });\r
alignFrameMenuBar.add(fileMenu);\r
alignFrameMenuBar.add(editMenu);\r
alignFrameMenuBar.add(searchMenu);\r
calculateMenu.add(PCAMenuItem);\r
calculateMenu.addSeparator();\r
calculateMenu.add(showTranslation);\r
+ calculateMenu.add(autoCalculate);\r
webServiceNoServices=new JMenuItem("<No Services>");\r
webService.add(webServiceNoServices);\r
this.getContentPane().add(statusBar, BorderLayout.SOUTH);\r
\r
}\r
\r
- public void tabSelected()\r
- {\r
-\r
- }\r
-\r
public void featureSettings_actionPerformed(ActionEvent e)\r
{\r
\r
{\r
\r
}\r
+\r
+ public void autoCalculate_actionPerformed(ActionEvent e)\r
+ {\r
+\r
+ }\r
}\r