X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbappletgui%2FGCutAndPasteTransfer.java;h=907ec0a79466e3a665d8125627dfe28afc8f248b;hb=a3c9ea9db5a8d02b1db4640809a2b4c825ed3245;hp=94aea3f4ea5a184f90fe34b73af8ca6fa96978d6;hpb=ec955aa655d8320258b91eb079bc57f688cd0a07;p=jalview.git diff --git a/src/jalview/jbappletgui/GCutAndPasteTransfer.java b/src/jalview/jbappletgui/GCutAndPasteTransfer.java index 94aea3f..907ec0a 100755 --- a/src/jalview/jbappletgui/GCutAndPasteTransfer.java +++ b/src/jalview/jbappletgui/GCutAndPasteTransfer.java @@ -1,85 +1,78 @@ -/******************** - * 2004 Jalview Reengineered - * Barton Group - * Dundee University - * - * AM Waterhouse - *******************/ - +/* +* Jalview - A Sequence Alignment Editor and Viewer +* Copyright (C) 2005 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 +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +*/ package jalview.jbappletgui; import java.awt.*; import java.awt.event.*; -public class GCutAndPasteTransfer extends Panel -{ - protected TextArea textarea = new TextArea(); - protected ScrollPane scrollPane = new ScrollPane(); - Button ok = new Button(); - Button cancel = new Button(); - protected Panel buttonPanel = new Panel(); - BorderLayout borderLayout1 = new BorderLayout(); - public GCutAndPasteTransfer() - { - try - { - jbInit(); - } - catch(Exception e) - { - e.printStackTrace(); - } - - } - private void jbInit() throws Exception - { - textarea.setFont(new java.awt.Font("Verdana", 0, 12)); - textarea.setText("Paste your alignment file here"); - textarea.addMouseListener(new java.awt.event.MouseAdapter() - { - public void mousePressed(MouseEvent e) - { - textarea_mousePressed(e); - } - }); - this.setLayout(borderLayout1); - ok.setLabel("OK"); - ok.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(ActionEvent e) { - ok_actionPerformed(e); - } - }); - cancel.setLabel("Cancel"); - cancel.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(ActionEvent e) { - cancel_actionPerformed(e); - } - }); - scrollPane.setVisible(true); - this.add(scrollPane, BorderLayout.CENTER); - this.add(buttonPanel, BorderLayout.SOUTH); - buttonPanel.add(ok, null); - buttonPanel.add(cancel, null); - scrollPane.add(textarea, null); - - } - - +public class GCutAndPasteTransfer extends Panel { + protected TextArea textarea = new TextArea(); + Button ok = new Button(); + Button cancel = new Button(); + protected Panel buttonPanel = new Panel(); + BorderLayout borderLayout1 = new BorderLayout(); + public GCutAndPasteTransfer() { + try { + jbInit(); + } catch (Exception e) { + e.printStackTrace(); + } + } - void textarea_mousePressed(MouseEvent e) - { - if(textarea.getText().equals("Paste your alignment file here")) - textarea.setText(""); - } - - protected void ok_actionPerformed(ActionEvent e) { - - } + private void jbInit() throws Exception { + textarea.setFont(new java.awt.Font("Monospaced", Font.PLAIN, 10)); + textarea.setText("Paste your alignment file here"); + textarea.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(MouseEvent e) { + textarea_mousePressed(e); + } + }); + this.setLayout(borderLayout1); + ok.setLabel("OK"); + ok.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(ActionEvent e) { + ok_actionPerformed(e); + } + }); + cancel.setLabel("Cancel"); + cancel.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(ActionEvent e) { + cancel_actionPerformed(e); + } + }); + this.add(buttonPanel, BorderLayout.SOUTH); + buttonPanel.add(ok, null); + buttonPanel.add(cancel, null); + this.add(textarea, java.awt.BorderLayout.CENTER); + } - protected void cancel_actionPerformed(ActionEvent e) { + void textarea_mousePressed(MouseEvent e) { + if (textarea.getText().equals("Paste your alignment file here")) { + textarea.setText(""); + } + } - } + protected void ok_actionPerformed(ActionEvent e) { + } + protected void cancel_actionPerformed(ActionEvent e) { + } }