X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGAlignFrame.java;h=22d27e973c43b7f2dec814dc2c9b27843a174bf9;hb=6403068c0c328cfb63af451f7fa1bd568fa0fdd3;hp=2325de1dd37e5eee4fe55d4d5659bd191509a0b6;hpb=aff93619ba53584f9b01970832558331951d9dbf;p=jalview.git
diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java
index 2325de1..22d27e9 100755
--- a/src/jalview/jbgui/GAlignFrame.java
+++ b/src/jalview/jbgui/GAlignFrame.java
@@ -1,20 +1,19 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
- * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
+ * Copyright (C) 2010 J Procter, AM Waterhouse, 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 file is part of Jalview.
*
- * 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.
+ * Jalview 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 3 of the License, or (at your option) any later version.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * Jalview 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 Jalview. If not, see .
*/
package jalview.jbgui;
@@ -122,7 +121,7 @@ public class GAlignFrame extends JInternalFrame
public JCheckBoxMenuItem colourTextMenuItem = new JCheckBoxMenuItem();
- public JCheckBoxMenuItem showUnconservedMenuItem = new JCheckBoxMenuItem();
+ public JCheckBoxMenuItem showNonconservedMenuItem = new JCheckBoxMenuItem();
JMenuItem htmlMenuItem = new JMenuItem();
@@ -147,6 +146,7 @@ public class GAlignFrame extends JInternalFrame
public JCheckBoxMenuItem abovePIDThreshold = new JCheckBoxMenuItem();
public JCheckBoxMenuItem showSeqFeatures = new JCheckBoxMenuItem();
+
public JCheckBoxMenuItem showSeqFeaturesHeight = new JCheckBoxMenuItem();
protected JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem();
@@ -196,7 +196,9 @@ public class GAlignFrame extends JInternalFrame
JMenu jMenu2 = new JMenu();
protected JCheckBoxMenuItem padGapsMenuitem = new JCheckBoxMenuItem();
+
protected JCheckBoxMenuItem showNpFeatsMenuitem = new JCheckBoxMenuItem();
+
protected JCheckBoxMenuItem showDbRefsMenuitem = new JCheckBoxMenuItem();
protected ButtonGroup colours = new ButtonGroup();
@@ -219,6 +221,8 @@ public class GAlignFrame extends JInternalFrame
protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem();
+ protected JCheckBoxMenuItem sortByTree = new JCheckBoxMenuItem();
+
JMenu addSequenceMenu = new JMenu();
JMenuItem addFromFile = new JMenuItem();
@@ -236,7 +240,7 @@ public class GAlignFrame extends JInternalFrame
GridLayout gridLayout1 = new GridLayout();
JMenu jMenu3 = new JMenu();
-
+
JMenuItem showAllSeqs = new JMenuItem();
JMenuItem showAllColumns = new JMenuItem();
@@ -276,7 +280,7 @@ public class GAlignFrame extends JInternalFrame
protected JCheckBoxMenuItem centreColumnLabelsMenuItem = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem followHighlightMenuItem = new JCheckBoxMenuItem();
-
+
protected JMenuItem gatherViews = new JMenuItem();
protected JMenuItem expandViews = new JMenuItem();
@@ -284,21 +288,27 @@ public class GAlignFrame extends JInternalFrame
JMenuItem pageSetup = new JMenuItem();
JMenuItem alignmentProperties = new JMenuItem();
-
+
JMenu tooltipSettingsMenu = new JMenu();
- private JMenuItem justifyLeftMenuItem=new JMenuItem();
+ private JMenuItem justifyLeftMenuItem = new JMenuItem();
- private JMenuItem justifyRightMenuItem=new JMenuItem();
+ private JMenuItem justifyRightMenuItem = new JMenuItem();
JMenu autoAnnMenu = new JMenu();
- protected JCheckBoxMenuItem showGroupConsensus=new JCheckBoxMenuItem();
- protected JCheckBoxMenuItem showGroupConservation=new JCheckBoxMenuItem();
- protected JCheckBoxMenuItem showConsensusHistogram=new JCheckBoxMenuItem();
- protected JCheckBoxMenuItem showSequenceLogo=new JCheckBoxMenuItem();
- protected JCheckBoxMenuItem applyAutoAnnotationSettings=new JCheckBoxMenuItem();
+
+ protected JCheckBoxMenuItem showGroupConsensus = new JCheckBoxMenuItem();
+
+ protected JCheckBoxMenuItem showGroupConservation = new JCheckBoxMenuItem();
+
+ protected JCheckBoxMenuItem showConsensusHistogram = new JCheckBoxMenuItem();
+
+ protected JCheckBoxMenuItem showSequenceLogo = new JCheckBoxMenuItem();
+
+ protected JCheckBoxMenuItem applyAutoAnnotationSettings = new JCheckBoxMenuItem();
private JMenuItem grpsFromSelection = new JMenuItem();
+
public GAlignFrame()
{
try
@@ -355,8 +365,7 @@ public class GAlignFrame extends JInternalFrame
if (evt.isControlDown()
|| SwingUtilities.isRightMouseButton(evt))
{
- radioItem
- .removeActionListener(radioItem.getActionListeners()[0]);
+ radioItem.removeActionListener(radioItem.getActionListeners()[0]);
int option = JOptionPane.showInternalConfirmDialog(
jalview.gui.Desktop.desktop,
@@ -422,9 +431,6 @@ public class GAlignFrame extends JInternalFrame
switch (index)
{
- case ColourSchemeProperty.NONE:
- noColourmenuItem.setSelected(true);
- break;
case ColourSchemeProperty.CLUSTAL:
clustalColour.setSelected(true);
@@ -483,6 +489,11 @@ public class GAlignFrame extends JInternalFrame
userDefinedColour.setSelected(true);
break;
+ case ColourSchemeProperty.NONE:
+ default:
+ noColourmenuItem.setSelected(true);
+ break;
+
}
}
@@ -560,7 +571,7 @@ public class GAlignFrame extends JInternalFrame
public void actionPerformed(ActionEvent e)
{
makeGrpsFromSelection_actionPerformed(e);
- }
+ }
});
remove2LeftMenuItem.setText("Remove Left");
@@ -613,21 +624,23 @@ public class GAlignFrame extends JInternalFrame
}
});
justifyLeftMenuItem.setText("Left Justify Alignment");
- justifyLeftMenuItem.addActionListener(new java.awt.event.ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- justifyLeftMenuItem_actionPerformed(e);
- }
- });
+ justifyLeftMenuItem
+ .addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ justifyLeftMenuItem_actionPerformed(e);
+ }
+ });
justifyRightMenuItem.setText("Right Justify Alignment");
- justifyRightMenuItem.addActionListener(new java.awt.event.ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- justifyRightMenuItem_actionPerformed(e);
- }
- });
+ justifyRightMenuItem
+ .addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ justifyRightMenuItem_actionPerformed(e);
+ }
+ });
viewBoxesMenuItem.setText("Boxes");
viewBoxesMenuItem.setState(true);
viewBoxesMenuItem.addActionListener(new java.awt.event.ActionListener()
@@ -646,15 +659,16 @@ public class GAlignFrame extends JInternalFrame
viewTextMenuItem_actionPerformed(e);
}
});
- showUnconservedMenuItem.setText("Show Unconserved");
- showUnconservedMenuItem.setState(false);
- showUnconservedMenuItem.addActionListener(new java.awt.event.ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- showUnconservedMenuItem_actionPerformed(e);
- }
- });
+ showNonconservedMenuItem.setText("Show nonconserved");
+ showNonconservedMenuItem.setState(false);
+ showNonconservedMenuItem
+ .addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ showUnconservedMenuItem_actionPerformed(e);
+ }
+ });
sortPairwiseMenuItem.setText("by Pairwise Identity");
sortPairwiseMenuItem
.addActionListener(new java.awt.event.ActionListener()
@@ -673,13 +687,14 @@ public class GAlignFrame extends JInternalFrame
}
});
sortLengthMenuItem.setText("By Length");
- sortLengthMenuItem.addActionListener(new java.awt.event.ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- sortLengthMenuItem_actionPerformed(e);
- }
- });
+ sortLengthMenuItem
+ .addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ sortLengthMenuItem_actionPerformed(e);
+ }
+ });
sortGroupMenuItem.setText("by Group");
sortGroupMenuItem.addActionListener(new java.awt.event.ActionListener()
{
@@ -985,15 +1000,12 @@ public class GAlignFrame extends JInternalFrame
showSeqFeatures_actionPerformed(actionEvent);
}
});
-/*
- * showSeqFeaturesHeight.setText("Vary Sequence Feature Height");
- showSeqFeaturesHeight.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent actionEvent)
- {
- showSeqFeaturesHeight_actionPerformed(actionEvent);
- }
- }); */
+ /*
+ * showSeqFeaturesHeight.setText("Vary Sequence Feature Height");
+ * showSeqFeaturesHeight.addActionListener(new ActionListener() { public
+ * void actionPerformed(ActionEvent actionEvent) {
+ * showSeqFeaturesHeight_actionPerformed(actionEvent); } });
+ */
showDbRefsMenuitem.setText("Show Database Refs");
showDbRefsMenuitem.addActionListener(new ActionListener()
{
@@ -1002,7 +1014,7 @@ public class GAlignFrame extends JInternalFrame
{
showDbRefs_actionPerformed(e);
}
-
+
});
showNpFeatsMenuitem.setText("Show Non-Positional Features");
showNpFeatsMenuitem.addActionListener(new ActionListener()
@@ -1012,7 +1024,7 @@ public class GAlignFrame extends JInternalFrame
{
showNpFeats_actionPerformed(e);
}
-
+
});
showGroupConservation.setText("Group Conservation");
showGroupConservation.addActionListener(new ActionListener()
@@ -1022,7 +1034,7 @@ public class GAlignFrame extends JInternalFrame
{
showGroupConservation_actionPerformed(e);
}
-
+
});
showGroupConsensus.setText("Group Consensus");
@@ -1033,7 +1045,7 @@ public class GAlignFrame extends JInternalFrame
{
showGroupConsensus_actionPerformed(e);
}
-
+
});
showConsensusHistogram.setText("Show Consensus Histogram");
showConsensusHistogram.addActionListener(new ActionListener()
@@ -1043,7 +1055,7 @@ public class GAlignFrame extends JInternalFrame
{
showConsensusHistogram_actionPerformed(e);
}
-
+
});
showSequenceLogo.setText("Show Consensus Logo");
showSequenceLogo.addActionListener(new ActionListener()
@@ -1053,7 +1065,7 @@ public class GAlignFrame extends JInternalFrame
{
showSequenceLogo_actionPerformed(e);
}
-
+
});
applyAutoAnnotationSettings.setText("Apply to all groups");
applyAutoAnnotationSettings.setState(false);
@@ -1065,7 +1077,7 @@ public class GAlignFrame extends JInternalFrame
{
applyAutoAnnotationSettings_actionPerformed(e);
}
-
+
});
nucleotideColour.setText("Nucleotide");
@@ -1246,9 +1258,9 @@ public class GAlignFrame extends JInternalFrame
{
followHighlight_actionPerformed();
}
-
+
});
-
+
modifyPID.setText("Modify Identity Threshold...");
modifyPID.addActionListener(new java.awt.event.ActionListener()
{
@@ -1342,7 +1354,7 @@ public class GAlignFrame extends JInternalFrame
}
});
extractScores.setVisible(true); // JBPNote: TODO: make gui for regex based
- // score extraction
+ // score extraction
showProducts.setText("Get Cross References");
/*
* showProducts.addActionListener(new ActionListener() {
@@ -1393,6 +1405,18 @@ public class GAlignFrame extends JInternalFrame
autoCalculate_actionPerformed(e);
}
});
+ sortByTree.setText("Sort Alignment With New Tree");
+ sortByTree.setToolTipText("Enable this to automatically sort
the alignment when you open
a new tree.");
+ sortByTree.setState(jalview.bin.Cache.getDefault(
+ "SORT_BY_TREE", false));
+ sortByTree.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ sortByTreeOption_actionPerformed(e);
+ }
+ });
+
addSequenceMenu.setText("Add Sequences");
addFromFile.setText("From File");
addFromFile.addActionListener(new ActionListener()
@@ -1482,7 +1506,7 @@ public class GAlignFrame extends JInternalFrame
}
});
// TODO: should be hidden if no selection exists.
- hideAllButSelection.setText("All but Selected Rregion (Shift+Ctrl+H)");
+ hideAllButSelection.setText("All but Selected Region (Shift+Ctrl+H)");
hideAllButSelection.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -1491,7 +1515,8 @@ public class GAlignFrame extends JInternalFrame
}
});
showAllhidden.setText("All Sequences and Columns");
- showAllhidden.setToolTipText("H toggles visibility of hidden or selected regions.");
+ showAllhidden
+ .setToolTipText("H toggles visibility of hidden or selected regions.");
showAllhidden.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -1697,8 +1722,8 @@ public class GAlignFrame extends JInternalFrame
viewMenu.add(autoAnnMenu);
viewMenu.addSeparator();
viewMenu.add(showSeqFeatures);
- //viewMenu.add(showSeqFeaturesHeight);
-
+ // viewMenu.add(showSeqFeaturesHeight);
+
viewMenu.add(featureSettings);
tooltipSettingsMenu.add(showDbRefsMenuitem);
tooltipSettingsMenu.add(showNpFeatsMenuitem);
@@ -1738,6 +1763,7 @@ public class GAlignFrame extends JInternalFrame
calculateMenu.add(showTranslation);
calculateMenu.add(showProducts);
calculateMenu.add(autoCalculate);
+ calculateMenu.add(sortByTree);
calculateMenu.addSeparator();
calculateMenu.add(extractScores);
webServiceNoServices = new JMenuItem("");
@@ -1769,7 +1795,7 @@ public class GAlignFrame extends JInternalFrame
hideMenu.add(hideSelSequences);
hideMenu.add(hideAllSelection);
hideMenu.add(hideAllButSelection);
-
+
formatMenu.add(font);
formatMenu.addSeparator();
formatMenu.add(wrapMenuItem);
@@ -1784,7 +1810,7 @@ public class GAlignFrame extends JInternalFrame
formatMenu.add(colourTextMenuItem);
formatMenu.add(renderGapsMenuItem);
formatMenu.add(centreColumnLabelsMenuItem);
- formatMenu.add(showUnconservedMenuItem);
+ formatMenu.add(showNonconservedMenuItem);
selectMenu.add(findMenuItem);
selectMenu.addSeparator();
selectMenu.add(selectAllSequenceMenuItem);
@@ -1798,98 +1824,98 @@ public class GAlignFrame extends JInternalFrame
protected void showAllhidden_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void hideAllButSelection_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void hideAllSelection_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void applyAutoAnnotationSettings_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void showConsensusHistogram_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void showSequenceLogo_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void makeGrpsFromSelection_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void showGroupConsensus_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void showGroupConservation_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void showUnconservedMenuItem_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void showSeqFeaturesHeight_actionPerformed(
ActionEvent actionEvent)
{
// TODO Auto-generated method stub
-
+
}
protected void justifyRightMenuItem_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void justifyLeftMenuItem_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void followHighlight_actionPerformed()
{
// TODO Auto-generated method stub
-
+
}
protected void showNpFeats_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void showDbRefs_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void centreColumnLabels_actionPerformed(ActionEvent e)
@@ -2255,6 +2281,11 @@ public class GAlignFrame extends JInternalFrame
}
+ public void sortByTreeOption_actionPerformed(ActionEvent e)
+ {
+
+ }
+
public void showAllSeqs_actionPerformed(ActionEvent e)
{