+ public abstract void refreshGUI();
+
+ /**
+ * called to show or hide the associated console window container.
+ *
+ * @param show
+ */
+ public abstract void showConsole(boolean show);
+
+ /**
+ * @param renderPanel
+ * @param jmolfileio
+ * - when true will initialise jmol's file IO system (should be false
+ * in applet context)
+ * @param htmlName
+ * @param documentBase
+ * @param codeBase
+ * @param commandOptions
+ */
+ public void allocateViewer(Container renderPanel, boolean jmolfileio,
+ String htmlName, URL documentBase, URL codeBase,
+ String commandOptions)
+ {
+ allocateViewer(renderPanel, jmolfileio, htmlName, documentBase,
+ codeBase, commandOptions, null, null);
+ }
+
+ /**
+ *
+ * @param renderPanel
+ * @param jmolfileio
+ * - when true will initialise jmol's file IO system (should be false
+ * in applet context)
+ * @param htmlName
+ * @param documentBase
+ * @param codeBase
+ * @param commandOptions
+ * @param consolePanel
+ * - panel to contain Jmol console
+ * @param buttonsToShow
+ * - buttons to show on the console, in ordr
+ */
+ public void allocateViewer(Container renderPanel, boolean jmolfileio,
+ String htmlName, URL documentBase, URL codeBase,
+ String commandOptions, final Container consolePanel,
+ String buttonsToShow)
+ {
+ if (commandOptions == null)
+ {
+ commandOptions = "";
+ }
+ viewer = (Viewer) JmolViewer.allocateViewer(renderPanel,
+ (jmolfileio ? new SmarterJmolAdapter() : null), htmlName
+ + ((Object) this).toString(), documentBase, codeBase,
+ commandOptions, this);
+
+ viewer.setJmolStatusListener(this); // extends JmolCallbackListener
+
+ console = createJmolConsole(consolePanel, buttonsToShow);
+ if (consolePanel != null)
+ {
+ consolePanel.addComponentListener(this);
+
+ }
+
+ }
+
+ protected abstract JmolAppConsoleInterface createJmolConsole(
+ Container consolePanel, String buttonsToShow);
+
+ protected org.jmol.api.JmolAppConsoleInterface console = null;
+
+ public void setBackgroundColour(java.awt.Color col)
+ {
+ jmolHistory(false);
+ viewer.evalStringQuiet("background [" + col.getRed() + ","
+ + col.getGreen() + "," + col.getBlue() + "];");
+ jmolHistory(true);
+ }
+
+ @Override
+ public int[] resizeInnerPanel(String data)
+ {
+ // Jalview doesn't honour resize panel requests
+ return null;
+ }
+
+ /**
+ *
+ */
+ protected void closeConsole()
+ {
+ if (console != null)
+ {
+ try
+ {
+ console.setVisible(false);
+ } catch (Error e)
+ {
+ } catch (Exception x)
+ {
+ }
+ ;
+ console = null;
+ }
+ }