/* * 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(); 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("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); } 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) { } }