X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGAlignFrame.java;h=237cf4c53ce7eeeb1d41c652451e1528ac2d510c;hb=7749f0e593d610c517dfd6796cf6087191b189ad;hp=422f9a795a2850fdef1a6169fab21f788a2a1f42;hpb=92f2bdf5a7a89ceefe2bff76ca75414cf0fb633c;p=jalview.git diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 422f9a7..237cf4c 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 @@ -113,33 +118,42 @@ public class GAlignFrame protected JCheckBoxMenuItem padGapsMenuitem = new JCheckBoxMenuItem(); protected ButtonGroup colours = new ButtonGroup(); JMenuItem vamsasStore = new JMenuItem(); - protected JCheckBoxMenuItem showTranslation = new JCheckBoxMenuItem(); - //protected JTabbedPane tabbedPane = new JTabbedPane(); + 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(); + JMenuItem addFromFile = new JMenuItem(); + JMenuItem addFromText = new JMenuItem(); + 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(); 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) @@ -353,7 +367,7 @@ public class GAlignFrame deselectAllSequenceMenuItem_actionPerformed(e); } }); - invertSequenceMenuItem.setText("Invert Selection"); + invertSequenceMenuItem.setText("Invert Sequence Selection"); invertSequenceMenuItem.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -896,6 +910,7 @@ public class GAlignFrame jMenu2.setText("Export"); padGapsMenuitem.setText("Pad Gaps"); + padGapsMenuitem.setState( jalview.bin.Cache.getDefault("PAD_GAPS", false)); padGapsMenuitem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -962,14 +977,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() { @@ -987,6 +994,116 @@ public class GAlignFrame autoCalculate_actionPerformed(e); } }); + addSequenceMenu.setText("Add Sequences"); + addFromFile.setText("From File"); + addFromFile.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + addFromFile_actionPerformed(e); + } + }); + addFromText.setText("From Textbox"); + addFromText.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + addFromText_actionPerformed(e); + } + }); + addFromURL.setText("From URL"); + addFromURL.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + addFromURL_actionPerformed(e); + } + }); + exportFeatures.setText("Export Features..."); + exportFeatures.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + exportFeatures_actionPerformed(e); + } + }); + exportAnnotations.setText("Export Annotations..."); + exportAnnotations.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + 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.setState(true); + hiddenMarkers.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + hiddenMarkers_actionPerformed(e); + } + }); + invertColSel.setText("Invert Column Selection"); + 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); + } + }); + alignFrameMenuBar.add(fileMenu); alignFrameMenuBar.add(editMenu); alignFrameMenuBar.add(searchMenu); @@ -994,6 +1111,7 @@ public class GAlignFrame alignFrameMenuBar.add(colourMenu); alignFrameMenuBar.add(calculateMenu); alignFrameMenuBar.add(webService); + fileMenu.add(addSequenceMenu); fileMenu.add(fetchSequence); fileMenu.addSeparator(); fileMenu.add(vamsasStore); @@ -1002,6 +1120,8 @@ public class GAlignFrame fileMenu.add(outputTextboxMenu); fileMenu.add(printMenuItem); fileMenu.addSeparator(); + fileMenu.add(exportFeatures); + fileMenu.add(exportAnnotations); fileMenu.add(LoadtreeMenuItem); fileMenu.add(associatedData); fileMenu.addSeparator(); @@ -1016,6 +1136,7 @@ public class GAlignFrame editMenu.add(selectAllSequenceMenuItem); editMenu.add(deselectAllSequenceMenuItem); editMenu.add(invertSequenceMenuItem); + editMenu.add(invertColSel); editMenu.add(deleteGroups); editMenu.addSeparator(); editMenu.add(remove2LeftMenuItem); @@ -1029,6 +1150,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); @@ -1040,7 +1165,6 @@ public class GAlignFrame viewMenu.add(renderGapsMenuItem); viewMenu.add(annotationPanelMenuItem); viewMenu.addSeparator(); - viewMenu.add(fetchSeqFeatures); viewMenu.add(showSeqFeatures); viewMenu.add(featureSettings); viewMenu.addSeparator(); @@ -1075,10 +1199,7 @@ public class GAlignFrame calculateMenu.add(showTranslation); calculateMenu.add(autoCalculate); webServiceNoServices=new JMenuItem(""); - webService.add(webServiceNoServices); - this.getContentPane().add(statusBar, BorderLayout.SOUTH); - // this.getContentPane().add(tabbedPane, java.awt.BorderLayout.CENTER); - jMenu1.add(pasteNew); + webService.add(webServiceNoServices);jMenu1.add(pasteNew); jMenu1.add(pasteThis); sort.add(sortIDMenuItem); sort.add(sortGroupMenuItem); @@ -1090,12 +1211,47 @@ public class GAlignFrame jMenu2.add(htmlMenuItem); jMenu2.add(epsFile); jMenu2.add(createPNG); + 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) { } + public void addFromFile_actionPerformed(ActionEvent e) + { + + } + + public void addFromText_actionPerformed(ActionEvent e) + { + + } + + public void addFromURL_actionPerformed(ActionEvent e) + { + + } + + public void exportFeatures_actionPerformed(ActionEvent e) + { + + } + + public void exportAnnotations_actionPerformed(ActionEvent e) + { + + } + protected void htmlMenuItem_actionPerformed(ActionEvent e) { } @@ -1404,17 +1560,68 @@ public class GAlignFrame } - public void fetchSeqFeatures_actionPerformed(ActionEvent e) + + public void associatedData_actionPerformed(ActionEvent e) + { + + } + + public void autoCalculate_actionPerformed(ActionEvent e) { } - public void associatedData_actionPerformed(ActionEvent e) + public void showAllSeqs_actionPerformed(ActionEvent e) { } - public void autoCalculate_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) { }