Class GenericApplet
java.lang.Object
org.jmol.util.GenericApplet
- All Implemented Interfaces:
JSInterface, JmolAppletInterface, JmolCallbackListener, JmolStatusListener, JmolSyncInterface
- Direct Known Subclasses:
Jmol
public abstract class GenericApplet
extends Object
implements JSInterface, JmolAppletInterface, JmolStatusListener
A collection of all methods necessary for initialization of and communication with the applet.
JavaScript and Java applet (which is still part of Jmol-SwingJS).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Objectprotected Stringprotected Stringprotected booleanprotected Stringprotected Objectprotected booleanprotected booleanprotected Stringprotected static booleanprotected booleanprotected booleanprotected Stringprotected booleanprotected Stringprotected Stringprotected Stringprotected Viewer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcacheFileByName(String fileName, boolean isAdd) voidcreateImage(String fileName, String type, Object text_or_bytes, int quality) Starting with Jmol 11.8.RC5, for a context where the Jmol application is embedded in another application simply to send the returned message to the application.voiddestroy()protected Stringreturn RAW JAVASCRIPT OBJECT, NOT A STRINGprotected StringdoSendCallback(CBK type, Object callback, Object[] data, String strInfo) protected voiddoShowDocument(URL url) protected voiddoShowStatus(String message) float[][]functionXY(String functionName, int nX, int nY) for isosurface FUNCTIONXYfloat[][][]functionXYZ(String functionName, int nX, int nY, int nZ) for isosurface FUNCTIONXYZprotected booleangetBooleanValue(String propertyName, boolean defaultValue) This method is only called by JmolGLmol applet._refresh();protected StringgetJmolParameter(String paramName) JSpecView shares the JmolSyncInterface; used to get JSpecViewintgetProperty(String infoType) getProperty(String infoType, String paramInfo) @XXXj2sOverridegetPropertyAsJSON(String infoType) getPropertyAsJSON(String infoType, String paramInfo) @XXXj2sOverridegetPropertyAsString(String infoType) getPropertyAsString(String infoType, String paramInfo) @XXXj2sOverrideprotected StringbooleanhandleEvent(Event e) /////////// JmolAppletInterface //////////////protected voidprotected voidloadDOMNode(Object DOMNode) loadInline(String strModel) Deprecated.loadInline(String[] strModels) Deprecated.loadInline(String[] strModels, String script) Deprecated.loadInline(String strModel, String script) Deprecated.loadInlineArray(String[] strModels, String script, boolean isAppend) loadInlineString(String strModel, String script, boolean isAppend) voidnotifyAudioEnded(Object htParams) voidnotifyCallback(CBK type, Object[] data) booleannotifyEnabled(CBK type) ////////// JmolStatusListener ///////////possibly called from JSmolApplet.js upon start upvoidopenFileAsyncSpecial(String fileName, int flags) voidopenFileAsyncSpecialType(String fileName, int flags, String type) voidcalled by mystatuslistenersvoidprocessKeyEvent(Object event) booleanprocessMouseEvent(int id, int x, int y, int modifiers, long time) voidprocessTwoPointGesture(float[][][] touches) voidregister(String id, JmolSyncInterface jsi) ////// JmolSyncInterface //////////int[]resizeInnerPanel(String data) voidscriptCheck(String script) scriptNoWait(String script) scriptWait(String script) scriptWait(String script, String statusParams) scriptWaitOutput(String script) voidsetCallback(String name, Object callbackObject) set a callback either as a function or a function name from JavaScriptvoidsetCallbackFunction(String callbackName, String callbackObject) From StatusManagervoidsetDisplay(Object canvas) protected voidsetJSOptions(Map<String, Object> vwrOptions) voidsetScreenDimension(int width, int height) booleansetStatusDragDropped(int mode, int x, int y, String fileName, String[] retType) setStereoGraphics(boolean isStereo) voidvoidstartHoverWatcher(boolean enable) voidsyncScript(String script) voidupdate()
-
Field Details
-
htRegistry
-
isJS
protected static boolean isJS -
codeBase
-
documentBase
-
isSigned
protected boolean isSigned -
language
-
doTranslate
protected boolean doTranslate -
haveDocumentAccess
protected boolean haveDocumentAccess -
isStereoSlave
protected boolean isStereoSlave -
mayScript
protected boolean mayScript -
htmlName
-
fullName
-
statusForm
-
statusText
-
statusTextarea
-
gRight
-
viewer
-
callbacks
-
vwrOptions
-
haveNotifiedError
protected boolean haveNotifiedError -
appletObject
-
htParams
-
-
Constructor Details
-
GenericApplet
public GenericApplet()
-
-
Method Details
-
setStereoGraphics
- Specified by:
setStereoGraphicsin interfaceJmolAppletInterface
-
processMouseEvent
public boolean processMouseEvent(int id, int x, int y, int modifiers, long time) - Specified by:
processMouseEventin interfaceJSInterface
-
processKeyEvent
- Specified by:
processKeyEventin interfaceJSInterface
-
setDisplay
- Specified by:
setDisplayin interfaceJSInterface
-
setStatusDragDropped
- Specified by:
setStatusDragDroppedin interfaceJSInterface
-
startHoverWatcher
public void startHoverWatcher(boolean enable) - Specified by:
startHoverWatcherin interfaceJSInterface
-
update
public void update()- Specified by:
updatein interfaceJSInterface
-
openFileAsyncSpecial
- Specified by:
openFileAsyncSpecialin interfaceJSInterface
-
openFileAsyncSpecialType
- Specified by:
openFileAsyncSpecialTypein interfaceJSInterface
-
processTwoPointGesture
public void processTwoPointGesture(float[][][] touches) - Specified by:
processTwoPointGesturein interfaceJSInterface
-
setScreenDimension
public void setScreenDimension(int width, int height) - Specified by:
setScreenDimensionin interfaceJSInterface
-
init
-
destroy
public void destroy()- Specified by:
destroyin interfaceJmolAppletInterface- Specified by:
destroyin interfaceJSInterface
-
getBooleanValue
-
getValue
-
register
////// JmolSyncInterface //////////- Specified by:
registerin interfaceJmolSyncInterface
-
getJSpecViewProperty
JSpecView shares the JmolSyncInterface; used to get JSpecView- Specified by:
getJSpecViewPropertyin interfaceJmolStatusListener- Specified by:
getJSpecViewPropertyin interfaceJmolSyncInterface
-
syncScript
- Specified by:
syncScriptin interfaceJmolSyncInterface
-
handleEvent
/////////// JmolAppletInterface //////////////- Specified by:
handleEventin interfaceJmolAppletInterface
-
getAppletInfo
- Specified by:
getAppletInfoin interfaceJmolAppletInterface
-
script
- Specified by:
scriptin interfaceJmolAppletInterface
-
scriptCheck
- Specified by:
scriptCheckin interfaceJmolAppletInterface
-
scriptNoWait
- Specified by:
scriptNoWaitin interfaceJmolAppletInterface
-
scriptWait
- Specified by:
scriptWaitin interfaceJmolAppletInterface
-
scriptWait
- Specified by:
scriptWaitin interfaceJmolAppletInterface
-
scriptWaitOutput
- Specified by:
scriptWaitOutputin interfaceJmolAppletInterface
-
getModelIndexFromId
- Specified by:
getModelIndexFromIdin interfaceJmolAppletInterface- Parameters:
id- some_id, filename#id, or ~fileNo.modelNo added ".basemodel" indicates to get the first model in a series from a JDX-MOL file.- Returns:
- model index if found; -2 if file found but model not found -2 if no file indicated and no model found -1 if no such file
-
getProperty
- Specified by:
getPropertyin interfaceJmolAppletInterface- Parameters:
infoType-- Returns:
- value
-
getProperty
@XXXj2sOverride- Specified by:
getPropertyin interfaceJmolAppletInterface- Parameters:
infoType-paramInfo-- Returns:
- value
-
getPropertyAsString
- Specified by:
getPropertyAsStringin interfaceJmolAppletInterface- Parameters:
infoType-- Returns:
- value
-
getPropertyAsString
@XXXj2sOverride- Specified by:
getPropertyAsStringin interfaceJmolAppletInterface- Parameters:
infoType-paramInfo-- Returns:
- value
-
getPropertyAsJSON
- Specified by:
getPropertyAsJSONin interfaceJmolAppletInterface- Parameters:
infoType-- Returns:
- value
-
getPropertyAsJSON
@XXXj2sOverride- Specified by:
getPropertyAsJSONin interfaceJmolAppletInterface- Parameters:
infoType-paramInfo-- Returns:
- value
-
loadInlineString
- Specified by:
loadInlineStringin interfaceJmolAppletInterface
-
loadInlineArray
- Specified by:
loadInlineArrayin interfaceJmolAppletInterface
-
loadDOMNode
- Specified by:
loadDOMNodein interfaceJmolAppletInterface
-
loadInline
Deprecated.- Specified by:
loadInlinein interfaceJmolAppletInterface- Parameters:
strModel-- Returns:
- error or null
-
loadInline
Deprecated.- Specified by:
loadInlinein interfaceJmolAppletInterface- Parameters:
strModel-script-- Returns:
- error or null
-
loadInline
Deprecated.- Specified by:
loadInlinein interfaceJmolAppletInterface- Parameters:
strModels-- Returns:
- error or null
-
loadInline
Deprecated.- Specified by:
loadInlinein interfaceJmolAppletInterface- Parameters:
strModels-script-- Returns:
- error or null
-
output
called by mystatuslisteners -
setCallback
set a callback either as a function or a function name from JavaScript- Specified by:
setCallbackin interfaceJmolAppletInterface
-
setCallbackFunction
From StatusManager- Specified by:
setCallbackFunctionin interfaceJmolCallbackListener
-
notifyEnabled
////////// JmolStatusListener ///////////- Specified by:
notifyEnabledin interfaceJmolCallbackListener
-
notifyCallback
- Specified by:
notifyCallbackin interfaceJmolCallbackListener- Parameters:
type- the callback type or null for getJsObjectInfo() -- Java applet onlydata- type-dependent
-
eval
- Specified by:
evalin interfaceJmolStatusListener
-
createImage
Description copied from interface:JmolStatusListenerStarting with Jmol 11.8.RC5, for a context where the Jmol application is embedded in another application simply to send the returned message to the application. In this way any application can have access to the WRITE command.- Specified by:
createImagein interfaceJmolStatusListener- Parameters:
fileName-type-text_or_bytes- information or null indicates message AFTER Jmol creates the imagequality-- Returns:
- null (canceled) or a message starting with OK or an error message
-
getRegistryInfo
- Specified by:
getRegistryInfoin interfaceJmolStatusListener
-
showUrl
- Specified by:
showUrlin interfaceJmolStatusListener
-
resizeInnerPanel
- Specified by:
resizeInnerPanelin interfaceJmolStatusListener
-
notifyAudioEnded
- Specified by:
notifyAudioEndedin interfaceJmolAppletInterface
-
setJSOptions
-
initOptions
protected void initOptions() -
getJmolParameter
-
functionXY
Description copied from interface:JmolStatusListenerfor isosurface FUNCTIONXY- Specified by:
functionXYin interfaceJmolStatusListener- Parameters:
functionName-nX-nY-- Returns:
- 2D array or null
-
functionXYZ
Description copied from interface:JmolStatusListenerfor isosurface FUNCTIONXYZ- Specified by:
functionXYZin interfaceJmolStatusListener- Parameters:
functionName-nX-nY-nZ-- Returns:
- 3D array or null
-
doShowDocument
-
doSendCallback
-
doEval
-
doShowStatus
-
getGLmolView
This method is only called by JmolGLmol applet._refresh();- Returns:
- enough data to update a WebGL view
-
openFile
-
cacheFileByName
- Specified by:
cacheFileByNamein interfaceJSInterface
-
cachePut
- Specified by:
cachePutin interfaceJSInterface
-
getFullName
- Specified by:
getFullNamein interfaceJSInterface
-