Package jspecview.appletjs
Class JSVApplet
java.lang.Object
jspecview.appletjs.JSVApplet
- All Implemented Interfaces:
JSInterface,AppletFrame,JSVAppletInterface
- Direct Known Subclasses:
JSVAppletPro
Entry point for the web.
JSpecView Applet class. For a list of parameters and scripting functionality
see the file JSpecView_Applet_Specification.html.
- Author:
- Bob Hanson, Debbie-Ann Facey, Khari A. Bryan, Craig A. D. Walters, Prof Robert J. Lancashire http://blog.gorges.us/2009/03/how-to-enable-keywords-in-eclipse-and- subversion-svn/ $LastChangedRevision: 1097 $ $LastChangedDate: 2012-07-23 11:10:30 -0500 (Mon, 23 Jul 2012) $
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHighlight(double x1, double x2, int r, int g, int b, int a) Method that can be called from another applet or from javascript that adds a highlight to a portion of the plot area of aJSVPanelintcacheFileByName(String fileName, boolean isAdd) voidvoidcallToJavaScript(String callback, Object[] data) Calls a javascript function given by the function name passing to it the string parameters as argumentscheckScript(String script) voidcreateMainPanel(JSViewer viewer) voiddestroy()voidDeprecated.exportSpectrum(String type, int n) Delivers spectrum coded as desired: XY, SQZ, PAC, DIF, DIFDUP, FIX, AML, CML, PDF(base64-encoded)getApp()Get Applet informationMethod that can be called from another applet or from javascript to return the coordinate of clicked point in the plot area of theJSVPanelgetJSVPanel(JSViewer viewer, Lst<Spectrum> specs) getParameter(String paramName) getParameter(String key, String def) getPropertyAsJSON(String key) Returns the calculated colour of a visible spectrum (Transmittance)voidinit()Initializes applet with parameters and load theJDXSourcecalled by the browserprotected voidbooleanisPro()booleanisSigned()voidloadInline(String data) Loads in-line JCAMP-DX data into the existing applet windowvoidnewWindow(boolean isSelected) possibly called from JSmolJSV.js upon start upvoidopenFileAsyncSpecial(String fileName, int flags) voidopenFileAsyncSpecialType(String fileName, int flags, String type) voidprocessKeyEvent(Object event) booleanprocessMouseEvent(int id, int x, int y, int modifiers, long time) voidprocessTwoPointGesture(float[][][] touches) voidMethod that can be called from another applet or from javascript that removes all highlights from the plot area of aJSVPanelvoidremoveHighlight(double x1, double x2) Method that can be called from another applet or from javascript that removes a highlight from the plot area of aJSVPanelvoidrepaint()voidMethod that can be called from another applet or from javascript that toggles reversing the plot on aJSVPanelvoidruns a script in proper order as listedbooleanrunScriptNow(String script) voidDeprecated.voidsetDisplay(Object canvas) voidsetDropTargetListener(boolean isSigned, JSViewer viewer) voidsetFilePath(String tmpFilePath) voidsetPanelVisible(boolean b) voidsetScreenDimension(int width, int height) voidsetSpectrumNumber(int i) Sets the spectrum to the specified block numberbooleansetStatusDragDropped(int mode, int x, int y, String fileName, String[] retType) voidstartHoverWatcher(boolean enable) voidsyncScript(String peakScript) precede invalid input: '<'Peaks here with full name of Jmol applet (including syncID)voidMethod that can be called from another applet or from javascript that toggles the coordinate on aJSVPanelvoidMethod that can be called from another applet or from javascript that toggles the grid on aJSVPanelvoidMethod that can be called from another applet or from javascript that toggles the integration graph of aJSVPanel.voidMethod that can be called from another applet or from javascript that toggles the flag for points only on aJSVPanelvoidupdate()voidvalidate()voidvalidateContent(int mode) voidwriteStatus(String msg) Writes a message to the status label
-
Field Details
-
app
-
viewer
-
viewerOptions
-
-
Constructor Details
-
JSVApplet
-
-
Method Details
-
init
public void init()Initializes applet with parameters and load theJDXSourcecalled by the browser -
initViewer
protected void initViewer() -
getParameter
- Specified by:
getParameterin interfaceAppletFrame
-
isPro
public boolean isPro()- Specified by:
isProin interfaceJSVAppletInterface
-
isSigned
public boolean isSigned()- Specified by:
isSignedin interfaceJSVAppletInterface
-
destroy
public void destroy()- Specified by:
destroyin interfaceJSInterface
-
getParameter
-
getAppletInfo
Get Applet information- Specified by:
getAppletInfoin interfaceAppletFrame- Returns:
- the String "JSpecView Applet"
-
getSolnColour
Description copied from interface:JSVAppletInterfaceReturns the calculated colour of a visible spectrum (Transmittance)- Specified by:
getSolnColourin interfaceJSVAppletInterface- Returns:
- Color
-
getCoordinate
Description copied from interface:JSVAppletInterfaceMethod that can be called from another applet or from javascript to return the coordinate of clicked point in the plot area of theJSVPanel- Specified by:
getCoordinatein interfaceJSVAppletInterface- Returns:
- A String representation of the coordinate
-
loadInline
Description copied from interface:JSVAppletInterfaceLoads in-line JCAMP-DX data into the existing applet window- Specified by:
loadInlinein interfaceJSVAppletInterface- Parameters:
data- String
-
export
Deprecated. -
exportSpectrum
Description copied from interface:JSVAppletInterfaceDelivers spectrum coded as desired: XY, SQZ, PAC, DIF, DIFDUP, FIX, AML, CML, PDF(base64-encoded)- Specified by:
exportSpectrumin interfaceJSVAppletInterface- Parameters:
type-n-- Returns:
- data
-
setFilePath
- Specified by:
setFilePathin interfaceJSVAppletInterface
-
setSpectrumNumber
public void setSpectrumNumber(int i) Description copied from interface:JSVAppletInterfaceSets the spectrum to the specified block number- Specified by:
setSpectrumNumberin interfaceJSVAppletInterface- Parameters:
i-
-
toggleGrid
public void toggleGrid()Description copied from interface:JSVAppletInterfaceMethod that can be called from another applet or from javascript that toggles the grid on aJSVPanel- Specified by:
toggleGridin interfaceJSVAppletInterface
-
toggleCoordinate
public void toggleCoordinate()Description copied from interface:JSVAppletInterfaceMethod that can be called from another applet or from javascript that toggles the coordinate on aJSVPanel- Specified by:
toggleCoordinatein interfaceJSVAppletInterface
-
togglePointsOnly
public void togglePointsOnly()Description copied from interface:JSVAppletInterfaceMethod that can be called from another applet or from javascript that toggles the flag for points only on aJSVPanel- Specified by:
togglePointsOnlyin interfaceJSVAppletInterface
-
toggleIntegration
public void toggleIntegration()Description copied from interface:JSVAppletInterfaceMethod that can be called from another applet or from javascript that toggles the integration graph of aJSVPanel.- Specified by:
toggleIntegrationin interfaceJSVAppletInterface
-
addHighlight
public void addHighlight(double x1, double x2, int r, int g, int b, int a) Description copied from interface:JSVAppletInterfaceMethod that can be called from another applet or from javascript that adds a highlight to a portion of the plot area of aJSVPanel- Specified by:
addHighlightin interfaceJSVAppletInterface- Parameters:
x1- the starting x valuex2- the ending x valuer- the red portion of the highlight colorg- the green portion of the highlight colorb- the blue portion of the highlight colora- the alpha portion of the highlight color
-
removeAllHighlights
public void removeAllHighlights()Description copied from interface:JSVAppletInterfaceMethod that can be called from another applet or from javascript that removes all highlights from the plot area of aJSVPanel- Specified by:
removeAllHighlightsin interfaceJSVAppletInterface
-
removeHighlight
public void removeHighlight(double x1, double x2) Description copied from interface:JSVAppletInterfaceMethod that can be called from another applet or from javascript that removes a highlight from the plot area of aJSVPanel- Specified by:
removeHighlightin interfaceJSVAppletInterface- Parameters:
x1- the starting x valuex2- the ending x value
-
reversePlot
public void reversePlot()Description copied from interface:JSVAppletInterfaceMethod that can be called from another applet or from javascript that toggles reversing the plot on aJSVPanel- Specified by:
reversePlotin interfaceJSVAppletInterface
-
script
Deprecated. -
runScript
Description copied from interface:JSVAppletInterfaceruns a script in proper order as listed- Specified by:
runScriptin interfaceJSVAppletInterface- Parameters:
script-
-
syncScript
Description copied from interface:JSVAppletInterfaceprecede invalid input: '<'Peaks here with full name of Jmol applet (including syncID)- Specified by:
syncScriptin interfaceJSVAppletInterface- Parameters:
peakScript-
-
writeStatus
Description copied from interface:JSVAppletInterfaceWrites a message to the status label- Specified by:
writeStatusin interfaceJSVAppletInterface- Parameters:
msg- the message
-
getPropertyAsJavaObject
- Specified by:
getPropertyAsJavaObjectin interfaceJSVAppletInterface
-
getPropertyAsJSON
- Specified by:
getPropertyAsJSONin interfaceJSVAppletInterface
-
runScriptNow
- Specified by:
runScriptNowin interfaceJSVAppletInterface
-
print
- Specified by:
printin interfaceJSVAppletInterface
-
setDropTargetListener
- Specified by:
setDropTargetListenerin interfaceAppletFrame
-
validateContent
public void validateContent(int mode) - Specified by:
validateContentin interfaceAppletFrame
-
createMainPanel
- Specified by:
createMainPanelin interfaceAppletFrame
-
newWindow
public void newWindow(boolean isSelected) - Specified by:
newWindowin interfaceAppletFrame
-
callToJavaScript
Calls a javascript function given by the function name passing to it the string parameters as arguments- Specified by:
callToJavaScriptin interfaceAppletFrame- Parameters:
callback-data-
-
setPanelVisible
public void setPanelVisible(boolean b) - Specified by:
setPanelVisiblein interfaceAppletFrame
-
getJSVPanel
- Specified by:
getJSVPanelin interfaceAppletFrame
-
getDocumentBase
- Specified by:
getDocumentBasein interfaceAppletFrame
-
repaint
public void repaint()- Specified by:
repaintin interfaceAppletFrame
-
validate
public void validate()- Specified by:
validatein interfaceAppletFrame
-
doExitJmol
public void doExitJmol()- Specified by:
doExitJmolin interfaceAppletFrame
-
getApp
- Specified by:
getAppin interfaceAppletFrame
-
setStatusDragDropped
- Specified by:
setStatusDragDroppedin interfaceJSInterface
-
cacheFileByName
- Specified by:
cacheFileByNamein interfaceJSInterface
-
cachePut
- Specified by:
cachePutin interfaceJSInterface
-
getFullName
- Specified by:
getFullNamein interfaceJSInterface
-
processMouseEvent
public boolean processMouseEvent(int id, int x, int y, int modifiers, long time) - Specified by:
processMouseEventin interfaceJSInterface
-
setDisplay
- Specified by:
setDisplayin interfaceJSInterface
-
startHoverWatcher
public void startHoverWatcher(boolean enable) - Specified by:
startHoverWatcherin interfaceJSInterface
-
update
public void update()- Specified by:
updatein interfaceJSInterface
-
openFile
possibly called from JSmolJSV.js upon start up- Parameters:
fileName-- Returns:
- error or null
-
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
-
checkScript
- Specified by:
checkScriptin interfaceJSVAppletInterface
-
processKeyEvent
- Specified by:
processKeyEventin interfaceJSInterface
-