public class MainFrame extends javax.swing.JFrame implements JmolSyncInterface, PanelListener, ScriptInterface, JSVAppletInterface
Modifier and Type | Field and Description |
---|---|
java.awt.dnd.DropTargetListener |
dtl |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
MainFrame(java.awt.Component jmolDisplay,
JSVInterface jmolOrAdvancedApplet)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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 a
JSVPanel |
void |
awaken(boolean visible) |
void |
checkCallbacks(java.lang.String title) |
void |
checkOverlay() |
void |
closeSource(JDXSource source)
Closes the
JDXSource specified by source |
JDXSource |
createSource(java.lang.String data,
java.lang.String filePath,
java.net.URL base,
int firstSpec,
int lastSpec) |
void |
enableStatus(boolean TF) |
void |
enableToolbar(boolean isEnabled) |
void |
execClose(java.lang.String value,
boolean fromScript) |
java.lang.String |
execExport(JSVPanel jsvp,
java.lang.String value) |
void |
execHidden(boolean b) |
java.lang.String |
execLoad(java.lang.String value) |
void |
execScriptComplete(java.lang.String msg,
boolean isOK) |
void |
execSetAutoIntegrate(boolean b) |
void |
execSetCallback(ScriptToken st,
java.lang.String value) |
void |
execSetInterface(java.lang.String value) |
void |
execTest(java.lang.String value) |
java.lang.String |
exportSpectrum(java.lang.String type,
int n)
Delivers spectrum coded as desired: XY, SQZ, PAC, DIF, DIFDUP, FIX, AML, CML
|
boolean |
getAutoCombine() |
boolean |
getAutoShowLegend() |
java.lang.String |
getCoordinate()
Method that can be called from another applet or from javascript to return
the coordinate of clicked point in the plot area of the
JSVPanel |
JDXSource |
getCurrentSource() |
java.net.URL |
getDocumentBase() |
java.lang.String |
getFileAsString(java.lang.String value) |
int |
getFileCount() |
java.lang.String |
getIntegrationRatios() |
JDXSpectrum.IRMode |
getIRMode() |
JSVPanel |
getNewJSVPanel(JDXSpectrum spec) |
JSVPanel |
getNewJSVPanel(java.util.List<JDXSpectrum> specs) |
JSVPanelNode |
getNewPanelNode(java.lang.String id,
java.lang.String fileName,
JDXSource source,
JSVPanel jsvp) |
JSVDialog |
getOverlayLegend(JSVPanel jsvp) |
PanelData |
getPanelData() |
java.util.List<JSVPanelNode> |
getPanelNodes() |
Parameters |
getParameters() |
java.lang.Object |
getPopupMenu() |
java.util.Map<java.lang.String,java.lang.Object> |
getProperty(java.lang.String key) |
java.util.Map<java.lang.String,java.lang.Object> |
getPropertyAsJavaObject(java.lang.String key) |
java.lang.String |
getPropertyAsJSON(java.lang.String key) |
java.lang.String |
getReturnFromJmolModel() |
JSVPanel |
getSelectedPanel() |
java.lang.String |
getSolnColour()
Returns the calculated colour of a visible spectrum (Transmittance)
|
java.lang.Object |
getSpectraTree() |
int |
incrementScriptLevelCount(int n) |
int |
incrementViewCount(int n) |
boolean |
isPro() |
boolean |
isSigned() |
void |
loadInline(java.lang.String data)
Loads in-line JCAMP-DX data into the existing applet window
|
static void |
main(java.lang.String[] args) |
void |
openDataOrFile(java.lang.String data,
java.lang.String name,
java.util.List<JDXSpectrum> specs,
java.lang.String url,
int firstSpec,
int lastSpec,
boolean isAppend) |
void |
openFile(java.lang.String fileName,
boolean closeFirst)
Opens and displays a file
|
void |
openURL() |
void |
panelEvent(java.lang.Object eventObj) |
java.lang.String |
print(java.lang.String pdfFileName) |
void |
processCommand(java.lang.String script) |
void |
register(java.lang.String appletID,
JmolSyncInterface jmolStatusListener)
called by Jmol's StatusListener to register itself, indicating to JSpecView
that it needs to synchronize with it
|
void |
removeAllHighlights()
Method that can be called from another applet or from javascript that
removes all highlights from the plot area of a
JSVPanel |
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 a
JSVPanel |
void |
repaintCompleted() |
void |
requestRepaint() |
void |
reversePlot()
Method that can be called from another applet or from javascript that
toggles reversing the plot on a
JSVPanel |
void |
runScript(java.lang.String script)
ScriptInterface requires this.
|
boolean |
runScriptNow(java.lang.String peakScript) |
void |
sendPanelChange(JSVPanel jsvp) |
void |
setCurrentSource(JDXSource source) |
void |
setCursorObject(java.lang.Object c) |
void |
setFileCount(int n) |
void |
setFilePath(java.lang.String tmpFilePath) |
void |
setIntegrationRatios(java.lang.String value) |
void |
setIRMode(JDXSpectrum.IRMode mode) |
void |
setLoaded(java.lang.String fileName,
java.lang.String filePath) |
void |
setLoadImaginary(boolean TF) |
void |
setMenuEnables(JSVPanelNode node,
boolean isSplit) |
void |
setNode(JSVPanelNode panelNode,
boolean fromTree) |
JSVPanelNode |
setOverlayVisibility(JSVPanelNode node) |
void |
setPropertiesFromPreferences(JSVPanel jsvp,
boolean includeMeasures)
Sets the display properties as specified from the preferences dialog or the
properties file
|
void |
setProperty(java.lang.String key,
java.lang.String value) |
void |
setRecentURL(java.lang.String filePath) |
void |
setReturnFromJmolModel(java.lang.String model) |
void |
setSelectedPanel(JSVPanel jsvp) |
JSVPanel |
setSpectrum(java.lang.String value) |
void |
setSpectrumNumber(int i)
Sets the spectrum to the specified block number
|
void |
setSplitPane(boolean TF) |
void |
showNotImplementedOptionPane()
Shows a dialog with the message "Not Yet Implemented"
|
void |
showPreferences() |
void |
showProperties() |
void |
syncLoad(java.lang.String filePath) |
void |
syncScript(java.lang.String peakScript)
precede |
void |
syncToJmol(java.lang.String msg) |
void |
toggleCoordinate()
Method that can be called from another applet or from javascript that
toggles the coordinate on a
JSVPanel |
void |
toggleGrid()
Method that can be called from another applet or from javascript that
toggles the grid on a
JSVPanel |
void |
toggleIntegration()
Method that can be called from another applet or from javascript that
toggles the integration graph of a
JSVPanel . |
void |
toggleOverlayKey() |
void |
updateBoolean(ScriptToken st,
boolean TF) |
void |
updateRecentMenus(java.lang.String filePath) |
void |
validateAndRepaint() |
void |
writeStatus(java.lang.String msg)
Writes a message to the status bar
|
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
repaint
setVisible
public MainFrame(java.awt.Component jmolDisplay, JSVInterface jmolOrAdvancedApplet)
jmolDisplay
- jmolOrAdvancedApplet
- public static void main(java.lang.String[] args)
public boolean isPro()
isPro
in interface JSVAppletInterface
public boolean isSigned()
isSigned
in interface JSVAppletInterface
isSigned
in interface ScriptInterface
public boolean getAutoCombine()
getAutoCombine
in interface ScriptInterface
public boolean getAutoShowLegend()
getAutoShowLegend
in interface ScriptInterface
public JDXSource getCurrentSource()
getCurrentSource
in interface ScriptInterface
public int getFileCount()
getFileCount
in interface ScriptInterface
public void setFileCount(int n)
setFileCount
in interface ScriptInterface
public java.lang.String getIntegrationRatios()
getIntegrationRatios
in interface ScriptInterface
public void setIntegrationRatios(java.lang.String value)
setIntegrationRatios
in interface ScriptInterface
public JDXSpectrum.IRMode getIRMode()
getIRMode
in interface ScriptInterface
public void setIRMode(JDXSpectrum.IRMode mode)
setIRMode
in interface ScriptInterface
public void setLoadImaginary(boolean TF)
setLoadImaginary
in interface ScriptInterface
public java.util.List<JSVPanelNode> getPanelNodes()
getPanelNodes
in interface ScriptInterface
public Parameters getParameters()
getParameters
in interface ScriptInterface
public java.lang.Object getPopupMenu()
getPopupMenu
in interface ScriptInterface
public void setReturnFromJmolModel(java.lang.String model)
setReturnFromJmolModel
in interface ScriptInterface
public java.lang.String getReturnFromJmolModel()
getReturnFromJmolModel
in interface ScriptInterface
public JSVPanel getSelectedPanel()
getSelectedPanel
in interface ScriptInterface
public java.lang.Object getSpectraTree()
getSpectraTree
in interface ScriptInterface
public int incrementScriptLevelCount(int n)
incrementScriptLevelCount
in interface ScriptInterface
public int incrementViewCount(int n)
incrementViewCount
in interface ScriptInterface
public void awaken(boolean visible)
public void openDataOrFile(java.lang.String data, java.lang.String name, java.util.List<JDXSpectrum> specs, java.lang.String url, int firstSpec, int lastSpec, boolean isAppend)
openDataOrFile
in interface ScriptInterface
public void setCurrentSource(JDXSource source)
setCurrentSource
in interface ScriptInterface
public void setPropertiesFromPreferences(JSVPanel jsvp, boolean includeMeasures)
setPropertiesFromPreferences
in interface ScriptInterface
jsvp
- the display panelpublic void showNotImplementedOptionPane()
public void processCommand(java.lang.String script)
public boolean runScriptNow(java.lang.String peakScript)
runScriptNow
in interface JSVAppletInterface
public void panelEvent(java.lang.Object eventObj)
panelEvent
in interface PanelListener
public void setSelectedPanel(JSVPanel jsvp)
setSelectedPanel
in interface ScriptInterface
public void sendPanelChange(JSVPanel jsvp)
sendPanelChange
in interface ScriptInterface
public void setSplitPane(boolean TF)
public void enableToolbar(boolean isEnabled)
public void showPreferences()
public java.util.Map<java.lang.String,java.lang.Object> getProperty(java.lang.String key)
getProperty
in interface JmolSyncInterface
public void register(java.lang.String appletID, JmolSyncInterface jmolStatusListener)
register
in interface JmolSyncInterface
public void syncToJmol(java.lang.String msg)
syncToJmol
in interface ScriptInterface
public void syncScript(java.lang.String peakScript)
JSVAppletInterface
syncScript
in interface JSVAppletInterface
syncScript
in interface JmolSyncInterface
public void syncLoad(java.lang.String filePath)
syncLoad
in interface ScriptInterface
public void validateAndRepaint()
validateAndRepaint
in interface ScriptInterface
public void execClose(java.lang.String value, boolean fromScript)
execClose
in interface ScriptInterface
public void execHidden(boolean b)
execHidden
in interface ScriptInterface
public java.lang.String execLoad(java.lang.String value)
execLoad
in interface ScriptInterface
public java.lang.String execExport(JSVPanel jsvp, java.lang.String value)
execExport
in interface ScriptInterface
public void execSetInterface(java.lang.String value)
execSetInterface
in interface ScriptInterface
public void execScriptComplete(java.lang.String msg, boolean isOK)
execScriptComplete
in interface ScriptInterface
public JSVPanel setSpectrum(java.lang.String value)
setSpectrum
in interface ScriptInterface
public void execSetAutoIntegrate(boolean b)
execSetAutoIntegrate
in interface ScriptInterface
public PanelData getPanelData()
getPanelData
in interface ScriptInterface
public JSVDialog getOverlayLegend(JSVPanel jsvp)
getOverlayLegend
in interface ScriptInterface
public void addHighlight(double x1, double x2, int r, int g, int b, int a)
JSVAppletInterface
JSVPanel
addHighlight
in interface JSVAppletInterface
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 colorpublic java.lang.String exportSpectrum(java.lang.String type, int n)
JSVAppletInterface
exportSpectrum
in interface JSVAppletInterface
public java.lang.String getCoordinate()
JSVAppletInterface
JSVPanel
getCoordinate
in interface JSVAppletInterface
public java.lang.String getPropertyAsJSON(java.lang.String key)
getPropertyAsJSON
in interface JSVAppletInterface
public java.util.Map<java.lang.String,java.lang.Object> getPropertyAsJavaObject(java.lang.String key)
getPropertyAsJavaObject
in interface JSVAppletInterface
public java.lang.String getSolnColour()
JSVAppletInterface
getSolnColour
in interface JSVAppletInterface
public void loadInline(java.lang.String data)
JSVAppletInterface
loadInline
in interface JSVAppletInterface
data
- Stringpublic void setFilePath(java.lang.String tmpFilePath)
setFilePath
in interface JSVAppletInterface
public void runScript(java.lang.String script)
runScript
in interface JSVAppletInterface
runScript
in interface ScriptInterface
public void removeAllHighlights()
JSVAppletInterface
JSVPanel
removeAllHighlights
in interface JSVAppletInterface
public void removeHighlight(double x1, double x2)
JSVAppletInterface
JSVPanel
removeHighlight
in interface JSVAppletInterface
x1
- the starting x valuex2
- the ending x valuepublic void reversePlot()
JSVAppletInterface
JSVPanel
reversePlot
in interface JSVAppletInterface
public void setSpectrumNumber(int i)
JSVAppletInterface
setSpectrumNumber
in interface JSVAppletInterface
public void toggleCoordinate()
JSVAppletInterface
JSVPanel
toggleCoordinate
in interface JSVAppletInterface
public void toggleGrid()
JSVAppletInterface
JSVPanel
toggleGrid
in interface JSVAppletInterface
public void toggleIntegration()
JSVAppletInterface
JSVPanel
.toggleIntegration
in interface JSVAppletInterface
public void execSetCallback(ScriptToken st, java.lang.String value)
execSetCallback
in interface ScriptInterface
public void openFile(java.lang.String fileName, boolean closeFirst)
fileName
- closeFirst
- public void showProperties()
showProperties
in interface ScriptInterface
public void updateBoolean(ScriptToken st, boolean TF)
updateBoolean
in interface ScriptInterface
public void enableStatus(boolean TF)
public void openURL()
public java.lang.String print(java.lang.String pdfFileName)
print
in interface JSVAppletInterface
print
in interface ScriptInterface
public void toggleOverlayKey()
public void checkCallbacks(java.lang.String title)
checkCallbacks
in interface ScriptInterface
public JSVPanelNode setOverlayVisibility(JSVPanelNode node)
setOverlayVisibility
in interface ScriptInterface
public void setNode(JSVPanelNode panelNode, boolean fromTree)
setNode
in interface ScriptInterface
public void closeSource(JDXSource source)
JDXSource
specified by sourcecloseSource
in interface ScriptInterface
source
- the JDXSource
public void setRecentURL(java.lang.String filePath)
setRecentURL
in interface ScriptInterface
public void writeStatus(java.lang.String msg)
writeStatus
in interface JSVAppletInterface
writeStatus
in interface ScriptInterface
msg
- the messagepublic void setLoaded(java.lang.String fileName, java.lang.String filePath)
setLoaded
in interface ScriptInterface
public void updateRecentMenus(java.lang.String filePath)
updateRecentMenus
in interface ScriptInterface
public void setMenuEnables(JSVPanelNode node, boolean isSplit)
setMenuEnables
in interface ScriptInterface
public JDXSource createSource(java.lang.String data, java.lang.String filePath, java.net.URL base, int firstSpec, int lastSpec) throws java.lang.Exception
createSource
in interface ScriptInterface
java.lang.Exception
public java.net.URL getDocumentBase()
getDocumentBase
in interface ScriptInterface
public JSVPanel getNewJSVPanel(java.util.List<JDXSpectrum> specs)
getNewJSVPanel
in interface ScriptInterface
public JSVPanel getNewJSVPanel(JDXSpectrum spec)
getNewJSVPanel
in interface ScriptInterface
public JSVPanelNode getNewPanelNode(java.lang.String id, java.lang.String fileName, JDXSource source, JSVPanel jsvp)
getNewPanelNode
in interface ScriptInterface
public void checkOverlay()
checkOverlay
in interface ScriptInterface
public void setCursorObject(java.lang.Object c)
setCursorObject
in interface ScriptInterface
public void execTest(java.lang.String value)
execTest
in interface ScriptInterface
public void requestRepaint()
requestRepaint
in interface ScriptInterface
public void repaintCompleted()
repaintCompleted
in interface ScriptInterface
public void setProperty(java.lang.String key, java.lang.String value)
setProperty
in interface ScriptInterface
public java.lang.String getFileAsString(java.lang.String value)
getFileAsString
in interface ScriptInterface