treepanel is now internalframe, has a menu
authoramwaterhouse <Andrew Waterhouse>
Fri, 18 Feb 2005 12:28:36 +0000 (12:28 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 18 Feb 2005 12:28:36 +0000 (12:28 +0000)
src/jalview/jbgui/GTreePanel.java

index 43ee7c9..4b18fd3 100755 (executable)
@@ -4,105 +4,120 @@ import java.awt.*;
 import javax.swing.*;
 import java.awt.event.*;
 
-public class GTreePanel extends JPanel
+public class GTreePanel extends JInternalFrame
 {
   BorderLayout borderLayout1 = new BorderLayout();
-  JPanel jPanel1 = new JPanel();
-  JLabel jLabel1 = new JLabel();
-  protected JComboBox fontSizeCombobox = new JComboBox();
-  protected JCheckBox showDistanceCheckbox = new JCheckBox();
-  protected JButton saveButton = new JButton();
-  protected JCheckBox bootStrapCheckBox = new JCheckBox();
   protected JScrollPane scrollPane = new JScrollPane();
+  JMenuBar jMenuBar1 = new JMenuBar();
+  JMenu jMenu1 = new JMenu();
+  JMenuItem saveMenu = new JMenuItem();
+  JMenuItem printMenu = new JMenuItem();
+  JMenu jMenu2 = new JMenu();
+  protected JMenuItem fontSize = new JMenuItem();
+  protected JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem();
+  protected JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem();
 
   public GTreePanel()
   {
     try
     {
       jbInit();
+      this.setJMenuBar(jMenuBar1);
     }
     catch(Exception e)
     {
       e.printStackTrace();
     }
 
-    for(int i=2; i<26; i+=2)
-       fontSizeCombobox.addItem(i+"");
-    fontSizeCombobox.setSelectedItem("12");
-
   }
   private void jbInit() throws Exception
   {
-    this.setLayout(borderLayout1);
-    jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
-    jLabel1.setText("Font size");
-    showDistanceCheckbox.setFont(new java.awt.Font("Verdana", 0, 12));
-    showDistanceCheckbox.setText("Show distances");
-    showDistanceCheckbox.addActionListener(new java.awt.event.ActionListener()
+    this.getContentPane().setLayout(borderLayout1);
+    this.setBackground(Color.white);
+    this.setFont(new java.awt.Font("Verdana", 0, 12));
+    this.setMinimumSize(new Dimension(530, 60));
+    scrollPane.setOpaque(false);
+    jMenu1.setText("File");
+    saveMenu.setEnabled(false);
+    saveMenu.setText("Save");
+    saveMenu.addActionListener(new java.awt.event.ActionListener()
     {
       public void actionPerformed(ActionEvent e)
       {
-        showDistanceCheckbox_actionPerformed(e);
+        saveMenu_actionPerformed(e);
       }
     });
-    saveButton.setFont(new java.awt.Font("Verdana", 0, 12));
-    saveButton.setToolTipText("");
-    saveButton.setText("Save as postscript");
-    saveButton.addActionListener(new java.awt.event.ActionListener()
+    printMenu.setText("Print");
+    printMenu.addActionListener(new java.awt.event.ActionListener()
     {
       public void actionPerformed(ActionEvent e)
       {
-        saveButton_actionPerformed(e);
+        printMenu_actionPerformed(e);
       }
     });
-    this.setBackground(Color.white);
-    this.setFont(new java.awt.Font("Verdana", 0, 12));
-    this.setMinimumSize(new Dimension(530, 60));
-    fontSizeCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
-    fontSizeCombobox.addActionListener(new java.awt.event.ActionListener()
+    jMenu2.setText("View");
+    fontSize.setText("Font Size - 12");
+    fontSize.addActionListener(new java.awt.event.ActionListener()
     {
       public void actionPerformed(ActionEvent e)
       {
-        fontSizeCombobox_actionPerformed(e);
+        fontSize_actionPerformed(e);
       }
     });
-    bootStrapCheckBox.setFont(new java.awt.Font("Verdana", 0, 12));
-    bootStrapCheckBox.setText("Show bootstrap");
-    bootStrapCheckBox.addActionListener(new java.awt.event.ActionListener()
+    bootstrapMenu.setText("Show Bootstrap values");
+    bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
     {
       public void actionPerformed(ActionEvent e)
       {
-        bootStrapCheckBox_actionPerformed(e);
+        bootstrapMenu_actionPerformed(e);
       }
     });
-    scrollPane.setOpaque(false);
-    this.add(jPanel1, BorderLayout.SOUTH);
-    jPanel1.add(jLabel1, null);
-    jPanel1.add(fontSizeCombobox, null);
-    jPanel1.add(showDistanceCheckbox, null);
-    jPanel1.add(bootStrapCheckBox, null);
-    jPanel1.add(saveButton, null);
-    this.add(scrollPane, BorderLayout.CENTER);
+    distanceMenu.setText("Show Distances");
+    distanceMenu.addActionListener(new java.awt.event.ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        distanceMenu_actionPerformed(e);
+      }
+    });
+    this.getContentPane().add(scrollPane, BorderLayout.CENTER);
+    jMenuBar1.add(jMenu1);
+    jMenuBar1.add(jMenu2);
+    jMenu1.add(saveMenu);
+    jMenu1.add(printMenu);
+    jMenu2.add(fontSize);
+    jMenu2.add(distanceMenu);
+    jMenu2.add(bootstrapMenu);
   }
 
+  protected void saveMenu_actionPerformed(ActionEvent e)
+  {
+
+  }
 
-  public void saveButton_actionPerformed(ActionEvent e)
+  protected void printMenu_actionPerformed(ActionEvent e)
   {
 
   }
 
-  public void showDistanceCheckbox_actionPerformed(ActionEvent e)
+  protected void fontSize_actionPerformed(ActionEvent e)
   {
 
   }
 
-  public void fontSizeCombobox_actionPerformed(ActionEvent e)
+  protected void distanceMenu_actionPerformed(ActionEvent e)
   {
 
   }
 
-  public void bootStrapCheckBox_actionPerformed(ActionEvent e)
+  protected void bootstrapMenu_actionPerformed(ActionEvent e)
   {
 
   }
+
+
+
+
+
+
 }