Package jspecview.app
Class JSVApp
java.lang.Object
jspecview.app.JSVApp
- All Implemented Interfaces:
JSVAppInterface
,JSVAppletInterface
,PanelListener
,ScriptInterface
- Direct Known Subclasses:
JSVAppPro
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
-
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
checkScript
(String script) void
dispose()
void
doAdvanced
(String filePath) called by Pro's popup window Advanced...exportSpectrum
(String type, int n) Delivers spectrum coded as desired: XY, SQZ, PAC, DIF, DIFDUP, FIX, AML, CMLstatic String
Method that can be called from another applet or from javascript to return the coordinate of clicked point in the plot area of theJSVPanel
getPropertyAsJSON
(String key) Returns the calculated colour of a visible spectrum (Transmittance)void
initParams
(String params) starts or restarts applet display from scratch or from a JSVApplet.script() JavaScript command Involves a two-pass sequence through parsing the parameters, because order is not important in this sort of call.boolean
isPro()
boolean
isSigned()
void
loadInline
(String data) Loads in-line JCAMP-DX data into the existing applet windowvoid
panelEvent
(Object eventObj) called by notifyPeakPickedListeners in JSVPanelvoid
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 params) void
setCursor
(int id) void
setFilePath
(String tmpFilePath) void
setSpectrumNumber
(int n) Sets the spectrum to the specified block numbervoid
setVisible
(boolean b) void
siCheckCallbacks
(String title) void
siExecHidden
(boolean b) void
siExecScriptComplete
(String msg, boolean isOK) void
siExecSetCallback
(ScriptToken st, String value) void
siExecTest
(String value) siGetNewJSVPanel
(Spectrum spec) siGetNewJSVPanel2
(Lst<Spectrum> specs) void
siNewWindow
(boolean isSelected, boolean fromFrame) Shows the applet in a Framevoid
void
siOpenDataOrFile
(Object data, String name, Lst<Spectrum> specs, String url, int firstSpec, int lastSpec, boolean isAppend, String script, String id) void
siProcessCommand
(String scriptItem) overloaded in JSVAppletProvoid
void
siSetCurrentSource
(JDXSource source) void
siSetLoaded
(String fileName, String filePath) void
siSetMenuEnables
(PanelNode node, boolean isSplit) void
siSetPropertiesFromPreferences
(JSVPanel jsvp, boolean includeMeasures) void
siSetSelectedPanel
(JSVPanel jsvp) void
siSourceClosed
(JDXSource source) void
siSyncLoad
(String filePath) Loads a new file into the existing applet windowvoid
siUpdateBoolean
(ScriptToken st, boolean TF) void
siUpdateRecentMenus
(String filePath) void
siValidateAndRepaint
(boolean isAll) void
syncScript
(String peakScript) precede invalid input: '<'Peaks here with full name of Jmol applet (including syncID)void
syncToJmol
(String msg) 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 coordinate on aJSVPanel
void
updateJS
(int width, int height) void
writeStatus
(String msg) Writes a message to the status label
-
Field Details
-
CREDITS
- See Also:
-
appletFrame
-
appletReadyCallbackFunctionName
-
vwr
-
-
Constructor Details
-
JSVApp
-
-
Method Details
-
isPro
public boolean isPro()- Specified by:
isPro
in interfaceJSVAppletInterface
-
isSigned
public boolean isSigned()- Specified by:
isSigned
in interfaceJSVAppletInterface
- Specified by:
isSigned
in interfaceScriptInterface
-
getAppletFrame
-
dispose
public void dispose() -
getPropertyAsJavaObject
- Specified by:
getPropertyAsJavaObject
in interfaceJSVAppletInterface
-
getPropertyAsJSON
- Specified by:
getPropertyAsJSON
in interfaceJSVAppletInterface
-
getCoordinate
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
Loads in-line JCAMP-DX data into the existing applet window- Specified by:
loadInline
in interfaceJSVAppletInterface
- Parameters:
data
- String
-
exportSpectrum
Delivers spectrum coded as desired: XY, SQZ, PAC, DIF, DIFDUP, FIX, AML, CML- Specified by:
exportSpectrum
in interfaceJSVAppletInterface
- Parameters:
type
-n
-- Returns:
- data
-
setFilePath
- Specified by:
setFilePath
in interfaceJSVAppletInterface
-
setSpectrumNumber
public void setSpectrumNumber(int n) Sets the spectrum to the specified block number- Specified by:
setSpectrumNumber
in interfaceJSVAppletInterface
- Parameters:
n
-
-
reversePlot
public void reversePlot()Method that can be called from another applet or from javascript that toggles reversing the plot on aJSVPanel
- Specified by:
reversePlot
in interfaceJSVAppletInterface
-
toggleGrid
public void toggleGrid()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()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()Method that can be called from another applet or from javascript that toggles the coordinate on aJSVPanel
- Specified by:
togglePointsOnly
in interfaceJSVAppletInterface
-
toggleIntegration
public void toggleIntegration()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) 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
-
removeHighlight
public 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
- Specified by:
removeHighlight
in interfaceJSVAppletInterface
- Parameters:
x1
- the starting x valuex2
- the ending x value
-
removeAllHighlights
public void removeAllHighlights()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
-
syncScript
Description copied from interface:JSVAppletInterface
precede invalid input: '<'Peaks here with full name of Jmol applet (including syncID)- Specified by:
syncScript
in interfaceJSVAppletInterface
- Parameters:
peakScript
-
-
writeStatus
Writes a message to the status label- Specified by:
writeStatus
in interfaceJSVAppletInterface
- Specified by:
writeStatus
in interfaceScriptInterface
- Parameters:
msg
- the message
-
initParams
starts or restarts applet display from scratch or from a JSVApplet.script() JavaScript command Involves a two-pass sequence through parsing the parameters, because order is not important in this sort of call. To call a script and have commands execute in order, use JSVApplet.runScript(script) instead- Parameters:
params
-
-
repaint
public void repaint()- Specified by:
repaint
in interfaceScriptInterface
-
updateJS
public void updateJS(int width, int height) - Parameters:
width
-height
-
-
runScriptNow
- Specified by:
runScriptNow
in interfaceJSVAppletInterface
- Specified by:
runScriptNow
in interfaceScriptInterface
-
doAdvanced
called by Pro's popup window Advanced...- Parameters:
filePath
-
-
panelEvent
called by notifyPeakPickedListeners in JSVPanel- Specified by:
panelEvent
in interfacePanelListener
-
getSolnColour
Returns the calculated colour of a visible spectrum (Transmittance)- Specified by:
getSolnColour
in interfaceJSVAppletInterface
- Returns:
- Color
-
syncToJmol
- Specified by:
syncToJmol
in interfaceScriptInterface
- Parameters:
msg
-
-
setVisible
public void setVisible(boolean b) - Specified by:
setVisible
in interfaceJSVAppletInterface
-
setCursor
public void setCursor(int id) - Specified by:
setCursor
in interfaceScriptInterface
-
runScript
Description copied from interface:JSVAppletInterface
runs a script in proper order as listed- Specified by:
runScript
in interfaceJSVAppletInterface
- Specified by:
runScript
in interfaceScriptInterface
- Parameters:
script
-
-
getScriptQueue
- Specified by:
getScriptQueue
in interfaceJSVAppInterface
-
siSetCurrentSource
- Specified by:
siSetCurrentSource
in interfaceScriptInterface
-
siSendPanelChange
public void siSendPanelChange()- Specified by:
siSendPanelChange
in interfaceScriptInterface
-
siNewWindow
public void siNewWindow(boolean isSelected, boolean fromFrame) Shows the applet in a Frame- Specified by:
siNewWindow
in interfaceScriptInterface
- Parameters:
isSelected
-
-
siValidateAndRepaint
public void siValidateAndRepaint(boolean isAll) - Specified by:
siValidateAndRepaint
in interfaceScriptInterface
-
siSyncLoad
Loads a new file into the existing applet window- Specified by:
siSyncLoad
in interfaceScriptInterface
- Parameters:
filePath
-
-
siOpenDataOrFile
public void siOpenDataOrFile(Object data, String name, Lst<Spectrum> specs, String url, int firstSpec, int lastSpec, boolean isAppend, String script, String id) - Specified by:
siOpenDataOrFile
in interfaceScriptInterface
-
siProcessCommand
overloaded in JSVAppletPro- Specified by:
siProcessCommand
in interfaceScriptInterface
- Parameters:
scriptItem
-
-
siSetSelectedPanel
- Specified by:
siSetSelectedPanel
in interfaceScriptInterface
-
siExecSetCallback
- Specified by:
siExecSetCallback
in interfaceScriptInterface
-
siLoaded
- Specified by:
siLoaded
in interfaceScriptInterface
-
siExecHidden
public void siExecHidden(boolean b) - Specified by:
siExecHidden
in interfaceScriptInterface
-
siExecScriptComplete
- Specified by:
siExecScriptComplete
in interfaceScriptInterface
-
siUpdateBoolean
- Specified by:
siUpdateBoolean
in interfaceScriptInterface
-
siCheckCallbacks
- Specified by:
siCheckCallbacks
in interfaceScriptInterface
-
siNodeSet
- Specified by:
siNodeSet
in interfaceScriptInterface
-
siSourceClosed
- Specified by:
siSourceClosed
in interfaceScriptInterface
-
siGetNewJSVPanel
- Specified by:
siGetNewJSVPanel
in interfaceScriptInterface
-
siGetNewJSVPanel2
- Specified by:
siGetNewJSVPanel2
in interfaceScriptInterface
-
siSetPropertiesFromPreferences
- Specified by:
siSetPropertiesFromPreferences
in interfaceScriptInterface
-
siSetLoaded
- Specified by:
siSetLoaded
in interfaceScriptInterface
-
siSetMenuEnables
- Specified by:
siSetMenuEnables
in interfaceScriptInterface
-
siUpdateRecentMenus
- Specified by:
siUpdateRecentMenus
in interfaceScriptInterface
-
siExecTest
- Specified by:
siExecTest
in interfaceScriptInterface
-
print
- Specified by:
print
in interfaceJSVAppletInterface
-
checkScript
- Specified by:
checkScript
in interfaceJSVAppletInterface
-
getAppletInfo
-