TabbedPanes for views
authoramwaterhouse <Andrew Waterhouse>
Thu, 5 Oct 2006 16:21:43 +0000 (16:21 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 5 Oct 2006 16:21:43 +0000 (16:21 +0000)
src/jalview/jbgui/GAlignFrame.java

index 15ff707..237cf4c 100755 (executable)
@@ -21,10 +21,14 @@ package jalview.jbgui;
 import java.awt.*;\r
 import java.awt.event.*;\r
 import javax.swing.*;\r
+import javax.swing.event.*;\r
 \r
 import jalview.schemes.*;\r
 import java.awt.BorderLayout;\r
 \r
+\r
+\r
+\r
 public class GAlignFrame\r
     extends JInternalFrame\r
 {\r
@@ -132,16 +136,14 @@ public class GAlignFrame
   JMenu jMenu3 = new JMenu();\r
   JMenuItem showAllSeqs = new JMenuItem();\r
   JMenuItem showAllColumns = new JMenuItem();\r
-  JMenu jMenu4 = new JMenu();\r
+  JMenu hideMenu = new JMenu();\r
   JMenuItem hideSelSequences = new JMenuItem();\r
   JMenuItem hideSelColumns = new JMenuItem();\r
   protected JCheckBoxMenuItem hiddenMarkers = new JCheckBoxMenuItem();\r
   JMenuItem invertColSel = new JMenuItem();\r
-\r
+  protected JTabbedPane tabbedPane = new JTabbedPane();\r
   public GAlignFrame()\r
   {\r
-\r
-\r
     try\r
     {\r
       jbInit();\r
@@ -1051,7 +1053,7 @@ public class GAlignFrame
         showAllColumns_actionPerformed(e);\r
       }\r
     });\r
-    jMenu4.setText("Hide");\r
+    hideMenu.setText("Hide");\r
     hideSelSequences.setText("Selected Sequences");\r
     hideSelSequences.addActionListener(new ActionListener()\r
     {\r
@@ -1085,6 +1087,22 @@ public class GAlignFrame
         invertColSel_actionPerformed(e);\r
       }\r
     });\r
+    tabbedPane.addChangeListener(new javax.swing.event.ChangeListener()\r
+    {\r
+        public void stateChanged(ChangeEvent evt)\r
+        {\r
+            JTabbedPane pane = (JTabbedPane)evt.getSource();\r
+            int sel = pane.getSelectedIndex();\r
+            tabSelectionChanged(sel);\r
+        }\r
+    });\r
+    tabbedPane.addMouseListener(new MouseAdapter()\r
+    {\r
+      public void mousePressed(MouseEvent e)\r
+      {\r
+        tabbedPane_mousePressed(e);\r
+      }\r
+    });\r
 \r
     alignFrameMenuBar.add(fileMenu);\r
     alignFrameMenuBar.add(editMenu);\r
@@ -1133,7 +1151,7 @@ public class GAlignFrame
     viewMenu.add(smoothFont);\r
     viewMenu.addSeparator();\r
     viewMenu.add(jMenu3);\r
-    viewMenu.add(jMenu4);\r
+    viewMenu.add(hideMenu);\r
     viewMenu.add(hiddenMarkers);\r
     viewMenu.addSeparator();\r
     viewMenu.add(wrapMenuItem);\r
@@ -1198,10 +1216,11 @@ public class GAlignFrame
     addSequenceMenu.add(addFromURL);\r
     this.getContentPane().add(statusPanel, java.awt.BorderLayout.SOUTH);\r
     statusPanel.add(statusBar, null);\r
+    this.getContentPane().add(tabbedPane, java.awt.BorderLayout.CENTER);\r
     jMenu3.add(showAllColumns);\r
     jMenu3.add(showAllSeqs);\r
-    jMenu4.add(hideSelColumns);\r
-    jMenu4.add(hideSelSequences);\r
+    hideMenu.add(hideSelColumns);\r
+    hideMenu.add(hideSelSequences);\r
   }\r
 \r
   protected void outputText_actionPerformed(ActionEvent e)\r
@@ -1596,4 +1615,14 @@ public class GAlignFrame
   {\r
 \r
   }\r
+\r
+  public void tabSelectionChanged(int sel)\r
+  {\r
+\r
+  }\r
+\r
+  public void tabbedPane_mousePressed(MouseEvent e)\r
+  {\r
+\r
+  }\r
 }\r