Package jspecview.common
Class JSViewer
java.lang.Object
jspecview.common.JSViewer
- All Implemented Interfaces:
BytePoster,PlatformViewer
This class encapsulates all general functionality of applet and app. Most
methods include ScriptInterface parameter, which will be JSVAppletPrivate,
JSVAppletPrivatePro, or MainFrame.
- Author:
- Bob Hanson hansonr@stolaf.edu
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanbooleanbooleanstatic final intstatic final intstatic final intstatic final intintintbooleanbooleanstatic booleanbooleanbooleanstatic booleanstatic JSVToJSmolInterfacebooleanfloatstatic final intstatic final intstatic final intstatic final intstatic final intstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckCommandLineForTip(char c, String cmd, boolean oneLineOnly) booleancheckOvelayInterface(String value) voidcheckScript(String script) voidvoidcloseSource(JDXSource source) voidcombineSpectra(String name) voiddispose()voidvoidgetDialog(Annotation.AType type, Spectrum spec) getDialogPrint(boolean isJob) intstatic ObjectgetInterface(String name) intgetOptionFromDialog(String[] items, String title, String label) getOutputChannel(String fileName, boolean isBinary) getPlatformInterface(String type) intgetSolutionColor(boolean asFitted) getSolutionColorStr(boolean asFit) intgetWidth()intopenDataOrFile(Object data, String name, Lst<Spectrum> specs, String strUrl, int firstSpec, int lastSpec, boolean isAppend, String id) voidOpens and displays a filevoidopenFileAsyncSpecial(String fileName, int flags) voidopenFileFromDialog(boolean isAppend, boolean isURL, String simulationType, String script) voidparseInitScript(String params) Parses the JavaScript call parameters and executes them accordinglypd()postByteArray(String fileName, byte[] bytes) booleanprocessMouseEvent(int id, int x, int y, int modifiers, long time) called by JSmol.js mouse eventvoidprocessPeakPickEvent(Object eventObj, boolean isApp) this method is called as a result of the user clicking on a peak (eventObject instanceof PeakPickEvent) or from PEAK command executionvoidprocessTwoPointGesture(float[][][] touches) voidvoidvoidbooleanrunScriptNow(String script) voidselectedTreeNode(JSVTreeNode node) selectFrameNode(JSVPanel jsvp) intselectPanel(JSVPanel jsvp, Lst<PanelNode> panelNodes) voidvoidsetDisplay(Object canvas) voidsetFrameAndTreeNode(int i) voidvoidvoidsetPopupMenu(boolean allowMenu, boolean zoomEnabled) voidsetProperty(String key, String value) voidsetScreenDimension(int width, int height) voidshowMenu(int x, int y) voidshowMessage(String msg) voidvoidsyncScript(String peakScript) incoming script processing of invalid input: '<'PeakAssignment file="" type="xxx"...> record from JmolvoidupdateJS()for JavaScript only; this is the call to draw the spectrum
-
Field Details
-
sourceLabel
- See Also:
-
FILE_OPEN_OK
public static final int FILE_OPEN_OK- See Also:
-
FILE_OPEN_ALREADY
public static final int FILE_OPEN_ALREADY- See Also:
-
FILE_OPEN_ERROR
public static final int FILE_OPEN_ERROR- See Also:
-
FILE_OPEN_NO_DATA
public static final int FILE_OPEN_NO_DATA- See Also:
-
OVERLAY_DIALOG
public static final int OVERLAY_DIALOG- See Also:
-
OVERLAY_OFFSET
public static final int OVERLAY_OFFSET- See Also:
-
PORTRAIT
public static final int PORTRAIT- See Also:
-
PAGE_EXISTS
public static final int PAGE_EXISTS- See Also:
-
NO_SUCH_PAGE
public static final int NO_SUCH_PAGE- See Also:
-
si
-
g2d
-
spectraTree
-
currentSource
-
panelNodes
-
parameters
-
repaintManager
-
selectedPanel
-
mainPanel
-
properties
-
scriptQueue
-
fileHelper
-
jsvpPopupMenu
-
loadImaginary
public boolean loadImaginary -
interfaceOverlaid
public boolean interfaceOverlaid -
autoIntegrate
public boolean autoIntegrate -
autoShowLegend
public boolean autoShowLegend -
obscureTitleFromUser
-
allowMenu
public boolean allowMenu -
initialStartIndex
public int initialStartIndex -
initialEndIndex
public int initialEndIndex -
isSingleThreaded
public boolean isSingleThreaded -
isApplet
public boolean isApplet -
isJS
public static boolean isJS -
isSwingJS
public static boolean isSwingJS -
isSigned
public boolean isSigned -
appletName
-
fullName
-
syncID
-
html5Applet
-
display
-
apiPlatform
-
jmolObject
-
nmrMaxY
public float nmrMaxY
-
-
Constructor Details
-
JSViewer
- Parameters:
si-isApplet-isJSApplet-
-
-
Method Details
-
setProperty
-
setNode
-
setPopupMenu
public void setPopupMenu(boolean allowMenu, boolean zoomEnabled) -
showMenu
public void showMenu(int x, int y) -
runScriptNow
-
checkOvelayInterface
-
pd
-
execView
-
syncScript
incoming script processing of invalid input: '<'PeakAssignment file="" type="xxx"...> record from Jmol- Parameters:
peakScript-
-
processPeakPickEvent
this method is called as a result of the user clicking on a peak (eventObject instanceof PeakPickEvent) or from PEAK command execution- Parameters:
eventObj-isApp-
-
sendPanelChange
public void sendPanelChange() -
getPropertyAsJavaObject
-
getCoordinate
-
getSolutionColor
public int getSolutionColor(boolean asFitted) -
openDataOrFile
-
close
-
execLoad
-
combineSpectra
-
closeSource
-
setFrameAndTreeNode
public void setFrameAndTreeNode(int i) -
selectFrameNode
-
splitSpectra
public void splitSpectra() -
selectedTreeNode
-
dispose
public void dispose() -
runScript
-
requestRepaint
public void requestRepaint() -
repaintDone
public void repaintDone() -
checkOverlay
public void checkOverlay() -
setDisplay
-
setScreenDimension
public void setScreenDimension(int width, int height) -
updateJS
public void updateJS()for JavaScript only; this is the call to draw the spectrum -
processMouseEvent
public boolean processMouseEvent(int id, int x, int y, int modifiers, long time) called by JSmol.js mouse event- Parameters:
id-x-y-modifiers-time-- Returns:
- t/f
-
processTwoPointGesture
public void processTwoPointGesture(float[][][] touches) -
getApplet
-
openFileAsyncSpecial
- Parameters:
fileName-flags-
-
getHeight
public int getHeight() -
getWidth
public int getWidth() -
getPlatformInterface
-
getDialogManager
-
getDialog
-
getDialogPrint
-
setIRmode
-
getOptionFromDialog
-
print
-
export
-
postByteArray
- Specified by:
postByteArrayin interfaceBytePoster
-
getOutputChannel
- Throws:
Exception
-
getInterface
-
showMessage
-
openFileFromDialog
-
openFile
Opens and displays a file- Parameters:
fileName-closeFirst-
-
selectPanel
-
checkAutoIntegrate
public void checkAutoIntegrate() -
parseInitScript
Parses the JavaScript call parameters and executes them accordingly- Parameters:
params- String
-
getSolutionColorStr
-
checkCommandLineForTip
-
checkScript
-