X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FAppJmol.java;h=0cc04f7dd029d31d668468c5bf648208b35e1975;hb=6486a5333807ca300db4a28a6bf9899f5dddf5a6;hp=74a9c221ee3787ea37eabf067cfea2a878cb4f15;hpb=1d534b200f4a912f02f869c9d860f462511ea46f;p=jalview.git diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index 74a9c22..0cc04f7 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -40,6 +40,7 @@ import org.jmol.api.*; import org.jmol.adapter.smarter.SmarterJmolAdapter; import org.jmol.popup.*; import org.jmol.viewer.JmolConstants; +import org.openscience.jmol.app.jmolpanel.AppConsole; public class AppJmol extends GStructureViewer implements Runnable, SequenceStructureBinding @@ -47,8 +48,8 @@ public class AppJmol extends GStructureViewer implements Runnable, { AppJmolBinding jmb; - ScriptWindow scriptWindow; - + JPanel scriptWindow; + JSplitPane splitPane; RenderPanel renderPanel; @@ -332,7 +333,15 @@ public class AppJmol extends GStructureViewer implements Runnable, this.getContentPane().add(renderPanel, java.awt.BorderLayout.CENTER); jalview.gui.Desktop.addInternalFrame(this, jmb.getViewerTitle(), getBounds().width, getBounds().height); - jmb.allocateViewer(renderPanel, true, "", null, null, ""); + if (scriptWindow == null) + { + BorderLayout bl = new BorderLayout(); + bl.setHgap(0); + bl.setVgap(0); + scriptWindow = new JPanel(bl); + }; + + jmb.allocateViewer(renderPanel, true, "", null, null, "", scriptWindow, null); jmb.newJmolPopup(true, "Jmol", true); jmb.evalStateCommand(command); jmb.setFinishedInit(true); @@ -777,11 +786,8 @@ public class AppJmol extends GStructureViewer implements Runnable, { } } - public void showConsole(boolean showConsole) { - if (scriptWindow == null) - scriptWindow = new ScriptWindow(this); if (showConsole) { @@ -791,15 +797,19 @@ public class AppJmol extends GStructureViewer implements Runnable, splitPane.setTopComponent(renderPanel); splitPane.setBottomComponent(scriptWindow); this.getContentPane().add(splitPane, BorderLayout.CENTER); + splitPane.setDividerLocation(getHeight() - 200); + scriptWindow.setVisible(true); + scriptWindow.validate(); + splitPane.validate(); } - splitPane.setDividerLocation(getHeight() - 200); - splitPane.validate(); } else { if (splitPane != null) - splitPane.setVisible(false); + { + splitPane.setVisible(false); + } splitPane = null;