Class MainFrame

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, JSVAppInterface, JSVAppletInterface, PanelListener, JmolSyncInterface

public class MainFrame extends JFrame implements JmolSyncInterface, PanelListener, JSVAppInterface
The Main Class or Entry point of the JSpecView Application.
Author:
Debbie-Ann Facey, Khari A. Bryan, Prof Robert J. Lancashire
See Also:
  • Constructor Details

    • MainFrame

      public MainFrame(JSpecView jsv, Component jmolDisplay, JSVInterface jmolOrAdvancedApplet)
      Constructor
      Parameters:
      jsv -
      jmolDisplay -
      jmolOrAdvancedApplet -
  • Method Details

    • main

      public static void main(String[] args)
    • isPro

      public boolean isPro()
      Specified by:
      isPro in interface JSVAppletInterface
    • isSigned

      public boolean isSigned()
      Specified by:
      isSigned in interface JSVAppletInterface
    • awaken

      public void awaken(boolean visible)
    • keyPressedEvent

      protected void keyPressedEvent(int keyCode, char keyChar)
    • showNotImplementedOptionPane

      public void showNotImplementedOptionPane()
      Shows a dialog with the message "Not Yet Implemented"
    • runScriptNow

      public boolean runScriptNow(String peakScript)
      Specified by:
      runScriptNow in interface JSVAppletInterface
    • panelEvent

      public void panelEvent(Object eventObj)
      Specified by:
      panelEvent in interface PanelListener
    • getScriptQueue

      public Lst<String> getScriptQueue()
      Specified by:
      getScriptQueue in interface JSVAppInterface
    • setSplitPane

      public void setSplitPane(boolean TF)
    • enableToolbar

      public void enableToolbar(boolean isEnabled)
    • showPreferences

      public void showPreferences()
    • enableStatus

      public void enableStatus(boolean TF)
    • windowClosing_actionPerformed

      protected void windowClosing_actionPerformed()
    • getJSpecViewProperty

      public Map<String,Object> getJSpecViewProperty(String key)
      Specified by:
      getJSpecViewProperty in interface JmolSyncInterface
    • register

      public void register(String appletID, JmolSyncInterface jmolStatusListener)
      called by Jmol's StatusListener to register itself, indicating to JSpecView that it needs to synchronize with it
      Specified by:
      register in interface JmolSyncInterface
    • syncScript

      public void syncScript(String peakScript)
      Description copied from interface: JSVAppletInterface
      precede invalid input: '<'Peaks here with full name of Jmol applet (including syncID)
      Specified by:
      syncScript in interface JmolSyncInterface
      Specified by:
      syncScript in interface JSVAppletInterface
      Parameters:
      peakScript -
    • 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 a JSVPanel
      Specified by:
      addHighlight in interface JSVAppletInterface
      Parameters:
      x1 - the starting x value
      x2 - the ending x value
      r - the red portion of the highlight color
      g - the green portion of the highlight color
      b - the blue portion of the highlight color
      a - the alpha portion of the highlight color
    • exportSpectrum

      public String exportSpectrum(String type, int n)
      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 interface JSVAppletInterface
      Parameters:
      type -
      n -
      Returns:
      data
    • getCoordinate

      public String 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 the JSVPanel
      Specified by:
      getCoordinate in interface JSVAppletInterface
      Returns:
      A String representation of the coordinate
    • getPropertyAsJSON

      public String getPropertyAsJSON(String key)
      Specified by:
      getPropertyAsJSON in interface JSVAppletInterface
    • getPropertyAsJavaObject

      public Map<String,Object> getPropertyAsJavaObject(String key)
      Specified by:
      getPropertyAsJavaObject in interface JSVAppletInterface
    • getSolnColour

      public String getSolnColour()
      Description copied from interface: JSVAppletInterface
      Returns the calculated colour of a visible spectrum (Transmittance)
      Specified by:
      getSolnColour in interface JSVAppletInterface
      Returns:
      Color
    • loadInline

      public void loadInline(String data)
      Description copied from interface: JSVAppletInterface
      Loads in-line JCAMP-DX data into the existing applet window
      Specified by:
      loadInline in interface JSVAppletInterface
      Parameters:
      data - String
    • setFilePath

      public void setFilePath(String tmpFilePath)
      Specified by:
      setFilePath in interface JSVAppletInterface
    • runScript

      public void runScript(String script)
      ScriptInterface requires this. In the applet, this would be queued
      Specified by:
      runScript in interface JSVAppletInterface
      Parameters:
      script -
    • 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 a JSVPanel
      Specified by:
      removeAllHighlights in interface JSVAppletInterface
    • 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 a JSVPanel
      Specified by:
      removeHighlight in interface JSVAppletInterface
      Parameters:
      x1 - the starting x value
      x2 - 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 a JSVPanel
      Specified by:
      reversePlot in interface JSVAppletInterface
    • setCursorObject

      public void setCursorObject(Object c)
    • setSpectrumNumber

      public void setSpectrumNumber(int i)
      Description copied from interface: JSVAppletInterface
      Sets the spectrum to the specified block number
      Specified by:
      setSpectrumNumber in interface JSVAppletInterface
      Parameters:
      i -
    • 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 a JSVPanel
      Specified by:
      toggleCoordinate in interface JSVAppletInterface
    • 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 a JSVPanel
      Specified by:
      togglePointsOnly in interface JSVAppletInterface
    • 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 a JSVPanel
      Specified by:
      toggleGrid in interface JSVAppletInterface
    • 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 a JSVPanel.
      Specified by:
      toggleIntegration in interface JSVAppletInterface
    • writeStatus

      public void writeStatus(String msg)
      Writes a message to the status bar
      Specified by:
      writeStatus in interface JSVAppletInterface
      Parameters:
      msg - the message
    • print

      public String print(String fileName)
      Specified by:
      print in interface JSVAppletInterface
    • checkScript

      public String checkScript(String script)
      Specified by:
      checkScript in interface JSVAppletInterface
    • setSelectedPanel

      public void setSelectedPanel(JSVPanel jsvp)
    • validateAndRepaint

      public void validateAndRepaint(boolean isAll)
    • execHidden

      public void execHidden(boolean b)
    • setCallback

      public void setCallback(ScriptToken st, String value)
    • updateToolbar

      public void updateToolbar(ScriptToken st, boolean tf)
    • sourceClosed

      public void sourceClosed(JDXSource source)
    • setLoading

      public void setLoading(String fileName, String filePath)
    • updateRecentMenus

      public void updateRecentMenus(String filePath)
    • setMenuEnables

      public void setMenuEnables(PanelNode node, boolean isSplit)
    • syncToJmol

      public void syncToJmol(String msg)