# Class CMLExporter

java.lang.Object
jspecview.export.CMLExporter

All Implemented Interfaces:
  `JSVExporter`

public class CMLExporter extends Object
class `CMLExporter` contains static methods to export a Graph as as CIML. `CMLExporter` uses a template file called 'cml_tmp.vm' or 'cml_nmr.vm'. So any changes in design should be done in these files.

Author:
  Prof Robert J. Lancashire, Bob Hanson, hansonr@stolaf.edu

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`bp`
`protected String`
`casName`
`protected String`
`casRN`
`protected boolean`
`continuous`
`protected String`
`datatype`
`protected String`
`date`
`protected double`
`deltaX`
`protected int`
`endIndex`
`protected double`
`firstX`
`protected String`
`ident`
`protected double`
`lastX`
`protected String`
`longdate`
`protected String`
`model`
`protected String`
`molform`
`protected String`
`mp`
`protected Lst<Coordinate>`
`newXYCoords`
`protected int`
`npoints`
`protected double`
`obFreq`
`protected String`
`obNucleus`
`protected String`
`origin`
`protected OC`
`out`
`protected String`
`owner`
`protected String`
`pathlength`
`protected String`
`resolution`
`protected String`
`solvName`
`protected String`
`solvRef`
`protected String`
`spectypeInitials`
`protected int`
`startIndex`
`protected String`
`state`
`protected String`
`time`
`protected String`
`title`
`protected String`
`vendor`
`protected JSViewer`
`vwr`
`protected String`
`xUnitExponent`
`protected String`
`xUnitFactor`
`protected String`
`xUnitLabel`
`protected String`
`xUnits`
`protected Coordinate[]`
`xyCoords`
`protected String`
`yUnitLabel`
`protected String`
`yUnits`

## Constructor Summary

Constructors
Constructor
Description
`CMLExporter()`

## Method Summary

Modifier and Type
Method
Description
`String`
`exportTheSpectrum(JSViewer viewer, ExportType mode, OC out, Spectrum spec, int startIndex, int endIndex, PanelData pd, boolean asBase64)`
Exports the Spectrum that is displayed by JSVPanel to a file given by fileName If display is zoomed then export the current view
`protected void`
`initForm(JSViewer viewer, OC out)`
`protected void`
`setContext()`
`protected boolean`
`setParameters(Spectrum spec)`
`protected boolean`
`setup(JSViewer viewer, Spectrum spec, OC out, int startIndex, int endIndex)`
`protected String`
`writeForm(String templateFile)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### continuous

protected boolean continuous

### title

protected String title

### ident

protected String ident

### state

protected String state

### xUnits

protected String xUnits

### yUnits

protected String yUnits

### xUnitFactor

protected String xUnitFactor

### xUnitExponent

protected String xUnitExponent

### xUnitLabel

protected String xUnitLabel

### yUnitLabel

protected String yUnitLabel

### datatype

protected String datatype

### owner

protected String owner

### origin

protected String origin

### spectypeInitials

protected String spectypeInitials

### longdate

protected String longdate

### date

protected String date

### time

protected String time

### vendor

protected String vendor

### model

protected String model

### resolution

protected String resolution

### pathlength

protected String pathlength

### molform

protected String molform

### bp

protected String bp

### mp

protected String mp

### casRN

protected String casRN

### casName

protected String casName

### obNucleus

protected String obNucleus

### obFreq

protected double obFreq

### firstX

protected double firstX

### lastX

protected double lastX

### deltaX

protected double deltaX

### solvRef

protected String solvRef

### solvName

protected String solvName

### startIndex

protected int startIndex

### endIndex

protected int endIndex

### xyCoords

protected Coordinate[] xyCoords

### npoints

protected int npoints

### newXYCoords

protected Lst<Coordinate> newXYCoords

### out

protected OC out

### vwr

protected JSViewer vwr

## Constructor Details

### CMLExporter

public CMLExporter()

## Method Details

### exportTheSpectrum

public String exportTheSpectrum(JSViewer viewer, ExportType mode, OC out, Spectrum spec, int startIndex, int endIndex, PanelData pd, boolean asBase64) throws IOException
Exports the Spectrum that is displayed by JSVPanel to a file given by fileName If display is zoomed then export the current view

Parameters:
  `viewer` -
  `mode` - TODO
  `out` -
  `spec` - the spectrum to export
  `startIndex` - the starting point of the spectrum
  `endIndex` - the end point
  `pd` - only for SVG/SVGI
  `asBase64` - TODO
Returns:
  data if fileName is null
Throws:
  `IOException`

### setup

protected boolean setup(JSViewer viewer, Spectrum spec, OC out, int startIndex, int endIndex)

### setParameters

protected boolean setParameters(Spectrum spec)

### setContext

protected void setContext()

### initForm

protected void initForm(JSViewer viewer, OC out)

### writeForm

protected String writeForm(String templateFile) throws IOException

Throws:
  `IOException`