From 58bd8ac0dadcdf50be5b47f160c80afa555a9d89 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 5 Oct 2006 16:21:43 +0000 Subject: [PATCH] TabbedPanes for views --- src/jalview/jbgui/GAlignFrame.java | 45 +++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 15ff707..237cf4c 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -21,10 +21,14 @@ 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 { @@ -132,16 +136,14 @@ public class GAlignFrame JMenu jMenu3 = new JMenu(); JMenuItem showAllSeqs = new JMenuItem(); JMenuItem showAllColumns = new JMenuItem(); - JMenu jMenu4 = new JMenu(); + 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(); @@ -1051,7 +1053,7 @@ public class GAlignFrame showAllColumns_actionPerformed(e); } }); - jMenu4.setText("Hide"); + hideMenu.setText("Hide"); hideSelSequences.setText("Selected Sequences"); hideSelSequences.addActionListener(new ActionListener() { @@ -1085,6 +1087,22 @@ public class GAlignFrame 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); @@ -1133,7 +1151,7 @@ public class GAlignFrame viewMenu.add(smoothFont); viewMenu.addSeparator(); viewMenu.add(jMenu3); - viewMenu.add(jMenu4); + viewMenu.add(hideMenu); viewMenu.add(hiddenMarkers); viewMenu.addSeparator(); viewMenu.add(wrapMenuItem); @@ -1198,10 +1216,11 @@ public class GAlignFrame 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); - jMenu4.add(hideSelColumns); - jMenu4.add(hideSelSequences); + hideMenu.add(hideSelColumns); + hideMenu.add(hideSelSequences); } protected void outputText_actionPerformed(ActionEvent e) @@ -1596,4 +1615,14 @@ public class GAlignFrame { } + + public void tabSelectionChanged(int sel) + { + + } + + public void tabbedPane_mousePressed(MouseEvent e) + { + + } } -- 1.7.10.2