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 intcacheFileByName(java.lang.String fileName, boolean isAdd)voidcachePut(java.lang.String key, java.lang.Object data)protected java.lang.StringdoEval(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.StringdoSendCallback(java.lang.String callback, java.lang.Object[] data, java.lang.String strInfo)protected voiddoSendJsTextareaStatus(java.lang.String message)protected voiddoSendJsTextStatus(java.lang.String message)protected voiddoShowDocument(java.net.URL url)protected voiddoShowStatus(java.lang.String message)java.lang.StringgetFullName()java.lang.ObjectgetGLmolView()This method is only called by JmolGLmol applet._refresh();protected java.lang.StringgetJmolParameter(java.lang.String paramName)protected voidinitOptions()java.lang.StringopenFile(java.lang.String fileName)possibly called from JSmolApplet.js upon start upvoidopenFileAsyncSpecial(java.lang.String fileName, int flags)voidplayAudio(java.lang.String fileOrDataURI)booleanprocessMouseEvent(int id, int x, int y, int modifiers, long time)voidprocessTwoPointGesture(float[][][] touches)(package private) voidresizeDisplay(int width, int height)int[]resizeInnerPanel(java.lang.String data)voidsetDisplay(java.lang.Object canvas)voidsetScreenDimension(int width, int height)booleansetStatusDragDropped(int mode, int x, int y, java.lang.String fileName)java.lang.ObjectsetStereoGraphics(boolean isStereo)voidstartHoverWatcher(boolean enable)voidupdate()-
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, 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:
setStereoGraphicsin interfaceJmolAppletInterface
-
initOptions
protected void initOptions()
- Specified by:
initOptionsin classGenericApplet
-
getJmolParameter
protected java.lang.String getJmolParameter(java.lang.String paramName)
- Specified by:
getJmolParameterin classGenericApplet
-
doSendJsTextStatus
protected void doSendJsTextStatus(java.lang.String message)
- Specified by:
doSendJsTextStatusin classGenericApplet
-
doSendJsTextareaStatus
protected void doSendJsTextareaStatus(java.lang.String message)
- Specified by:
doSendJsTextareaStatusin classGenericApplet
-
doFunctionXY
protected float[][] doFunctionXY(java.lang.String functionName, int nX, int nY)- Specified by:
doFunctionXYin classGenericApplet
-
doFunctionXYZ
protected float[][][] doFunctionXYZ(java.lang.String functionName, int nX, int nY, int nZ)- Specified by:
doFunctionXYZin classGenericApplet
-
doShowDocument
protected void doShowDocument(java.net.URL url)
- Specified by:
doShowDocumentin classGenericApplet
-
doSendCallback
protected java.lang.String doSendCallback(java.lang.String callback, java.lang.Object[] data, java.lang.String strInfo)- Specified by:
doSendCallbackin classGenericApplet
-
doEval
protected java.lang.String doEval(java.lang.String strEval)
return RAW JAVASCRIPT OBJECT, NOT A STRING- Specified by:
doEvalin classGenericApplet
-
doShowStatus
protected void doShowStatus(java.lang.String message)
- Specified by:
doShowStatusin 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:
cacheFileByNamein interfacejavajs.api.JSInterface
-
cachePut
public void cachePut(java.lang.String key, java.lang.Object data)- Specified by:
cachePutin interfacejavajs.api.JSInterface
-
getFullName
public java.lang.String getFullName()
- Specified by:
getFullNamein interfacejavajs.api.JSInterface
-
processMouseEvent
public boolean processMouseEvent(int id, int x, int y, int modifiers, long time)- Specified by:
processMouseEventin interfacejavajs.api.JSInterface
-
setDisplay
public void setDisplay(java.lang.Object canvas)
- Specified by:
setDisplayin interfacejavajs.api.JSInterface
-
setStatusDragDropped
public boolean setStatusDragDropped(int mode, int x, int y, java.lang.String fileName)- Specified by:
setStatusDragDroppedin interfacejavajs.api.JSInterface
-
startHoverWatcher
public void startHoverWatcher(boolean enable)
- Specified by:
startHoverWatcherin interfacejavajs.api.JSInterface
-
update
public void update()
- Specified by:
updatein interfacejavajs.api.JSInterface
-
openFileAsyncSpecial
public void openFileAsyncSpecial(java.lang.String fileName, int flags)- Specified by:
openFileAsyncSpecialin interfacejavajs.api.JSInterface
-
processTwoPointGesture
public void processTwoPointGesture(float[][][] touches)
- Specified by:
processTwoPointGesturein interfacejavajs.api.JSInterface
-
setScreenDimension
public void setScreenDimension(int width, int height)- Specified by:
setScreenDimensionin interfacejavajs.api.JSInterface
-
resizeInnerPanel
public int[] resizeInnerPanel(java.lang.String data)
- Specified by:
resizeInnerPanelin interfaceJmolStatusListener- Overrides:
resizeInnerPanelin classGenericApplet
-
resizeDisplay
void resizeDisplay(int width, int height)
-
playAudio
public void playAudio(java.lang.String fileOrDataURI)
- Overrides:
playAudioin classGenericApplet
-
-