Package org.jmol.util
Class GenericApplet
java.lang.Object
org.jmol.util.GenericApplet
- All Implemented Interfaces:
javajs.api.JSInterface,JmolAppletInterface,JmolCallbackListener,JmolStatusListener,JmolSyncInterface
- Direct Known Subclasses:
Jmol
public abstract class GenericApplet
extends Object
implements javajs.api.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 Stringprivate booleanprotected booleanprivate javajs.util.SBprivate static final intprivate static final intprivate static final intprotected Stringprotected Stringprotected Stringprivate Stringprotected Viewer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcacheFileByName(String fileName, boolean isAdd) void(package private) static void(package private) static voidprivate voidconsoleMessage(String message) createImage(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) (package private) static voidfindApplets(String appletName, String mySyncId, String excludeName, javajs.util.Lst<String> apps) 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) getPropertyAsJSON(String infoType) getPropertyAsJSON(String infoType, String paramInfo) getPropertyAsString(String infoType) getPropertyAsString(String infoType, String paramInfo) protected Stringprivate StringgetValueLowerCase(String paramName, String defaultValue) booleanhandleEvent(Event e) protected voidprivate 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) private StringnotifySync(String info, String appletName) possibly called from JSmolApplet.js upon start upvoidopenFileAsyncSpecial(String fileName, int flags) voidopenFileAsyncSpecialType(String fileName, int flags, String type) voidvoidprocessKeyEvent(Object event) booleanprocessMouseEvent(int id, int x, int y, int modifiers, long time) voidprocessTwoPointGesture(float[][][] touches) voidregister(String id, JmolSyncInterface jsi) (package private) voidresizeDisplay(int width, int height) int[]resizeInnerPanel(String data) voidscriptCheck(String script) scriptNoWait(String script) private StringscriptProcessor(String script, String statusParams, int processType) scriptWait(String script) scriptWait(String script, String statusParams) scriptWaitOutput(String script) private StringsendScript(String script, String appletName, boolean isSync, boolean doCallback) 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) private voidsetStringProperty(String name, String value) voidvoidstartHoverWatcher(boolean enable) voidsyncScript(String script) voidupdate()
-
Field Details
-
htRegistry
-
isJS
protected static boolean isJS -
SCRIPT_CHECK
private static final int SCRIPT_CHECK- See Also:
-
SCRIPT_WAIT
private static final int SCRIPT_WAIT- See Also:
-
SCRIPT_NOWAIT
private static final int SCRIPT_NOWAIT- See Also:
-
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
-
loading
private boolean loading -
syncId
-
outputBuffer
private javajs.util.SB outputBuffer -
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 interfacejavajs.api.JSInterface
-
processKeyEvent
- Specified by:
processKeyEventin interfacejavajs.api.JSInterface
-
setDisplay
- Specified by:
setDisplayin interfacejavajs.api.JSInterface
-
setStatusDragDropped
- 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
- Specified by:
openFileAsyncSpecialin interfacejavajs.api.JSInterface
-
openFileAsyncSpecialType
- Specified by:
openFileAsyncSpecialTypein 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
-
resizeDisplay
void resizeDisplay(int width, int height) -
init
-
initApplication
private void initApplication() -
destroy
public void destroy()- Specified by:
destroyin interfaceJmolAppletInterface- Specified by:
destroyin interfacejavajs.api.JSInterface
-
getBooleanValue
-
getValue
-
getValueLowerCase
-
setStringProperty
-
scriptProcessor
-
register
- 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
- 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
- Specified by:
getPropertyin interfaceJmolAppletInterface- Parameters:
infoType-paramInfo-- Returns:
- value
-
getPropertyAsString
- Specified by:
getPropertyAsStringin interfaceJmolAppletInterface- Parameters:
infoType-- Returns:
- value
-
getPropertyAsString
- Specified by:
getPropertyAsStringin interfaceJmolAppletInterface- Parameters:
infoType-paramInfo-- Returns:
- value
-
getPropertyAsJSON
- Specified by:
getPropertyAsJSONin interfaceJmolAppletInterface- Parameters:
infoType-- Returns:
- value
-
getPropertyAsJSON
- 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
-
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
-
consoleMessage
-
notifyEnabled
- Specified by:
notifyEnabledin interfaceJmolCallbackListener
-
notifyCallback
- Specified by:
notifyCallbackin interfaceJmolCallbackListener- Parameters:
type- the callback type or null for getJsObjectInfo() -- Java applet onlydata- type-dependent
-
sendScript
-
notifySync
-
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 interfaceJmolStatusListenertext_or_bytes- information or null indicates message AFTER Jmol creates the image- 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
-
checkIn
-
checkOut
-
findApplets
-
notifyAudioEnded
- Specified by:
notifyAudioEndedin interfaceJmolAppletInterface
-
setJSOptions
-
initOptions
protected void initOptions() -
getJmolParameter
-
functionXY
Description copied from interface:JmolStatusListenerfor isosurface FUNCTIONXY- Specified by:
functionXYin interfaceJmolStatusListener- Returns:
- 2D array or null
-
functionXYZ
Description copied from interface:JmolStatusListenerfor isosurface FUNCTIONXYZ- Specified by:
functionXYZin interfaceJmolStatusListener- Returns:
- 3D array or null
-
doShowDocument
-
doSendCallback
-
doEval
return RAW JAVASCRIPT OBJECT, NOT A STRING- Parameters:
strEval-- Returns:
- result, not necessarily a String
-
doShowStatus
-
getGLmolView
This method is only called by JmolGLmol applet._refresh();- Returns:
- enough data to update a WebGL view
-
openFile
possibly called from JSmolApplet.js upon start up- Parameters:
fileName-- Returns:
- error or null
-
cacheFileByName
- Specified by:
cacheFileByNamein interfacejavajs.api.JSInterface
-
cachePut
- Specified by:
cachePutin interfacejavajs.api.JSInterface
-
getFullName
- Specified by:
getFullNamein interfacejavajs.api.JSInterface
-