X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FCutAndPasteTransfer.java;h=46f3d701fdcd9fd3be30d3dbaf80885a88b00f0f;hb=efc31b4a8d5cee63555586804a2b79c06bdb5a14;hp=b774cdfa16584038cacaae9e1daf5bf3135a02f6;hpb=2dc37f2894e16ec280d3f9a6292bf4e434eaaed8;p=jalview.git diff --git a/src/jalview/appletgui/CutAndPasteTransfer.java b/src/jalview/appletgui/CutAndPasteTransfer.java index b774cdf..46f3d70 100755 --- a/src/jalview/appletgui/CutAndPasteTransfer.java +++ b/src/jalview/appletgui/CutAndPasteTransfer.java @@ -1,32 +1,44 @@ -/******************** - * 2004 Jalview Reengineered - * Barton Group - * Dundee University +/* + * Jalview - A Sequence Alignment Editor and Viewer + * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * - * AM Waterhouse - *******************/ + * 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.appletgui; -import jalview.jbappletgui.GCutAndPasteTransfer; -import jalview.datamodel.*; -import jalview.io.*; import java.awt.*; import java.awt.event.*; -public class CutAndPasteTransfer extends GCutAndPasteTransfer +import jalview.datamodel.*; +import jalview.io.*; +import jalview.jbappletgui.*; + +public class CutAndPasteTransfer + extends GCutAndPasteTransfer { public CutAndPasteTransfer(boolean forImport) { super(); - if(!forImport) + if (!forImport) { buttonPanel.setVisible(false); } } - public String getText() { return textarea.getText(); @@ -37,10 +49,26 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer textarea.setText(text); } - protected void ok_actionPerformed(ActionEvent e) { String text = getText(); + int length = text.length(); + textarea.append("\n"); + if(textarea.getText().length()==length) + { + String warning = "\n\n#################################################\n" + +"WARNING!! THIS IS THE MAXIMUM SIZE OF TEXTAREA!!\n" + +"\nCAN'T INPUT FULL ALIGNMENT" + +"\n\nYOU MUST DELETE THIS WARNING TO CONTINUE" + +"\n\nMAKE SURE LAST SEQUENCE PASTED IS COMPLETE" + +"\n#################################################\n"; + textarea.setText(text.substring(0, text.length()-warning.length()) + +warning); + + textarea.setCaretPosition(text.length()); + return; + } + SequenceI[] sequences = null; String format = IdentifyFile.Identify(text, "Paste"); @@ -57,14 +85,12 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer Frame frame = (Frame)this.getParent(); frame.setVisible(false); - } - - protected void cancel_actionPerformed(ActionEvent e) { - Frame frame = (Frame)this.getParent(); - frame.setVisible(false); - } - - + } + protected void cancel_actionPerformed(ActionEvent e) + { + Frame frame = (Frame)this.getParent(); + frame.setVisible(false); + } }