X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fjbgui%2FGAlignFrame.java;h=304134cde86262ea031de344461a4c522cae2fb7;hb=0b23947e2cdcd704d3f313b23ba271e43d097344;hp=5a404eb255c71b6fc45d5e8a96f0eeb4768d6fd7;hpb=3e52a9c5f970c4ea43a648296893a2aa58ebd137;p=jalview.git diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 5a404eb..304134c 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2006 AM Waterhouse, J Procter, 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 @@ -21,8 +21,13 @@ package jalview.jbgui; import java.awt.*; import java.awt.event.*; import javax.swing.*; +import javax.swing.event.*; import jalview.schemes.*; +import java.awt.BorderLayout; + + + public class GAlignFrame extends JInternalFrame @@ -56,7 +61,7 @@ public class GAlignFrame protected JMenuItem clustalAlignMenuItem = new JMenuItem(); BorderLayout borderLayout1 = new BorderLayout(); public JLabel statusBar = new JLabel(); - protected JMenuItem saveAlignmentMenu = new JMenuItem(); + protected JMenuItem saveAs = new JMenuItem(); protected JMenu outputTextboxMenu = new JMenu(); protected JRadioButtonMenuItem clustalColour = new JRadioButtonMenuItem(); protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem(); @@ -113,15 +118,11 @@ public class GAlignFrame protected JCheckBoxMenuItem padGapsMenuitem = new JCheckBoxMenuItem(); protected ButtonGroup colours = new ButtonGroup(); JMenuItem vamsasStore = new JMenuItem(); - protected JCheckBoxMenuItem showTranslation = new JCheckBoxMenuItem(); + protected JMenuItem showTranslation = new JMenuItem(); public JMenuItem featureSettings = new JMenuItem(); JMenuItem fetchSequence = new JMenuItem(); protected JCheckBoxMenuItem smoothFont = new JCheckBoxMenuItem(); JMenuItem annotationColour = new JMenuItem(); - JMenuItem fetchSeqFeatures = new JMenuItem(); - - - JMenuItem associatedData = new JMenuItem(); protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem(); JMenu addSequenceMenu = new JMenu(); @@ -130,21 +131,30 @@ public class GAlignFrame JMenuItem addFromURL = new JMenuItem(); JMenuItem exportAnnotations = new JMenuItem(); JMenuItem exportFeatures = new JMenuItem(); + protected JPanel statusPanel = new JPanel(); + GridLayout gridLayout1 = new GridLayout(); + JMenu jMenu3 = new JMenu(); + JMenuItem showAllSeqs = new JMenuItem(); + JMenuItem showAllColumns = new JMenuItem(); + JMenu hideMenu = new JMenu(); + JMenuItem hideSelSequences = new JMenuItem(); + JMenuItem hideSelColumns = new JMenuItem(); + protected JCheckBoxMenuItem hiddenMarkers = new JCheckBoxMenuItem(); + JMenuItem invertColSel = new JMenuItem(); + protected JTabbedPane tabbedPane = new JTabbedPane(); + JMenuItem save = new JMenuItem(); public GAlignFrame() { - - try { jbInit(); setJMenuBar(alignFrameMenuBar); // dynamically fill save as menu with available formats - for (int i = 0; i < jalview.io.FormatAdapter.formats.size(); i++) + for (int i = 0; i < jalview.io.FormatAdapter.WRITEABLE_FORMATS.length; i++) { - JMenuItem item = new JMenuItem( (String) jalview.io.FormatAdapter.formats. - elementAt( - i)); + JMenuItem item = new JMenuItem( jalview.io.FormatAdapter.WRITEABLE_FORMATS[i] ); + item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -307,21 +317,21 @@ public class GAlignFrame private void jbInit() throws Exception { - fileMenu.setMnemonic('F'); fileMenu.setText("File"); - saveAlignmentMenu.setMnemonic('L'); - saveAlignmentMenu.setText("Save As"); - saveAlignmentMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java. - awt.event.KeyEvent.VK_S, java.awt.event.KeyEvent.CTRL_MASK, false)); - saveAlignmentMenu.addActionListener(new ActionListener() + saveAs.setText("Save As ..."); + saveAs.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event. + KeyEvent.VK_S, java.awt.event.KeyEvent.ALT_MASK, false)); + saveAs.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - saveAlignmentMenu_actionPerformed(e); + saveAs_actionPerformed(e); } }); closeMenuItem.setMnemonic('C'); closeMenuItem.setText("Close"); + closeMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt. + event.KeyEvent.VK_W, java.awt.event.KeyEvent.CTRL_MASK, false)); closeMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -358,7 +368,10 @@ public class GAlignFrame deselectAllSequenceMenuItem_actionPerformed(e); } }); - invertSequenceMenuItem.setText("Invert Selection"); + invertSequenceMenuItem.setText("Invert Sequence Selection"); + invertSequenceMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke( + java.awt.event.KeyEvent.VK_I, + java.awt.event.KeyEvent.SHIFT_MASK, false)); invertSequenceMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -367,6 +380,8 @@ public class GAlignFrame } }); remove2LeftMenuItem.setText("Remove Left"); + remove2LeftMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java. + awt.event.KeyEvent.VK_L, java.awt.event.KeyEvent.CTRL_MASK, false)); remove2LeftMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -375,6 +390,8 @@ public class GAlignFrame } }); remove2RightMenuItem.setText("Remove Right"); + remove2RightMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java. + awt.event.KeyEvent.VK_R, java.awt.event.KeyEvent.CTRL_MASK, false)); remove2RightMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -383,6 +400,9 @@ public class GAlignFrame } }); removeGappedColumnMenuItem.setText("Remove Empty Columns"); + removeGappedColumnMenuItem.setAccelerator(javax.swing.KeyStroke. + getKeyStroke(java.awt.event. + KeyEvent.VK_E, java.awt.event.KeyEvent.CTRL_MASK, false)); removeGappedColumnMenuItem.addActionListener(new java.awt.event. ActionListener() { @@ -392,6 +412,8 @@ public class GAlignFrame } }); removeAllGapsMenuItem.setText("Remove All Gaps"); + removeAllGapsMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke( + java.awt.event.KeyEvent.VK_G, java.awt.event.KeyEvent.CTRL_MASK, false)); removeAllGapsMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -442,6 +464,8 @@ public class GAlignFrame } }); removeRedundancyMenuItem.setText("Remove Redundancy..."); + removeRedundancyMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke( + java.awt.event.KeyEvent.VK_R, java.awt.event.KeyEvent.CTRL_MASK, false)); removeRedundancyMenuItem.addActionListener(new java.awt.event. ActionListener() { @@ -650,6 +674,8 @@ public class GAlignFrame redoMenuItem.setEnabled(false); redoMenuItem.setMnemonic('0'); redoMenuItem.setText("Redo"); + redoMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt. + event.KeyEvent.VK_Y, java.awt.event.KeyEvent.CTRL_MASK, false)); redoMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -682,6 +708,8 @@ public class GAlignFrame } }); printMenuItem.setText("Print"); + printMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt. + event.KeyEvent.VK_P, java.awt.event.KeyEvent.CTRL_MASK, false)); printMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -736,6 +764,8 @@ public class GAlignFrame } }); deleteGroups.setText("Undefine groups"); + deleteGroups.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt. + event.KeyEvent.VK_U, java.awt.event.KeyEvent.CTRL_MASK, false)); deleteGroups.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -798,7 +828,6 @@ public class GAlignFrame } }); applyToAllGroups.setText("Apply Colour To All Groups"); - applyToAllGroups.setState(true); applyToAllGroups.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -899,7 +928,7 @@ public class GAlignFrame sort.setText("Sort"); calculate.setText("Calculate Tree"); - jMenu2.setText("Export"); + jMenu2.setText("Export Image"); padGapsMenuitem.setText("Pad Gaps"); padGapsMenuitem.setState( jalview.bin.Cache.getDefault("PAD_GAPS", false)); padGapsMenuitem.addActionListener(new ActionListener() @@ -927,14 +956,7 @@ public class GAlignFrame } }); - /* tabbedPane.addChangeListener(new ChangeListener() - { - public void stateChanged(ChangeEvent ece) - { - tabSelected(); - } - });*/ featureSettings.setText("Feature Settings..."); featureSettings.addActionListener(new ActionListener() { @@ -959,7 +981,7 @@ public class GAlignFrame smoothFont_actionPerformed(e); } }); - smoothFont.setState( jalview.bin.Cache.getDefault("ANTI_ALIAS",false)); + annotationColour.setText("By Annotation..."); annotationColour.addActionListener(new ActionListener() { @@ -968,14 +990,6 @@ public class GAlignFrame annotationColour_actionPerformed(e); } }); - fetchSeqFeatures.setText("Fetch Sequence Features"); - fetchSeqFeatures.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - fetchSeqFeatures_actionPerformed(e); - } - }); associatedData.setText("Load Features / Annotations"); associatedData.addActionListener(new ActionListener() { @@ -1034,6 +1048,93 @@ public class GAlignFrame exportAnnotations_actionPerformed(e); } }); + statusPanel.setLayout(gridLayout1); + jMenu3.setText("Show"); + showAllSeqs.setText("All Sequences"); + showAllSeqs.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + showAllSeqs_actionPerformed(e); + } + }); + showAllColumns.setText("All Columns"); + showAllColumns.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + showAllColumns_actionPerformed(e); + } + }); + hideMenu.setText("Hide"); + hideSelSequences.setText("Selected Sequences"); + hideSelSequences.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + hideSelSequences_actionPerformed(e); + } + }); + hideSelColumns.setText("Selected Columns"); + hideSelColumns.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + hideSelColumns_actionPerformed(e); + } + }); + hiddenMarkers.setText("Hidden Markers"); + hiddenMarkers.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + hiddenMarkers_actionPerformed(e); + } + }); + invertColSel.setText("Invert Column Selection"); + invertColSel.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt. + event.KeyEvent.VK_I, java.awt.event.KeyEvent.CTRL_MASK, false)); + invertColSel.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + invertColSel_actionPerformed(e); + } + }); + tabbedPane.addChangeListener(new javax.swing.event.ChangeListener() + { + public void stateChanged(ChangeEvent evt) + { + JTabbedPane pane = (JTabbedPane)evt.getSource(); + int sel = pane.getSelectedIndex(); + tabSelectionChanged(sel); + } + }); + tabbedPane.addMouseListener(new MouseAdapter() + { + public void mousePressed(MouseEvent e) + { + tabbedPane_mousePressed(e); + } + }); + tabbedPane.addFocusListener(new FocusAdapter() + { + public void focusGained(FocusEvent e) + { + tabbedPane_focusGained(e); + } + }); + save.setText("Save"); + save.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event. + KeyEvent.VK_S, java.awt.event.KeyEvent.CTRL_MASK, false)); + save.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + save_actionPerformed(e); + } + }); + alignFrameMenuBar.add(fileMenu); alignFrameMenuBar.add(editMenu); alignFrameMenuBar.add(searchMenu); @@ -1045,11 +1146,12 @@ public class GAlignFrame fileMenu.add(fetchSequence); fileMenu.addSeparator(); fileMenu.add(vamsasStore); - fileMenu.add(saveAlignmentMenu); - fileMenu.add(jMenu2); + fileMenu.add(save); + fileMenu.add(saveAs); fileMenu.add(outputTextboxMenu); fileMenu.add(printMenuItem); fileMenu.addSeparator(); + fileMenu.add(jMenu2); fileMenu.add(exportFeatures); fileMenu.add(exportAnnotations); fileMenu.add(LoadtreeMenuItem); @@ -1066,6 +1168,7 @@ public class GAlignFrame editMenu.add(selectAllSequenceMenuItem); editMenu.add(deselectAllSequenceMenuItem); editMenu.add(invertSequenceMenuItem); + editMenu.add(invertColSel); editMenu.add(deleteGroups); editMenu.addSeparator(); editMenu.add(remove2LeftMenuItem); @@ -1079,6 +1182,10 @@ public class GAlignFrame viewMenu.add(font); viewMenu.add(smoothFont); viewMenu.addSeparator(); + viewMenu.add(jMenu3); + viewMenu.add(hideMenu); + viewMenu.add(hiddenMarkers); + viewMenu.addSeparator(); viewMenu.add(wrapMenuItem); viewMenu.add(seqLimits); viewMenu.add(scaleAbove); @@ -1090,7 +1197,6 @@ public class GAlignFrame viewMenu.add(renderGapsMenuItem); viewMenu.add(annotationPanelMenuItem); viewMenu.addSeparator(); - viewMenu.add(fetchSeqFeatures); viewMenu.add(showSeqFeatures); viewMenu.add(featureSettings); viewMenu.addSeparator(); @@ -1125,9 +1231,7 @@ public class GAlignFrame calculateMenu.add(showTranslation); calculateMenu.add(autoCalculate); webServiceNoServices=new JMenuItem(""); - webService.add(webServiceNoServices); - this.getContentPane().add(statusBar, BorderLayout.SOUTH); - jMenu1.add(pasteNew); + webService.add(webServiceNoServices);jMenu1.add(pasteNew); jMenu1.add(pasteThis); sort.add(sortIDMenuItem); sort.add(sortGroupMenuItem); @@ -1142,6 +1246,13 @@ public class GAlignFrame addSequenceMenu.add(addFromFile); addSequenceMenu.add(addFromText); addSequenceMenu.add(addFromURL); + this.getContentPane().add(statusPanel, java.awt.BorderLayout.SOUTH); + statusPanel.add(statusBar, null); + this.getContentPane().add(tabbedPane, java.awt.BorderLayout.CENTER); + jMenu3.add(showAllColumns); + jMenu3.add(showAllSeqs); + hideMenu.add(hideSelColumns); + hideMenu.add(hideSelSequences); } protected void outputText_actionPerformed(ActionEvent e) @@ -1437,7 +1548,7 @@ public class GAlignFrame - protected void saveAlignmentMenu_actionPerformed(ActionEvent e) + protected void saveAs_actionPerformed(ActionEvent e) { } @@ -1481,17 +1592,78 @@ public class GAlignFrame } - public void fetchSeqFeatures_actionPerformed(ActionEvent e) + + public void associatedData_actionPerformed(ActionEvent e) { } - public void associatedData_actionPerformed(ActionEvent e) + public void autoCalculate_actionPerformed(ActionEvent e) { } - public void autoCalculate_actionPerformed(ActionEvent e) + public void showAllSeqs_actionPerformed(ActionEvent e) + { + + } + + public void showAllColumns_actionPerformed(ActionEvent e) + { + + } + + public void hideSelSequences_actionPerformed(ActionEvent e) + { + + } + + public void hideSelColumns_actionPerformed(ActionEvent e) + { + + } + + public void hiddenMarkers_actionPerformed(ActionEvent e) + { + + } + + public void findPdbId_actionPerformed(ActionEvent e) + { + + } + + public void enterPdbId_actionPerformed(ActionEvent e) + { + + } + + public void pdbFile_actionPerformed(ActionEvent e) + { + + } + + public void invertColSel_actionPerformed(ActionEvent e) + { + + } + + public void tabSelectionChanged(int sel) + { + + } + + public void tabbedPane_mousePressed(MouseEvent e) + { + + } + + public void tabbedPane_focusGained(FocusEvent e) + { + requestFocus(); + } + + public void save_actionPerformed(ActionEvent e) { }