X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fjbgui%2FGAlignFrame.java;h=9b9af7e24dc7f7d23d26621b903b26821079175b;hb=2635d96c3715a81c99dbcd6782ce2eea5bd5bff6;hp=4f60de3dae1b6b8106e7e40c9ae7ff2cbb7cc458;hpb=2026a420963f094072607c0495b6369ba96e60c0;p=jalview.git diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 4f60de3..9b9af7e 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -1,13 +1,13 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) - * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) + * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle * * This file is part of Jalview. * * 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. - * + * * 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 @@ -17,13 +17,35 @@ */ package jalview.jbgui; -import java.awt.*; -import java.awt.event.*; - -import javax.swing.*; -import javax.swing.event.*; - -import jalview.schemes.*; +import jalview.schemes.ColourSchemeProperty; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.GridLayout; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.JInternalFrame; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButtonMenuItem; +import javax.swing.JTabbedPane; +import javax.swing.SwingUtilities; +import javax.swing.event.ChangeEvent; +import javax.swing.event.MenuEvent; +import javax.swing.event.MenuListener; public class GAlignFrame extends JInternalFrame { @@ -120,6 +142,8 @@ public class GAlignFrame extends JInternalFrame // protected JRadioButtonMenuItem covariationColour = new // JRadioButtonMenuItem(); + protected JRadioButtonMenuItem tcoffeeColour = new JRadioButtonMenuItem(); + JMenuItem njTreeBlosumMenuItem = new JMenuItem(); JMenuItem avDistanceTreeBlosumMenuItem = new JMenuItem(); @@ -157,6 +181,9 @@ public class GAlignFrame extends JInternalFrame public JCheckBoxMenuItem showSeqFeaturesHeight = new JCheckBoxMenuItem(); JMenuItem deleteGroups = new JMenuItem(); + + JMenuItem createGroup = new JMenuItem(); + JMenuItem unGroup = new JMenuItem(); JMenuItem delete = new JMenuItem(); @@ -216,13 +243,13 @@ public class GAlignFrame extends JInternalFrame protected JMenu showProducts = new JMenu(); - public JMenuItem featureSettings = new JMenuItem(); + public JMenuItem openFeatureSettings = new JMenuItem(); JMenuItem fetchSequence = new JMenuItem(); JMenuItem annotationColour = new JMenuItem(); - JMenuItem rnahelicesColour = new JMenuItem(); + protected JMenuItem rnahelicesColour = new JMenuItem(); JMenuItem associatedData = new JMenuItem(); @@ -314,6 +341,8 @@ public class GAlignFrame extends JInternalFrame protected JCheckBoxMenuItem showSequenceLogo = new JCheckBoxMenuItem(); + protected JCheckBoxMenuItem normaliseSequenceLogo = new JCheckBoxMenuItem(); + protected JCheckBoxMenuItem applyAutoAnnotationSettings = new JCheckBoxMenuItem(); private JMenuItem grpsFromSelection = new JMenuItem(); @@ -426,6 +455,7 @@ public class GAlignFrame extends JInternalFrame colours.add(nucleotideColour); colours.add(purinePyrimidineColour); // colours.add(covariationColour); + colours.add(tcoffeeColour); setColourSelected(jalview.bin.Cache .getDefault("DEFAULT_COLOUR", "None")); @@ -496,6 +526,10 @@ public class GAlignFrame extends JInternalFrame break; + case ColourSchemeProperty.TCOFFEE: + tcoffeeColour.setSelected(true); + break; + case ColourSchemeProperty.PURINEPYRIMIDINE: purinePyrimidineColour.setSelected(true); @@ -586,7 +620,7 @@ public class GAlignFrame extends JInternalFrame invertSequenceMenuItem_actionPerformed(e); } }); - grpsFromSelection.setText("Make Groups for selection"); + grpsFromSelection.setText("Make Groups For Selection"); grpsFromSelection.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -1113,6 +1147,16 @@ public class GAlignFrame extends JInternalFrame } }); + normaliseSequenceLogo.setText("Normalise Consensus Logo"); + normaliseSequenceLogo.addActionListener(new ActionListener() + { + + public void actionPerformed(ActionEvent e) + { + normaliseSequenceLogo_actionPerformed(e); + } + + }); applyAutoAnnotationSettings.setText("Apply to all groups"); applyAutoAnnotationSettings.setState(false); applyAutoAnnotationSettings.setVisible(true); @@ -1134,6 +1178,19 @@ public class GAlignFrame extends JInternalFrame nucleotideColour_actionPerformed(e); } }); + + tcoffeeColour.setText("T-Coffee scores"); + tcoffeeColour.setEnabled(false); + tcoffeeColour.addActionListener(new ActionListener() + { + + @Override + public void actionPerformed(ActionEvent e) + { + tcoffeeColorScheme_actionPerformed(e); + } + }); + deleteGroups.setText("Undefine groups"); deleteGroups.setAccelerator(javax.swing.KeyStroke.getKeyStroke( java.awt.event.KeyEvent.VK_U, Toolkit.getDefaultToolkit() @@ -1145,6 +1202,28 @@ public class GAlignFrame extends JInternalFrame deleteGroups_actionPerformed(e); } }); + createGroup.setText("Create group"); + createGroup.setAccelerator(javax.swing.KeyStroke.getKeyStroke( + java.awt.event.KeyEvent.VK_G, Toolkit.getDefaultToolkit() + .getMenuShortcutKeyMask(), false)); + createGroup.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(ActionEvent e) + { + createGroup_actionPerformed(e); + } + }); + unGroup.setText("Remove Group"); + unGroup.setAccelerator(javax.swing.KeyStroke.getKeyStroke( + java.awt.event.KeyEvent.VK_G,Toolkit.getDefaultToolkit() + .getMenuShortcutKeyMask() | java.awt.event.KeyEvent.SHIFT_MASK, false)); + unGroup.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(ActionEvent e) + { + unGroup_actionPerformed(e); + } + }); copy.setText("Copy"); copy.setAccelerator(javax.swing.KeyStroke.getKeyStroke( java.awt.event.KeyEvent.VK_C, Toolkit.getDefaultToolkit() @@ -1254,6 +1333,7 @@ public class GAlignFrame extends JInternalFrame LoadtreeMenuItem_actionPerformed(e); } }); + scaleAbove.setVisible(false); scaleAbove.setText("Scale Above"); scaleAbove.addActionListener(new java.awt.event.ActionListener() @@ -1408,8 +1488,8 @@ public class GAlignFrame extends JInternalFrame * public void actionPerformed(ActionEvent e) { * showProducts_actionPerformed(e); } }); */ - featureSettings.setText("Feature Settings..."); - featureSettings.addActionListener(new ActionListener() + openFeatureSettings.setText("Feature Settings..."); + openFeatureSettings.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -1462,9 +1542,10 @@ public class GAlignFrame extends JInternalFrame } }); 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 + .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) @@ -1474,8 +1555,9 @@ public class GAlignFrame extends JInternalFrame }); 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 + .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) @@ -1783,6 +1865,7 @@ public class GAlignFrame extends JInternalFrame autoAnnMenu.add(applyAutoAnnotationSettings); autoAnnMenu.add(showConsensusHistogram); autoAnnMenu.add(showSequenceLogo); + autoAnnMenu.add(normaliseSequenceLogo); autoAnnMenu.addSeparator(); autoAnnMenu.add(showGroupConservation); autoAnnMenu.add(showGroupConsensus); @@ -1791,7 +1874,7 @@ public class GAlignFrame extends JInternalFrame viewMenu.add(showSeqFeatures); // viewMenu.add(showSeqFeaturesHeight); - viewMenu.add(featureSettings); + viewMenu.add(openFeatureSettings); tooltipSettingsMenu.add(showDbRefsMenuitem); tooltipSettingsMenu.add(showNpFeatsMenuitem); viewMenu.add(tooltipSettingsMenu); @@ -1816,6 +1899,7 @@ public class GAlignFrame extends JInternalFrame colourMenu.add(nucleotideColour); colourMenu.add(purinePyrimidineColour); // colourMenu.add(covariationColour); + colourMenu.add(tcoffeeColour); colourMenu.add(userDefinedColour); colourMenu.addSeparator(); colourMenu.add(conservationMenuItem); @@ -1887,17 +1971,26 @@ public class GAlignFrame extends JInternalFrame selectMenu.add(deselectAllSequenceMenuItem); selectMenu.add(invertSequenceMenuItem); selectMenu.add(invertColSel); - selectMenu.add(deleteGroups); + selectMenu.add(createGroup); + selectMenu.add(unGroup); selectMenu.add(grpsFromSelection); - // TODO - determine if the listenToViewSelections button is needed : see bug JAL-574 - //selectMenu.addSeparator(); - //selectMenu.add(listenToViewSelections); + selectMenu.add(deleteGroups); + // TODO - determine if the listenToViewSelections button is needed : see bug + // JAL-574 + // selectMenu.addSeparator(); + // selectMenu.add(listenToViewSelections); + } + + protected void normaliseSequenceLogo_actionPerformed(ActionEvent e) + { + // TODO Auto-generated method stub + } protected void listenToViewSelections_actionPerformed(ActionEvent e) { // TODO Auto-generated method stub - + } protected void showAllhidden_actionPerformed(ActionEvent e) @@ -2241,6 +2334,14 @@ public class GAlignFrame extends JInternalFrame protected void deleteGroups_actionPerformed(ActionEvent e) { } + + protected void createGroup_actionPerformed(ActionEvent e) + { + } + + protected void unGroup_actionPerformed(ActionEvent e) + { + } protected void copy_actionPerformed(ActionEvent e) { @@ -2289,6 +2390,33 @@ public class GAlignFrame extends JInternalFrame protected void LoadtreeMenuItem_actionPerformed(ActionEvent e) { + + } + + /** + * Template method to handle the 'load T-Coffee scores' menu event. + *

+ * Subclasses override this method to provide a custom action. + * + * @param event + * The raised event + */ + protected void loadScores_actionPerformed(ActionEvent event) + { + + } + + /** + * Template method to handle the 'Color T-Coffee scores' menu event. + *

+ * Subclasses override this method to provide a custom action. + * + * @param event + * The raised event + */ + protected void tcoffeeColorScheme_actionPerformed(ActionEvent event) + { + } protected void jpred_actionPerformed(ActionEvent e)