.:. JSpecView Applet Specification

.:. Description

JSpecView is a viewer for spectral data in the JCAMP-DX format. The program was developed at the Department of Chemistry of the University of the West Indies, Mona, Jamaica, WI and is being released via Sourceforge.net Logo under the GNU Lesser General Public License. For a full description see the article published in Chemistry Central Journal 2007, 1:31 (07Dec2007)
It is written in JAVA and requires at least JAVA 1.5, although development is currently with 1.6
The code is available under version control (subversion - svn) at http://jspecview.svn.sourceforge.net/viewvc/jspecview/dev/

applet view
jspecview applet view
application view
jspecview application view

.:. Example web pages using JSpecView, for those who can't wait...

Examples of the applet and web page coding:
The use of JSpecView with MDL Chime, Jmol and Marvin can best be seen with some examples....
  1. IR spectra and displays of vibrational modes
  2. GCMS hotlinked chromatograms
  3. MS spectra and animations of fragmentations
  4. NMR spectra and displays of links to molecular structure
  5. Combination of displays

.:. Features

* Applets do not normally have permission to write to the hard disk so these functions will not work unless the appropriate permissions are set. An example of a signed JSpecView applet is given in a link to the sample files below. This is not an issue with the standalone application


.:. Parameters

All parameters are passed to the applet as a semi-colon separated list using a script call.
The accepted parameters in the list and their description follows:

.:. Scripting and Live Connect

Certain methods in the applet may be called from JavaScript.
These are:

Method Arguments or Return Values Description
setFilePath for example c:/jcamp-dx/filename.dx or c:\\jcamp-dx\\filename.dx Allows the loading of a new JCAMP-DX file, specified from JavaScript.
Note that the file must be in the class path of the applet or the full path given.
The forward slash can be used as a path separator '/'
or else escape the backslash using a double backslash '\\'.
setXMLPath for example c:/XML/filename.xml or c:\\XML\\filename.xml Allows the importing of a new XML file, specified from JavaScript.
Note that the file must be in the class path of the applet or the full path given.
The forward slash can be used as a path separator '/'
or else escape the backslash using a double backslash '\\'.
loadInline string containing JCAMP-DX data Allows the loading of inline JCAMP-DX data, specified from JavaScript string variable.
getCoordinate returns space separated values, e.g. "3220 0.41". Used to return the coordinates of a point when it is clicked on the applet display
toggleGrid none Toggles the grid on/off
toggleCoordinate none Toggles the x,y coordinate display
reversePlot none Reverses the plot
setSpectrumNumber 1, 2, ... For Ntuple and Block files, this specifies the spectrum that should be displayed.
addHighlight x1 - starting x coordinate x2 - ending x coordinate
r - red value of rgb color scheme. Number from 0-255
g - green value b - blue value a - alpha value or transparency.
Number from 0 - 255
Add a highlight to the region specified by x1 and x2
with the color and transparency specified by r, g, b and a.
removeHighlight x1 - starting x coordinate x2 - ending x coordinate Removes the highlight at the position specified by x1 and x2.
There must be a highlight specified by x1 and x2 exactly for this method to work.
removeAllHighlights none Removes all highlights from the display.

JSpecView may call a JavaScript function in response to mouse clicks in the plot area of the spectrum display if the coordcallbackfunctionname parameter (*) is specified. This function gets passed the values of the x and y position as two floating point numbers. Therefore, a JavaScript function must be implemented with the name given by coordcallbackfunctionname and take as its argument two floating point values for the x and y coordinates. Eg. if the value of the coordcallbackfunctionname parameter is onCoordClicked then a JavaScript method might look like this..

function onCoordClicked(x, y){
    alert("You Clicked: " + x + ", " + y);
}

Similarly JSpecView may call a JavaScript function in response to mouse clicks in the plot area of the spectrum display if the peakcallbackfunctionname parameter is specified. As with the coordcallback function this gets passed the values of the x and y position as two floating point numbers. In addition though it returns the closest actual X,Y values from the dataset and the value of the spectrum number if a Block or Ntuple file is open. Therefore, a JavaScript function must be implemented with the name given by peakcallbackfunctionname and take as its argument four floating point values for the two sets of x and y coordinates and an integer for the spectrum number. Eg. if the value of the peakcallbackfunctionname parameter is MyPeakClicked then a JavaScript method might look like this..

function MyPeakClicked(x1, y2, x2, y2, SNum){
    alert("You Clicked: " + x1 + ", " + y1);
    alert("The nearest datapoint was at : " + x2 + ", " + y2);

}

Check the JSpecView sourceforge project page for the last announcements and sign up for the users mailing list to get further information and contribute to the discussion.

To download the jar files or source code, visit the Sourceforge Subversion Pages.
Copyright © 2006-2008 by The University of the West Indies, all rights reserved.
Created 1st March 2006. Links checked and/or last modified 13th January 2008.
For further information contact Prof. R.J. Lancashire, Department of Chemistry, UWI, Mona, Kingston 7, JAMAICA, (robert.lancashire@uwimona.edu.jm)