Package org.jmol.appletjs
Class Jmol
- java.lang.Object
-
- org.jmol.util.GenericApplet
-
- org.jmol.appletjs.Jmol
-
- All Implemented Interfaces:
javajs.api.JSInterface
,JmolAppletInterface
,JmolCallbackListener
,JmolStatusListener
,JmolSyncInterface
public class Jmol extends GenericApplet implements javajs.api.JSInterface
Java2Script rendition of Jmol using HTML5-only or WebGL-based graphics- Author:
- Bob Hanson hansonr@stolaf.edu, Takanori Nakane, with the assistance of Jhou Renjian
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.Object>
htParams
-
Fields inherited from class org.jmol.util.GenericApplet
appletObject, callbacks, codeBase, documentBase, doTranslate, fullName, gRight, haveDocumentAccess, haveNotifiedError, htmlName, htRegistry, isJNLP, isJS, isSigned, isStereoSlave, language, mayScript, statusForm, statusText, statusTextarea, viewer, vwrOptions
-
-
Constructor Summary
Constructors Constructor Description Jmol(java.util.Map<java.lang.String,java.lang.Object> vwrOptions)
cannot ignore super because it involves preparing fields
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
cacheFileByName(java.lang.String fileName, boolean isAdd)
void
cachePut(java.lang.String key, java.lang.Object data)
protected java.lang.String
doEval(java.lang.String strEval)
return RAW JAVASCRIPT OBJECT, NOT A STRINGprotected float[][]
doFunctionXY(java.lang.String functionName, int nX, int nY)
protected float[][][]
doFunctionXYZ(java.lang.String functionName, int nX, int nY, int nZ)
protected java.lang.String
doSendCallback(java.lang.String callback, java.lang.Object[] data, java.lang.String strInfo)
protected void
doSendJsTextareaStatus(java.lang.String message)
protected void
doSendJsTextStatus(java.lang.String message)
protected void
doShowDocument(java.net.URL url)
protected void
doShowStatus(java.lang.String message)
java.lang.String
getFullName()
java.lang.Object
getGLmolView()
This method is only called by JmolGLmol applet._refresh();protected java.lang.String
getJmolParameter(java.lang.String paramName)
protected void
initOptions()
java.lang.String
openFile(java.lang.String fileName)
possibly called from JSmolApplet.js upon start upvoid
openFileAsyncSpecial(java.lang.String fileName, int flags)
boolean
processMouseEvent(int id, int x, int y, int modifiers, long time)
void
processTwoPointGesture(float[][][] touches)
(package private) void
resizeDisplay(int width, int height)
int[]
resizeInnerPanel(java.lang.String data)
void
setDisplay(java.lang.Object canvas)
void
setScreenDimension(int width, int height)
boolean
setStatusDragDropped(int mode, int x, int y, java.lang.String fileName)
java.lang.Object
setStereoGraphics(boolean isStereo)
void
startHoverWatcher(boolean enable)
void
update()
-
Methods inherited from class org.jmol.util.GenericApplet
createImage, destroy, eval, functionXY, functionXYZ, getAppletInfo, getBooleanValue, getJSpecViewProperty, getModelIndexFromId, getProperty, getProperty, getPropertyAsJSON, getPropertyAsJSON, getPropertyAsString, getPropertyAsString, getRegistryInfo, getValue, handleEvent, init, loadDOMNode, loadInline, loadInline, loadInline, loadInline, loadInlineArray, loadInlineString, notifyAudioEnded, notifyCallback, notifyEnabled, output, register, script, scriptCheck, scriptNoWait, scriptWait, scriptWait, scriptWaitOutput, setCallbackFunction, showUrl, syncScript
-
-
-
-
Method Detail
-
setStereoGraphics
public java.lang.Object setStereoGraphics(boolean isStereo)
- Specified by:
setStereoGraphics
in interfaceJmolAppletInterface
-
initOptions
protected void initOptions()
- Specified by:
initOptions
in classGenericApplet
-
getJmolParameter
protected java.lang.String getJmolParameter(java.lang.String paramName)
- Specified by:
getJmolParameter
in classGenericApplet
-
doSendJsTextStatus
protected void doSendJsTextStatus(java.lang.String message)
- Specified by:
doSendJsTextStatus
in classGenericApplet
-
doSendJsTextareaStatus
protected void doSendJsTextareaStatus(java.lang.String message)
- Specified by:
doSendJsTextareaStatus
in classGenericApplet
-
doFunctionXY
protected float[][] doFunctionXY(java.lang.String functionName, int nX, int nY)
- Specified by:
doFunctionXY
in classGenericApplet
-
doFunctionXYZ
protected float[][][] doFunctionXYZ(java.lang.String functionName, int nX, int nY, int nZ)
- Specified by:
doFunctionXYZ
in classGenericApplet
-
doShowDocument
protected void doShowDocument(java.net.URL url)
- Specified by:
doShowDocument
in classGenericApplet
-
doSendCallback
protected java.lang.String doSendCallback(java.lang.String callback, java.lang.Object[] data, java.lang.String strInfo)
- Specified by:
doSendCallback
in classGenericApplet
-
doEval
protected java.lang.String doEval(java.lang.String strEval)
return RAW JAVASCRIPT OBJECT, NOT A STRING- Specified by:
doEval
in classGenericApplet
-
doShowStatus
protected void doShowStatus(java.lang.String message)
- Specified by:
doShowStatus
in classGenericApplet
-
getGLmolView
public java.lang.Object getGLmolView()
This method is only called by JmolGLmol applet._refresh();- Returns:
- enough data to update a WebGL view
-
openFile
public java.lang.String openFile(java.lang.String fileName)
possibly called from JSmolApplet.js upon start up- Parameters:
fileName
-- Returns:
- error or null
-
cacheFileByName
public int cacheFileByName(java.lang.String fileName, boolean isAdd)
- Specified by:
cacheFileByName
in interfacejavajs.api.JSInterface
-
cachePut
public void cachePut(java.lang.String key, java.lang.Object data)
- Specified by:
cachePut
in interfacejavajs.api.JSInterface
-
getFullName
public java.lang.String getFullName()
- Specified by:
getFullName
in interfacejavajs.api.JSInterface
-
processMouseEvent
public boolean processMouseEvent(int id, int x, int y, int modifiers, long time)
- Specified by:
processMouseEvent
in interfacejavajs.api.JSInterface
-
setDisplay
public void setDisplay(java.lang.Object canvas)
- Specified by:
setDisplay
in interfacejavajs.api.JSInterface
-
setStatusDragDropped
public boolean setStatusDragDropped(int mode, int x, int y, java.lang.String fileName)
- Specified by:
setStatusDragDropped
in interfacejavajs.api.JSInterface
-
startHoverWatcher
public void startHoverWatcher(boolean enable)
- Specified by:
startHoverWatcher
in interfacejavajs.api.JSInterface
-
update
public void update()
- Specified by:
update
in interfacejavajs.api.JSInterface
-
openFileAsyncSpecial
public void openFileAsyncSpecial(java.lang.String fileName, int flags)
- Specified by:
openFileAsyncSpecial
in interfacejavajs.api.JSInterface
-
processTwoPointGesture
public void processTwoPointGesture(float[][][] touches)
- Specified by:
processTwoPointGesture
in interfacejavajs.api.JSInterface
-
setScreenDimension
public void setScreenDimension(int width, int height)
- Specified by:
setScreenDimension
in interfacejavajs.api.JSInterface
-
resizeInnerPanel
public int[] resizeInnerPanel(java.lang.String data)
- Specified by:
resizeInnerPanel
in interfaceJmolStatusListener
- Overrides:
resizeInnerPanel
in classGenericApplet
-
resizeDisplay
void resizeDisplay(int width, int height)
-
-