From: hansonr Date: Mon, 27 Aug 2018 08:36:29 +0000 (-0500) Subject: JAL-3026 Jmol functioning; some issues X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~68^2~460 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=76584a3ac3f6db6af4c3ace0d765827f83a3eb5b;hp=8de672a19aa66c59e84511da1961dd35397c02cb;p=jalview.git JAL-3026 Jmol functioning; some issues Reworked mouse event handling. Temporarily lost out-of-frame business. Or, more specifically, hovering over the scroll bar to auto-scroll. --- diff --git a/libjs/jmol-app.zip b/libjs/jmol-app.zip index dd6b193..02efd09 100644 Binary files a/libjs/jmol-app.zip and b/libjs/jmol-app.zip differ diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index ca82744..babebc5 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -1351,7 +1351,17 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel */ public abstract void showConsole(boolean show); + + public static Viewer getJmolData(JmolParser jmolParser) + { + return (Viewer) JmolViewer.allocateViewer(null, null, null, null, null, + "-x -o -n", jmolParser); + } + /** + * + * + * * @param renderPanel * @param jmolfileio * - when true will initialise jmol's file IO system (should be false @@ -1382,13 +1392,16 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel * @param consolePanel * - panel to contain Jmol console * @param buttonsToShow - * - buttons to show on the console, in ordr + * - buttons to show on the console, in order */ public void allocateViewer(Container renderPanel, boolean jmolfileio, String htmlName, URL documentBase, URL codeBase, String commandOptions, final Container consolePanel, String buttonsToShow) { + + System.err.println("Allocating Jmol Viewer: " + commandOptions); + if (commandOptions == null) { commandOptions = ""; @@ -1400,7 +1413,12 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel viewer.setJmolStatusListener(this); // extends JmolCallbackListener - console = null;//createJmolConsole(consolePanel, buttonsToShow); + try { + console = createJmolConsole(consolePanel, buttonsToShow); + } catch (Throwable e) { + System.err.println("Could not create Jmol application console. " + e.getMessage()); + e.printStackTrace(); + } if (consolePanel != null) { consolePanel.addComponentListener(this); @@ -1412,6 +1430,9 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel protected abstract JmolAppConsoleInterface createJmolConsole( Container consolePanel, String buttonsToShow); + // BH 2018 -- Jmol console is not working due to problems with styled documents. + + protected org.jmol.api.JmolAppConsoleInterface console = null; @Override @@ -1425,7 +1446,14 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel private String jmolScript(String script) { - return viewer.scriptWait(script); + + System.err.println(">>Jmol>> " + script); + + String s = viewer.scriptWait(script); + + System.err.println("<