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 TypeMethodDescriptionvoid
addHighlight
(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 aJSVPanel
int
cacheFileByName
(String fileName, boolean isAdd) void
void
callToJavaScript
(String callback, Object[] data) Calls a javascript function given by the function name passing to it the string parameters as argumentscheckScript
(String script) void
createMainPanel
(JSViewer viewer) void
destroy()
void
Deprecated.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 theJSVPanel
getJSVPanel
(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)void
init()
Initializes applet with parameters and load theJDXSource
called by the browserprotected void
boolean
isPro()
boolean
isSigned()
void
loadInline
(String data) Loads in-line JCAMP-DX data into the existing applet windowvoid
newWindow
(boolean isSelected) possibly called from JSmolJSV.js upon start upvoid
openFileAsyncSpecial
(String fileName, int flags) void
openFileAsyncSpecialType
(String fileName, int flags, String type) void
processKeyEvent
(Object event) boolean
processMouseEvent
(int id, int x, int y, int modifiers, long time) void
processTwoPointGesture
(float[][][] touches) void
Method that can be called from another applet or from javascript that removes all highlights from the plot area of aJSVPanel
void
removeHighlight
(double x1, double x2) Method that can be called from another applet or from javascript that removes a highlight from the plot area of aJSVPanel
void
repaint()
void
Method that can be called from another applet or from javascript that toggles reversing the plot on aJSVPanel
void
runs a script in proper order as listedboolean
runScriptNow
(String script) void
Deprecated.void
setDisplay
(Object canvas) void
setDropTargetListener
(boolean isSigned, JSViewer viewer) void
setFilePath
(String tmpFilePath) void
setPanelVisible
(boolean b) void
setScreenDimension
(int width, int height) void
setSpectrumNumber
(int i) Sets the spectrum to the specified block numberboolean
setStatusDragDropped
(int mode, int x, int y, String fileName, String[] retType) void
setVisible
(boolean b) void
startHoverWatcher
(boolean enable) void
syncScript
(String peakScript) precede <Peaks here with full name of Jmol applet (including syncID)void
Method that can be called from another applet or from javascript that toggles the coordinate on aJSVPanel
void
Method that can be called from another applet or from javascript that toggles the grid on aJSVPanel
void
Method that can be called from another applet or from javascript that toggles the integration graph of aJSVPanel
.void
Method that can be called from another applet or from javascript that toggles the flag for points only on aJSVPanel
void
update()
void
validate()
void
validateContent
(int mode) void
writeStatus
(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 theJDXSource
called by the browser -
initViewer
protected void initViewer() -
getParameter
- Specified by:
getParameter
in interfaceAppletFrame
-
isPro
public boolean isPro()- Specified by:
isPro
in interfaceJSVAppletInterface
-
isSigned
public boolean isSigned()- Specified by:
isSigned
in interfaceJSVAppletInterface
-
destroy
public void destroy()- Specified by:
destroy
in interfaceJSInterface
-
getParameter
-
getAppletInfo
Get Applet information- Specified by:
getAppletInfo
in interfaceAppletFrame
- Returns:
- the String "JSpecView Applet"
-
getSolnColour
Description copied from interface:JSVAppletInterface
Returns the calculated colour of a visible spectrum (Transmittance)- Specified by:
getSolnColour
in interfaceJSVAppletInterface
- Returns:
- Color
-
getCoordinate
Description copied from interface:JSVAppletInterface
Method 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:
getCoordinate
in interfaceJSVAppletInterface
- Returns:
- A String representation of the coordinate
-
loadInline
Description copied from interface:JSVAppletInterface
Loads in-line JCAMP-DX data into the existing applet window- Specified by:
loadInline
in interfaceJSVAppletInterface
- Parameters:
data
- String
-
export
Deprecated. -
exportSpectrum
Description copied from interface:JSVAppletInterface
Delivers spectrum coded as desired: XY, SQZ, PAC, DIF, DIFDUP, FIX, AML, CML, PDF(base64-encoded)- Specified by:
exportSpectrum
in interfaceJSVAppletInterface
- Returns:
- data
-
setFilePath
- Specified by:
setFilePath
in interfaceJSVAppletInterface
-
setSpectrumNumber
public void setSpectrumNumber(int i) Description copied from interface:JSVAppletInterface
Sets the spectrum to the specified block number- Specified by:
setSpectrumNumber
in interfaceJSVAppletInterface
-
toggleGrid
public void toggleGrid()Description copied from interface:JSVAppletInterface
Method that can be called from another applet or from javascript that toggles the grid on aJSVPanel
- Specified by:
toggleGrid
in interfaceJSVAppletInterface
-
toggleCoordinate
public void toggleCoordinate()Description copied from interface:JSVAppletInterface
Method that can be called from another applet or from javascript that toggles the coordinate on aJSVPanel
- Specified by:
toggleCoordinate
in interfaceJSVAppletInterface
-
togglePointsOnly
public void togglePointsOnly()Description copied from interface:JSVAppletInterface
Method that can be called from another applet or from javascript that toggles the flag for points only on aJSVPanel
- Specified by:
togglePointsOnly
in interfaceJSVAppletInterface
-
toggleIntegration
public void toggleIntegration()Description copied from interface:JSVAppletInterface
Method that can be called from another applet or from javascript that toggles the integration graph of aJSVPanel
.- Specified by:
toggleIntegration
in interfaceJSVAppletInterface
-
addHighlight
public void addHighlight(double x1, double x2, int r, int g, int b, int a) Description copied from interface:JSVAppletInterface
Method 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:
addHighlight
in 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:JSVAppletInterface
Method that can be called from another applet or from javascript that removes all highlights from the plot area of aJSVPanel
- Specified by:
removeAllHighlights
in interfaceJSVAppletInterface
-
removeHighlight
public void removeHighlight(double x1, double x2) Description copied from interface:JSVAppletInterface
Method that can be called from another applet or from javascript that removes a highlight from the plot area of aJSVPanel
- Specified by:
removeHighlight
in interfaceJSVAppletInterface
- Parameters:
x1
- the starting x valuex2
- the ending x value
-
reversePlot
public void reversePlot()Description copied from interface:JSVAppletInterface
Method that can be called from another applet or from javascript that toggles reversing the plot on aJSVPanel
- Specified by:
reversePlot
in interfaceJSVAppletInterface
-
script
Deprecated. -
runScript
Description copied from interface:JSVAppletInterface
runs a script in proper order as listed- Specified by:
runScript
in interfaceJSVAppletInterface
-
syncScript
Description copied from interface:JSVAppletInterface
precede <Peaks here with full name of Jmol applet (including syncID)- Specified by:
syncScript
in interfaceJSVAppletInterface
-
writeStatus
Description copied from interface:JSVAppletInterface
Writes a message to the status label- Specified by:
writeStatus
in interfaceJSVAppletInterface
- Parameters:
msg
- the message
-
getPropertyAsJavaObject
- Specified by:
getPropertyAsJavaObject
in interfaceJSVAppletInterface
-
getPropertyAsJSON
- Specified by:
getPropertyAsJSON
in interfaceJSVAppletInterface
-
runScriptNow
- Specified by:
runScriptNow
in interfaceJSVAppletInterface
-
print
- Specified by:
print
in interfaceJSVAppletInterface
-
setDropTargetListener
- Specified by:
setDropTargetListener
in interfaceAppletFrame
-
validateContent
public void validateContent(int mode) - Specified by:
validateContent
in interfaceAppletFrame
-
createMainPanel
- Specified by:
createMainPanel
in interfaceAppletFrame
-
newWindow
public void newWindow(boolean isSelected) - Specified by:
newWindow
in interfaceAppletFrame
-
callToJavaScript
Calls a javascript function given by the function name passing to it the string parameters as arguments- Specified by:
callToJavaScript
in interfaceAppletFrame
- Parameters:
callback
-data
-
-
setPanelVisible
public void setPanelVisible(boolean b) - Specified by:
setPanelVisible
in interfaceAppletFrame
-
getJSVPanel
- Specified by:
getJSVPanel
in interfaceAppletFrame
-
setVisible
public void setVisible(boolean b) - Specified by:
setVisible
in interfaceJSVAppletInterface
-
getDocumentBase
- Specified by:
getDocumentBase
in interfaceAppletFrame
-
repaint
public void repaint()- Specified by:
repaint
in interfaceAppletFrame
-
validate
public void validate()- Specified by:
validate
in interfaceAppletFrame
-
doExitJmol
public void doExitJmol()- Specified by:
doExitJmol
in interfaceAppletFrame
-
getApp
- Specified by:
getApp
in interfaceAppletFrame
-
setStatusDragDropped
- Specified by:
setStatusDragDropped
in interfaceJSInterface
-
cacheFileByName
- Specified by:
cacheFileByName
in interfaceJSInterface
-
cachePut
- Specified by:
cachePut
in interfaceJSInterface
-
getFullName
- Specified by:
getFullName
in interfaceJSInterface
-
processMouseEvent
public boolean processMouseEvent(int id, int x, int y, int modifiers, long time) - Specified by:
processMouseEvent
in interfaceJSInterface
-
setDisplay
- Specified by:
setDisplay
in interfaceJSInterface
-
startHoverWatcher
public void startHoverWatcher(boolean enable) - Specified by:
startHoverWatcher
in interfaceJSInterface
-
update
public void update()- Specified by:
update
in interfaceJSInterface
-
openFile
possibly called from JSmolJSV.js upon start up- Parameters:
fileName
-- Returns:
- error or null
-
openFileAsyncSpecial
- Specified by:
openFileAsyncSpecial
in interfaceJSInterface
-
openFileAsyncSpecialType
- Specified by:
openFileAsyncSpecialType
in interfaceJSInterface
-
processTwoPointGesture
public void processTwoPointGesture(float[][][] touches) - Specified by:
processTwoPointGesture
in interfaceJSInterface
-
setScreenDimension
public void setScreenDimension(int width, int height) - Specified by:
setScreenDimension
in interfaceJSInterface
-
checkScript
- Specified by:
checkScript
in interfaceJSVAppletInterface
-
processKeyEvent
- Specified by:
processKeyEvent
in interfaceJSInterface
-