X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FScriptWindow.java;h=972e5ef27a7df1b14da29fc3df0b993ca01aecd0;hb=cb7bef47fe49963716fc33285fd4fb733ac95933;hp=00b724e3bd7419b1f63cfce5b4354df8d018946c;hpb=2de8acfae59aced665e4c37ad0f7dcc2ed68818e;p=jalview.git diff --git a/src/jalview/gui/ScriptWindow.java b/src/jalview/gui/ScriptWindow.java index 00b724e..972e5ef 100644 --- a/src/jalview/gui/ScriptWindow.java +++ b/src/jalview/gui/ScriptWindow.java @@ -1,35 +1,42 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1) - * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * - * 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 file is part of Jalview. * - * 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. + * Jalview 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 3 + * of the License, or (at your option) any later version. + * + * Jalview 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 + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.gui; import org.jmol.api.*; +import jalview.jbgui.GStructureViewer; + import java.awt.*; import java.awt.event.*; + import javax.swing.*; import javax.swing.text.*; + import java.util.Vector; import org.jmol.i18n.GT; import org.jmol.util.Logger; import org.jmol.util.CommandHistory; +// TODO: this class is copied in from jmol 11.0.2 - upgrade to 12.0.2 ? public final class ScriptWindow extends JPanel implements ActionListener, EnterListener { @@ -50,11 +57,11 @@ public final class ScriptWindow extends JPanel implements ActionListener, JmolViewer viewer; - AppJmol appJmol; + GStructureViewer appJmol; public ScriptWindow(AppJmol appJmol) { - this.viewer = appJmol.viewer; + this.viewer = appJmol.jmb.viewer; this.appJmol = appJmol; setLayout(new BorderLayout()); @@ -231,7 +238,7 @@ public final class ScriptWindow extends JPanel implements ActionListener, else { boolean isScriptExecuting = viewer.isScriptExecuting(); - if (viewer.checkHalt(strCommand)) + if (viewer.checkHalt(strCommand, true)) strErrorMessage = (isScriptExecuting ? "string execution halted with " + strCommand : "no script was executing"); @@ -259,7 +266,7 @@ public final class ScriptWindow extends JPanel implements ActionListener, Object source = e.getSource(); if (source == closeButton) { - appJmol.showConsole(false); + // appJmol.showConsole(false); } else if (source == runButton) { @@ -417,8 +424,8 @@ class ConsoleTextPane extends JTextPane /** * Recall command history. * - * @param up - - * history up or down + * @param up + * - history up or down */ void recallCommand(boolean up) { @@ -499,12 +506,14 @@ class ConsoleDocument extends DefaultStyledDocument } Position positionBeforePrompt; // starts at 0, so first time isn't tracked - // (at least on Mac OS X) + + // (at least on Mac OS X) Position positionAfterPrompt; // immediately after $, so this will track int offsetAfterPrompt; // only still needed for the insertString override and - // replaceCommand + + // replaceCommand /** * Removes all content of the script window, and add a new prompt. @@ -700,9 +709,9 @@ class ConsoleDocument extends DefaultStyledDocument * Replaces current command on script. * * @param newCommand - * new command value + * new command value * @param isError - * true to set error color ends with #?? + * true to set error color ends with #?? * * @throws BadLocationException */