Cut and paste menus added
authoramwaterhouse <Andrew Waterhouse>
Fri, 27 May 2005 14:16:38 +0000 (14:16 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 27 May 2005 14:16:38 +0000 (14:16 +0000)
src/jalview/jbgui/GCutAndPasteTransfer.java

index c816886..32fb570 100755 (executable)
@@ -13,15 +13,24 @@ import java.awt.*;
 import java.awt.event.*;\r
 \r
 \r
-public class GCutAndPasteTransfer extends JPanel\r
+public class GCutAndPasteTransfer extends JInternalFrame\r
 {\r
   protected JTextArea textarea = new JTextArea();\r
   protected JScrollPane scrollPane = new JScrollPane();\r
   BorderLayout borderLayout1 = new BorderLayout();\r
+  JMenuBar editMenubar = new JMenuBar();\r
+  JMenu editMenu = new JMenu();\r
+  JMenuItem copyItem = new JMenuItem();\r
+  JMenuItem pasteMenu = new JMenuItem();\r
+  BorderLayout borderLayout2 = new BorderLayout();\r
+  protected JPanel inputButtonPanel = new JPanel();\r
+  JButton ok = new JButton();\r
+  JButton cancel = new JButton();\r
   public GCutAndPasteTransfer()\r
   {\r
     try\r
     {\r
+      setJMenuBar(editMenubar);\r
       jbInit();\r
     }\r
     catch(Exception e)\r
@@ -32,8 +41,27 @@ public class GCutAndPasteTransfer extends JPanel
   }\r
   private void jbInit() throws Exception\r
   {\r
+    scrollPane.setBorder(null);\r
+    ok.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));\r
+    ok.setText("Accept");\r
+    ok.addActionListener(new ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        ok_actionPerformed(e);\r
+      }\r
+    });\r
+    cancel.setText("Cancel");\r
+    cancel.addActionListener(new ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        cancel_actionPerformed(e);\r
+      }\r
+    });\r
+    textarea.setBorder(null);\r
+    editMenubar.add(editMenu);\r
     textarea.setFont(new java.awt.Font("Verdana", 0, 12));\r
-    textarea.setBorder(BorderFactory.createLineBorder(Color.black));\r
     textarea.setText("Paste your alignment file here");\r
     textarea.addMouseListener(new java.awt.event.MouseAdapter()\r
     {\r
@@ -42,10 +70,32 @@ public class GCutAndPasteTransfer extends JPanel
         textarea_mousePressed(e);\r
       }\r
     });\r
-    this.setLayout(borderLayout1);\r
-    this.setPreferredSize(new Dimension(400, 300));\r
+    editMenu.setText("Edit");\r
+    pasteMenu.setText("Paste");\r
+    pasteMenu.addActionListener(new ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        pasteMenu_actionPerformed(e);\r
+      }\r
+    });\r
+    copyItem.setText("Copy");\r
+    copyItem.addActionListener(new ActionListener()\r
+    {\r
+      public void actionPerformed(ActionEvent e)\r
+      {\r
+        copyItem_actionPerformed(e);\r
+      }\r
+    });\r
+    this.getContentPane().setLayout(borderLayout2);\r
+    scrollPane.setBorder(null);\r
     scrollPane.getViewport().add(textarea, null);\r
-    this.add(scrollPane, java.awt.BorderLayout.CENTER);\r
+    editMenu.add(copyItem);\r
+    editMenu.add(pasteMenu);\r
+    this.getContentPane().add(scrollPane, java.awt.BorderLayout.CENTER);\r
+    inputButtonPanel.add(ok);\r
+    inputButtonPanel.add(cancel);\r
+\r
   }\r
 \r
   void textarea_mousePressed(MouseEvent e)\r
@@ -54,4 +104,24 @@ public class GCutAndPasteTransfer extends JPanel
       textarea.setText("");\r
   }\r
 \r
+  public void copyItem_actionPerformed(ActionEvent e)\r
+  {\r
+\r
+  }\r
+\r
+  public void pasteMenu_actionPerformed(ActionEvent e)\r
+  {\r
+\r
+  }\r
+\r
+  public void ok_actionPerformed(ActionEvent e)\r
+  {\r
+\r
+  }\r
+\r
+  public void cancel_actionPerformed(ActionEvent e)\r
+  {\r
+\r
+  }\r
+\r
 }\r