X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=bin%2Fjalview%2Fappletgui%2FCutAndPasteTransfer.js;h=4030094069ab61181e6517a0417d179c792bdf85;hp=c1e339af043e57470fafa347f26ea9bbeaaefdf3;hb=7301a2415adab88038b291fc54caeeb3a5a47a44;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921 diff --git a/bin/jalview/appletgui/CutAndPasteTransfer.js b/bin/jalview/appletgui/CutAndPasteTransfer.js index c1e339a..4030094 100644 --- a/bin/jalview/appletgui/CutAndPasteTransfer.js +++ b/bin/jalview/appletgui/CutAndPasteTransfer.js @@ -1,264 +1,264 @@ -Clazz.declarePackage ("jalview.appletgui"); -Clazz.load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.MouseListener", "awt2swing.Button", "$.TextArea", "java.awt.BorderLayout"], "jalview.appletgui.CutAndPasteTransfer", ["awt2swing.Frame", "$.Label", "jalview.analysis.AlignmentUtils", "jalview.api.ComplexAlignFile", "jalview.appletgui.AlignFrame", "$.AppletJmol", "$.JVDialog", "$.SplitFrame", "jalview.datamodel.PDBEntry", "jalview.io.AnnotationFile", "$.AppletFormatAdapter", "$.IdentifyFile", "$.NewickFile", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.TCoffeeColourScheme", "jalview.util.MessageManager", "java.awt.Font"], function () { -c$ = Clazz.decorateAsClass (function () { -this.pdbImport = false; -this.treeImport = false; -this.annotationImport = false; -this.seq = null; -this.alignFrame = null; -this.source = null; -this.textarea = null; -this.accept = null; -this.addSequences = null; -this.$cancel = null; -this.buttonPanel = null; -this.borderLayout1 = null; -Clazz.instantialize (this, arguments); -}, jalview.appletgui, "CutAndPasteTransfer", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.MouseListener]); -Clazz.prepareFields (c$, function () { -this.textarea = new awt2swing.TextArea (); -this.accept = new awt2swing.Button ("New Window"); -this.addSequences = new awt2swing.Button ("Add to Current Alignment"); -this.$cancel = new awt2swing.Button ("Close"); -this.buttonPanel = new awt2swing.Panel (); -this.borderLayout1 = new java.awt.BorderLayout (); -}); -Clazz.makeConstructor (c$, -function (forImport, alignFrame) { -Clazz.superConstructor (this, jalview.appletgui.CutAndPasteTransfer, []); -try { -this.jbInit (); -} catch (e) { -if (Clazz.exceptionOf (e, Exception)) { -e.printStackTrace (); -} else { -throw e; -} -} -this.alignFrame = alignFrame; -if (!forImport) { -this.buttonPanel.setVisible (false); -}}, "~B,jalview.appletgui.AlignFrame"); -Clazz.defineMethod (c$, "getText", -function () { -return this.textarea.getText (); -}); -Clazz.defineMethod (c$, "setText", -function (text) { -this.textarea.setText (text); -}, "~S"); -Clazz.defineMethod (c$, "setPDBImport", -function (seq) { -this.seq = seq; -this.accept.setLabel (jalview.util.MessageManager.getString ("action.accept")); -this.addSequences.setVisible (false); -this.pdbImport = true; -}, "jalview.datamodel.SequenceI"); -Clazz.defineMethod (c$, "setTreeImport", -function () { -this.treeImport = true; -this.accept.setLabel (jalview.util.MessageManager.getString ("action.accept")); -this.addSequences.setVisible (false); -}); -Clazz.defineMethod (c$, "setAnnotationImport", -function () { -this.annotationImport = true; -this.accept.setLabel (jalview.util.MessageManager.getString ("action.accept")); -this.addSequences.setVisible (false); -}); -Clazz.overrideMethod (c$, "actionPerformed", -function (evt) { -if (evt.getSource () === this.accept) { -this.ok (true); -} else if (evt.getSource () === this.addSequences) { -this.ok (false); -} else if (evt.getSource () === this.$cancel) { -this.cancel (); -}}, "java.awt.event.ActionEvent"); -Clazz.defineMethod (c$, "ok", -function (newWindow) { -var text = this.getText (); -var length = text.length; -this.textarea.append ("\n"); -if (this.textarea.getText ().length == length) { -var warning = "\n\n#################################################\nWARNING!! 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"; -this.textarea.setText (text.substring (0, text.length - warning.length) + warning); -this.textarea.setCaretPosition (text.length); -}if (this.pdbImport) { -this.openPdbViewer (text); -} else if (this.treeImport) { -if (!this.loadTree ()) { -return; -}} else if (this.annotationImport) { -this.loadAnnotations (); -} else if (this.alignFrame != null) { -this.loadAlignment (text, newWindow, this.alignFrame.getAlignViewport ()); -}if (Clazz.instanceOf (this.getParent (), awt2swing.Frame)) { -(this.getParent ()).setVisible (false); -} else { -(this.getParent ()).setVisible (false); -}}, "~B"); -Clazz.defineMethod (c$, "loadTree", -function () { -try { -var fin = new jalview.io.NewickFile (this.textarea.getText (), "Paste"); -fin.parse (); -if (fin.getTree () != null) { -this.alignFrame.loadTree (fin, "Pasted tree file"); -return true; -}} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -this.textarea.setText (jalview.util.MessageManager.formatMessage ("label.could_not_parse_newick_file", Clazz.newArray (-1, [ex.getMessage ()]))); -return false; -} else { -throw ex; -} -} -return false; -}); -Clazz.defineMethod (c$, "loadAlignment", -function (text, newWindow, viewport) { -var al = null; -var format = new jalview.io.IdentifyFile ().Identify (text, jalview.io.AppletFormatAdapter.PASTE); -var afa = new jalview.io.AppletFormatAdapter (this.alignFrame.alignPanel); -try { -al = afa.readFile (text, jalview.io.AppletFormatAdapter.PASTE, format); -this.source = afa.getAlignFile (); -} catch (ex) { -if (Clazz.exceptionOf (ex, java.io.IOException)) { -ex.printStackTrace (); -} else { -throw ex; -} -} -if (al != null) { -al.setDataset (null); -var allowSplitFrame = this.alignFrame.viewport.applet.getDefaultParameter ("enableSplitFrame", false); -if (allowSplitFrame && this.openSplitFrame (al, format)) { -return; -}if (newWindow) { -var af; -if (Clazz.instanceOf (this.source, jalview.api.ComplexAlignFile)) { -var colSel = (this.source).getColumnSelection (); -var hiddenSeqs = (this.source).getHiddenSequences (); -var showSeqFeatures = (this.source).isShowSeqFeatures (); -var cs = (this.source).getColourScheme (); -af = new jalview.appletgui.AlignFrame (al, hiddenSeqs, colSel, this.alignFrame.viewport.applet, "Cut & Paste input - " + format, false); -af.getAlignViewport ().setShowSequenceFeatures (showSeqFeatures); -af.changeColour (cs); -} else { -af = new jalview.appletgui.AlignFrame (al, this.alignFrame.viewport.applet, "Cut & Paste input - " + format, false); -}af.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_annotation_to_alignment")); -} else { -this.alignFrame.addSequences (al.getSequencesArray ()); -this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_alignment_file")); -}}}, "~S,~B,jalview.appletgui.AlignViewport"); -Clazz.defineMethod (c$, "openSplitFrame", -function (al, format) { -var thisAlignment = this.alignFrame.getAlignViewport ().getAlignment (); -if (thisAlignment.isNucleotide () == al.isNucleotide ()) { -return false; -}var protein = thisAlignment.isNucleotide () ? al : thisAlignment; -var dna = thisAlignment.isNucleotide () ? thisAlignment : al; -var mapped = jalview.analysis.AlignmentUtils.mapProteinToCdna (protein, dna); -if (!mapped) { -return false; -}var title = jalview.util.MessageManager.getString ("label.open_split_window"); -var dialog = new jalview.appletgui.JVDialog (this.getParent (), title, true, 100, 400); -dialog.ok.setLabel (jalview.util.MessageManager.getString ("action.yes")); -dialog.cancel.setLabel (jalview.util.MessageManager.getString ("action.no")); -var question = new awt2swing.Panel ( new java.awt.BorderLayout ()); -var text = jalview.util.MessageManager.getString ("label.open_split_window?"); -question.add ( new awt2swing.Label (text, 0), "Center"); -dialog.setMainPanel (question); -dialog.setVisible (true); -dialog.toFront (); -if (!dialog.accept) { -return false; -}var applet = this.alignFrame.viewport.applet; -var copyFrame = new jalview.appletgui.AlignFrame (this.alignFrame.viewport.getAlignment (), applet, this.alignFrame.getTitle (), false, false); -var newFrame = new jalview.appletgui.AlignFrame (al, this.alignFrame.viewport.applet, "Cut & Paste input - " + format, false, false); -var dnaFrame = al.isNucleotide () ? newFrame : copyFrame; -var proteinFrame = al.isNucleotide () ? copyFrame : newFrame; -var sf = new jalview.appletgui.SplitFrame (dnaFrame, proteinFrame); -sf.addToDisplay (false, applet); -return true; -}, "jalview.datamodel.AlignmentI,~S"); -Clazz.defineMethod (c$, "loadAnnotations", -function () { -var tcf = null; -try { -tcf = jalview.jsdev.GenericFileAdapter.getFile ("TCoffeeScoreFile", [this.textarea.getText (), jalview.io.AppletFormatAdapter.PASTE]); -if (tcf.isValid ()) { -if (tcf.annotateAlignment (this.alignFrame.viewport.getAlignment (), true)) { -this.alignFrame.tcoffeeColour.setEnabled (true); -this.alignFrame.alignPanel.fontChanged (); -this.alignFrame.changeColour ( new jalview.schemes.TCoffeeColourScheme (this.alignFrame.viewport.getAlignment ())); -this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_tcoffee_scores_to_alignment")); -} else { -this.alignFrame.setStatus (jalview.util.MessageManager.formatMessage ("label.failed_add_tcoffee_scores", Clazz.newArray (-1, [(tcf.getWarningMessage () != null ? tcf.getWarningMessage () : "")]))); -}} else { -tcf = null; -}} catch (x) { -if (Clazz.exceptionOf (x, Exception)) { -tcf = null; -} else { -throw x; -} -} -if (tcf == null) { -if ( new jalview.io.AnnotationFile ().annotateAlignmentView (this.alignFrame.viewport, this.textarea.getText (), jalview.io.AppletFormatAdapter.PASTE)) { -this.alignFrame.alignPanel.fontChanged (); -this.alignFrame.alignPanel.setScrollValues (0, 0); -this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_annotation_to_alignment")); -} else { -if (!this.alignFrame.parseFeaturesFile (this.textarea.getText (), jalview.io.AppletFormatAdapter.PASTE)) { -this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.couldnt_parse_pasted_text_as_valid_annotation_feature_GFF_tcoffee_file")); -}}}}); -Clazz.defineMethod (c$, "openPdbViewer", -function (text) { -var pdb = new jalview.datamodel.PDBEntry (); -pdb.setFile (text); - new jalview.appletgui.AppletJmol (pdb, Clazz.newArray (-1, [this.seq]), null, this.alignFrame.alignPanel, jalview.io.AppletFormatAdapter.PASTE); -}, "~S"); -Clazz.defineMethod (c$, "cancel", -function () { -this.textarea.setText (""); -if (Clazz.instanceOf (this.getParent (), awt2swing.Frame)) { -(this.getParent ()).setVisible (false); -} else { -(this.getParent ()).setVisible (false); -}}); -Clazz.defineMethod (c$, "jbInit", -($fz = function () { -this.textarea.setFont ( new java.awt.Font ("Monospaced", 0, 10)); -this.textarea.setText (jalview.util.MessageManager.getString ("label.paste_your_alignment_file")); -this.textarea.addMouseListener (this); -this.setLayout (this.borderLayout1); -this.accept.addActionListener (this); -this.addSequences.addActionListener (this); -this.$cancel.addActionListener (this); -this.add (this.buttonPanel, "South"); -this.buttonPanel.add (this.accept, null); -this.buttonPanel.add (this.addSequences); -this.buttonPanel.add (this.$cancel, null); -this.add (this.textarea, "Center"); -}, $fz.isPrivate = true, $fz)); -Clazz.overrideMethod (c$, "mousePressed", -function (evt) { -if (this.textarea.getText ().startsWith (jalview.util.MessageManager.getString ("label.paste_your"))) { -this.textarea.setText (""); -}}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseReleased", -function (evt) { -}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseClicked", -function (evt) { -}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseEntered", -function (evt) { -}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseExited", -function (evt) { -}, "java.awt.event.MouseEvent"); -}); +Clazz.declarePackage ("jalview.appletgui"); +Clazz.load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.MouseListener", "awt2swing.Button", "$.TextArea", "java.awt.BorderLayout"], "jalview.appletgui.CutAndPasteTransfer", ["awt2swing.Frame", "$.Label", "jalview.analysis.AlignmentUtils", "jalview.api.ComplexAlignFile", "jalview.appletgui.AlignFrame", "$.AppletJmol", "$.JVDialog", "$.SplitFrame", "jalview.datamodel.PDBEntry", "jalview.io.AnnotationFile", "$.AppletFormatAdapter", "$.IdentifyFile", "$.NewickFile", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.TCoffeeColourScheme", "jalview.util.MessageManager", "java.awt.Font"], function () { +c$ = Clazz.decorateAsClass (function () { +this.pdbImport = false; +this.treeImport = false; +this.annotationImport = false; +this.seq = null; +this.alignFrame = null; +this.source = null; +this.textarea = null; +this.accept = null; +this.addSequences = null; +this.$cancel = null; +this.buttonPanel = null; +this.borderLayout1 = null; +Clazz.instantialize (this, arguments); +}, jalview.appletgui, "CutAndPasteTransfer", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.MouseListener]); +Clazz.prepareFields (c$, function () { +this.textarea = new awt2swing.TextArea (); +this.accept = new awt2swing.Button ("New Window"); +this.addSequences = new awt2swing.Button ("Add to Current Alignment"); +this.$cancel = new awt2swing.Button ("Close"); +this.buttonPanel = new awt2swing.Panel (); +this.borderLayout1 = new java.awt.BorderLayout (); +}); +Clazz.makeConstructor (c$, +function (forImport, alignFrame) { +Clazz.superConstructor (this, jalview.appletgui.CutAndPasteTransfer, []); +try { +this.jbInit (); +} catch (e) { +if (Clazz.exceptionOf (e, Exception)) { +e.printStackTrace (); +} else { +throw e; +} +} +this.alignFrame = alignFrame; +if (!forImport) { +this.buttonPanel.setVisible (false); +}}, "~B,jalview.appletgui.AlignFrame"); +Clazz.defineMethod (c$, "getText", +function () { +return this.textarea.getText (); +}); +Clazz.defineMethod (c$, "setText", +function (text) { +this.textarea.setText (text); +}, "~S"); +Clazz.defineMethod (c$, "setPDBImport", +function (seq) { +this.seq = seq; +this.accept.setLabel (jalview.util.MessageManager.getString ("action.accept")); +this.addSequences.setVisible (false); +this.pdbImport = true; +}, "jalview.datamodel.SequenceI"); +Clazz.defineMethod (c$, "setTreeImport", +function () { +this.treeImport = true; +this.accept.setLabel (jalview.util.MessageManager.getString ("action.accept")); +this.addSequences.setVisible (false); +}); +Clazz.defineMethod (c$, "setAnnotationImport", +function () { +this.annotationImport = true; +this.accept.setLabel (jalview.util.MessageManager.getString ("action.accept")); +this.addSequences.setVisible (false); +}); +Clazz.overrideMethod (c$, "actionPerformed", +function (evt) { +if (evt.getSource () === this.accept) { +this.ok (true); +} else if (evt.getSource () === this.addSequences) { +this.ok (false); +} else if (evt.getSource () === this.$cancel) { +this.cancel (); +}}, "java.awt.event.ActionEvent"); +Clazz.defineMethod (c$, "ok", +function (newWindow) { +var text = this.getText (); +var length = text.length; +this.textarea.append ("\n"); +if (this.textarea.getText ().length == length) { +var warning = "\n\n#################################################\nWARNING!! 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"; +this.textarea.setText (text.substring (0, text.length - warning.length) + warning); +this.textarea.setCaretPosition (text.length); +}if (this.pdbImport) { +this.openPdbViewer (text); +} else if (this.treeImport) { +if (!this.loadTree ()) { +return; +}} else if (this.annotationImport) { +this.loadAnnotations (); +} else if (this.alignFrame != null) { +this.loadAlignment (text, newWindow, this.alignFrame.getAlignViewport ()); +}if (Clazz.instanceOf (this.getParent (), awt2swing.Frame)) { +(this.getParent ()).setVisible (false); +} else { +(this.getParent ()).setVisible (false); +}}, "~B"); +Clazz.defineMethod (c$, "loadTree", +function () { +try { +var fin = new jalview.io.NewickFile (this.textarea.getText (), "Paste"); +fin.parse (); +if (fin.getTree () != null) { +this.alignFrame.loadTree (fin, "Pasted tree file"); +return true; +}} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +this.textarea.setText (jalview.util.MessageManager.formatMessage ("label.could_not_parse_newick_file", Clazz.newArray (-1, [ex.getMessage ()]))); +return false; +} else { +throw ex; +} +} +return false; +}); +Clazz.defineMethod (c$, "loadAlignment", +function (text, newWindow, viewport) { +var al = null; +var format = new jalview.io.IdentifyFile ().Identify (text, jalview.io.AppletFormatAdapter.PASTE); +var afa = new jalview.io.AppletFormatAdapter (this.alignFrame.alignPanel); +try { +al = afa.readFile (text, jalview.io.AppletFormatAdapter.PASTE, format); +this.source = afa.getAlignFile (); +} catch (ex) { +if (Clazz.exceptionOf (ex, java.io.IOException)) { +ex.printStackTrace (); +} else { +throw ex; +} +} +if (al != null) { +al.setDataset (null); +var allowSplitFrame = this.alignFrame.viewport.applet.getDefaultParameter ("enableSplitFrame", false); +if (allowSplitFrame && this.openSplitFrame (al, format)) { +return; +}if (newWindow) { +var af; +if (Clazz.instanceOf (this.source, jalview.api.ComplexAlignFile)) { +var colSel = (this.source).getColumnSelection (); +var hiddenSeqs = (this.source).getHiddenSequences (); +var showSeqFeatures = (this.source).isShowSeqFeatures (); +var cs = (this.source).getColourScheme (); +af = new jalview.appletgui.AlignFrame (al, hiddenSeqs, colSel, this.alignFrame.viewport.applet, "Cut & Paste input - " + format, false); +af.getAlignViewport ().setShowSequenceFeatures (showSeqFeatures); +af.changeColour (cs); +} else { +af = new jalview.appletgui.AlignFrame (al, this.alignFrame.viewport.applet, "Cut & Paste input - " + format, false); +}af.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_annotation_to_alignment")); +} else { +this.alignFrame.addSequences (al.getSequencesArray ()); +this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_alignment_file")); +}}}, "~S,~B,jalview.appletgui.AlignViewport"); +Clazz.defineMethod (c$, "openSplitFrame", +function (al, format) { +var thisAlignment = this.alignFrame.getAlignViewport ().getAlignment (); +if (thisAlignment.isNucleotide () == al.isNucleotide ()) { +return false; +}var protein = thisAlignment.isNucleotide () ? al : thisAlignment; +var dna = thisAlignment.isNucleotide () ? thisAlignment : al; +var mapped = jalview.analysis.AlignmentUtils.mapProteinToCdna (protein, dna); +if (!mapped) { +return false; +}var title = jalview.util.MessageManager.getString ("label.open_split_window"); +var dialog = new jalview.appletgui.JVDialog (this.getParent (), title, true, 100, 400); +dialog.ok.setLabel (jalview.util.MessageManager.getString ("action.yes")); +dialog.cancel.setLabel (jalview.util.MessageManager.getString ("action.no")); +var question = new awt2swing.Panel ( new java.awt.BorderLayout ()); +var text = jalview.util.MessageManager.getString ("label.open_split_window?"); +question.add ( new awt2swing.Label (text, 0), "Center"); +dialog.setMainPanel (question); +dialog.setVisible (true); +dialog.toFront (); +if (!dialog.accept) { +return false; +}var applet = this.alignFrame.viewport.applet; +var copyFrame = new jalview.appletgui.AlignFrame (this.alignFrame.viewport.getAlignment (), applet, this.alignFrame.getTitle (), false, false); +var newFrame = new jalview.appletgui.AlignFrame (al, this.alignFrame.viewport.applet, "Cut & Paste input - " + format, false, false); +var dnaFrame = al.isNucleotide () ? newFrame : copyFrame; +var proteinFrame = al.isNucleotide () ? copyFrame : newFrame; +var sf = new jalview.appletgui.SplitFrame (dnaFrame, proteinFrame); +sf.addToDisplay (false, applet); +return true; +}, "jalview.datamodel.AlignmentI,~S"); +Clazz.defineMethod (c$, "loadAnnotations", +function () { +var tcf = null; +try { +tcf = jalview.jsdev.GenericFileAdapter.getFile ("TCoffeeScoreFile", [this.textarea.getText (), jalview.io.AppletFormatAdapter.PASTE]); +if (tcf.isValid ()) { +if (tcf.annotateAlignment (this.alignFrame.viewport.getAlignment (), true)) { +this.alignFrame.tcoffeeColour.setEnabled (true); +this.alignFrame.alignPanel.fontChanged (); +this.alignFrame.changeColour ( new jalview.schemes.TCoffeeColourScheme (this.alignFrame.viewport.getAlignment ())); +this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_tcoffee_scores_to_alignment")); +} else { +this.alignFrame.setStatus (jalview.util.MessageManager.formatMessage ("label.failed_add_tcoffee_scores", Clazz.newArray (-1, [(tcf.getWarningMessage () != null ? tcf.getWarningMessage () : "")]))); +}} else { +tcf = null; +}} catch (x) { +if (Clazz.exceptionOf (x, Exception)) { +tcf = null; +} else { +throw x; +} +} +if (tcf == null) { +if ( new jalview.io.AnnotationFile ().annotateAlignmentView (this.alignFrame.viewport, this.textarea.getText (), jalview.io.AppletFormatAdapter.PASTE)) { +this.alignFrame.alignPanel.fontChanged (); +this.alignFrame.alignPanel.setScrollValues (0, 0); +this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_annotation_to_alignment")); +} else { +if (!this.alignFrame.parseFeaturesFile (this.textarea.getText (), jalview.io.AppletFormatAdapter.PASTE)) { +this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.couldnt_parse_pasted_text_as_valid_annotation_feature_GFF_tcoffee_file")); +}}}}); +Clazz.defineMethod (c$, "openPdbViewer", +function (text) { +var pdb = new jalview.datamodel.PDBEntry (); +pdb.setFile (text); + new jalview.appletgui.AppletJmol (pdb, Clazz.newArray (-1, [this.seq]), null, this.alignFrame.alignPanel, jalview.io.AppletFormatAdapter.PASTE); +}, "~S"); +Clazz.defineMethod (c$, "cancel", +function () { +this.textarea.setText (""); +if (Clazz.instanceOf (this.getParent (), awt2swing.Frame)) { +(this.getParent ()).setVisible (false); +} else { +(this.getParent ()).setVisible (false); +}}); +Clazz.defineMethod (c$, "jbInit", +($fz = function () { +this.textarea.setFont ( new java.awt.Font ("Monospaced", 0, 10)); +this.textarea.setText (jalview.util.MessageManager.getString ("label.paste_your_alignment_file")); +this.textarea.addMouseListener (this); +this.setLayout (this.borderLayout1); +this.accept.addActionListener (this); +this.addSequences.addActionListener (this); +this.$cancel.addActionListener (this); +this.add (this.buttonPanel, "South"); +this.buttonPanel.add (this.accept, null); +this.buttonPanel.add (this.addSequences); +this.buttonPanel.add (this.$cancel, null); +this.add (this.textarea, "Center"); +}, $fz.isPrivate = true, $fz)); +Clazz.overrideMethod (c$, "mousePressed", +function (evt) { +if (this.textarea.getText ().startsWith (jalview.util.MessageManager.getString ("label.paste_your"))) { +this.textarea.setText (""); +}}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseReleased", +function (evt) { +}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseClicked", +function (evt) { +}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseEntered", +function (evt) { +}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseExited", +function (evt) { +}, "java.awt.event.MouseEvent"); +});