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 TypeFieldDescriptionboolean
boolean
boolean
static final int
static final int
static final int
static final int
int
int
boolean
boolean
static boolean
boolean
boolean
static boolean
static JSVToJSmolInterface
boolean
float
static final int
static final int
static final int
static final int
static final int
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkCommandLineForTip
(char c, String cmd, boolean oneLineOnly) boolean
checkOvelayInterface
(String value) void
checkScript
(String script) void
void
closeSource
(JDXSource source) void
combineSpectra
(String name) void
dispose()
void
void
getDialog
(Annotation.AType type, Spectrum spec) getDialogPrint
(boolean isJob) int
static Object
getInterface
(String name) int
getOptionFromDialog
(String[] items, String title, String label) getOutputChannel
(String fileName, boolean isBinary) getPlatformInterface
(String type) int
getSolutionColor
(boolean asFitted) getSolutionColorStr
(boolean asFit) int
getWidth()
int
openDataOrFile
(Object data, String name, Lst<Spectrum> specs, String strUrl, int firstSpec, int lastSpec, boolean isAppend, String id) void
Opens and displays a filevoid
openFileAsyncSpecial
(String fileName, int flags) void
openFileFromDialog
(boolean isAppend, boolean isURL, String simulationType, String script) void
parseInitScript
(String params) Parses the JavaScript call parameters and executes them accordinglypd()
postByteArray
(String fileName, byte[] bytes) boolean
processMouseEvent
(int id, int x, int y, int modifiers, long time) called by JSmol.js mouse eventvoid
processPeakPickEvent
(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 executionvoid
processTwoPointGesture
(float[][][] touches) void
void
void
boolean
runScriptNow
(String script) void
selectedTreeNode
(JSVTreeNode node) selectFrameNode
(JSVPanel jsvp) int
selectPanel
(JSVPanel jsvp, Lst<PanelNode> panelNodes) void
void
setDisplay
(Object canvas) void
setFrameAndTreeNode
(int i) void
void
void
setPopupMenu
(boolean allowMenu, boolean zoomEnabled) void
setProperty
(String key, String value) void
setScreenDimension
(int width, int height) void
showMenu
(int x, int y) void
showMessage
(String msg) void
void
syncScript
(String peakScript) incoming script processing of invalid input: '<'PeakAssignment file="" type="xxx"...> record from Jmolvoid
updateJS()
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:
postByteArray
in 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
-