Class JDXDataObject

java.lang.Object
jspecview.source.JDXHeader
jspecview.source.JDXDataObject
Direct Known Subclasses:
Spectrum

public abstract class JDXDataObject extends JDXHeader
spectrum data AS READ FROM FILE
Author:
Bob Hanson
  • Field Details

    • ERROR

      public static final double ERROR
      Error number that is returned when a min value is undefined
      See Also:
    • REF_TYPE_UNSPECIFIED

      public static final int REF_TYPE_UNSPECIFIED
      See Also:
    • REF_TYPE_STANDARD

      public static final int REF_TYPE_STANDARD
      See Also:
    • REF_TYPE_BRUKER

      public static final int REF_TYPE_BRUKER
      See Also:
    • REF_TYPE_VARIAN

      public static final int REF_TYPE_VARIAN
      See Also:
    • sourceID

      public String sourceID
    • isSimulation

      public boolean isSimulation
    • blockID

      protected double blockID
    • xyCoords

      public Coordinate[] xyCoords
      array of x,y coordinates
    • fileFirstX

      public double fileFirstX
      JDXReader only
    • fileLastX

      public double fileLastX
      JDXReader only
    • fileNPoints

      public int fileNPoints
      JDXReader only
    • xFactor

      public double xFactor
      Also used in JDXExport
    • yFactor

      public double yFactor
      Also used in JDXExport
    • nucleusX

      public String nucleusX
    • nucleusY

      public String nucleusY
    • freq2dX

      public double freq2dX
    • freq2dY

      public double freq2dY
    • y2DUnits

      public String y2DUnits
    • parent

      protected Spectrum parent
    • xUnits

      protected String xUnits
    • yUnits

      protected String yUnits
    • xLabel

      protected String xLabel
    • yLabel

      protected String yLabel
  • Constructor Details

    • JDXDataObject

      public JDXDataObject()
  • Method Details

    • setInlineData

      public void setInlineData(String data)
    • getInlineData

      public String getInlineData()
    • setFilePath

      public void setFilePath(String filePath)
    • getFilePath

      public String getFilePath()
      The path to the file
      Returns:
      path to file or [inline] (if loaded inline)
    • getFilePathForwardSlash

      public String getFilePathForwardSlash()
    • setBlockID

      public void setBlockID(double id)
    • checkJDXRequiredTokens

      public void checkJDXRequiredTokens() throws JSVException
      for JDXReader only
      Throws:
      JSVException
    • setXFactor

      public void setXFactor(double xFactor)
      Sets the original xfactor, from JDXReader and XMLReader
      Parameters:
      xFactor - the x factor
    • getXFactor

      public double getXFactor()
      Returns the original x factor
      Returns:
      the original x factor
    • setYFactor

      public void setYFactor(double yFactor)
      Sets the original y factor, from JDXReader and XMLReader
      Parameters:
      yFactor - the y factor
    • getYFactor

      public double getYFactor()
      Returns the original y factor
      Returns:
      the original y factor
    • setVarName

      public void setVarName(String name)
      From ##VARNAME
      Parameters:
      name -
    • isImaginary

      public boolean isImaginary()
    • setXUnits

      public void setXUnits(String xUnits)
      Sets the units for the x axis
      Parameters:
      xUnits - the x units
    • getXUnits

      public String getXUnits()
      Returns the units for x-axis when spectrum is displayed
      Returns:
      the units for x-axis when spectrum is displayed
    • setYUnits

      public void setYUnits(String yUnits)
      Sets the units for the y axis
      Parameters:
      yUnits - the y units
    • getYUnits

      public String getYUnits()
      Returns the units for y-axis when spectrum is displayed
      Returns:
      the units for y-axis when spectrum is displayed
    • setXLabel

      public void setXLabel(String value)
    • setYLabel

      public void setYLabel(String value)
    • setObservedNucleus

      public void setObservedNucleus(String value)
    • getObservedNucleus

      public String getObservedNucleus()
      ^1H, ^13C, for example
      Returns:
      observedNucl
    • setObservedFreq

      public void setObservedFreq(double observedFreq)
      Sets the Observed Frequency (for NMR Spectra)
      Parameters:
      observedFreq - the observed frequency
    • getObservedFreq

      public double getObservedFreq()
      Returns the observed frequency (for NMR Spectra)
      Returns:
      the observed frequency (for NMR Spectra)
    • setHydrogenCount

      public void setHydrogenCount(int nH)
    • getHydrogenCount

      public int getHydrogenCount()
    • is1D

      public boolean is1D()
    • getNumDim

      public int getNumDim()
    • setNumDim

      public void setNumDim(int n)
    • setY2D

      public void setY2D(double d)
    • getY2D

      public double getY2D()
    • setY2DUnits

      public void setY2DUnits(String units)
    • getY2DPPM

      public double getY2DPPM()
    • setNucleusAndFreq

      public void setNucleusAndFreq(String nuc, boolean isX)
    • getNominalSpecFreq

      public static int getNominalSpecFreq(String nuc, double freq)
    • getGyromagneticRatio

      public static double getGyromagneticRatio(String nuc)
    • isTransmittance

      public boolean isTransmittance()
    • isAbsorbance

      public boolean isAbsorbance()
    • canSaveAsJDX

      public boolean canSaveAsJDX()
    • canIntegrate

      public boolean canIntegrate()
    • isAutoOverlayFromJmolClick

      public boolean isAutoOverlayFromJmolClick()
    • isGC

      public boolean isGC()
    • isMS

      public boolean isMS()
    • isStackable

      public boolean isStackable()
    • isScalable

      public boolean isScalable()
    • getYRef

      public double getYRef()
    • isInverted

      public boolean isInverted()
    • canConvertTransAbs

      public boolean canConvertTransAbs()
    • canShowSolutionColor

      public boolean canShowSolutionColor()
    • isHZtoPPM

      public boolean isHZtoPPM()
      Determines if the spectrum should be displayed with abscissa unit of Part Per Million (PPM) instead of Hertz (HZ)
      Returns:
      true if abscissa unit should be PPM
    • setHZtoPPM

      public void setHZtoPPM(boolean val)
      Sets the value to true if the spectrum should be displayed with abscissa unit of Part Per Million (PPM) instead of Hertz (HZ)
      Parameters:
      val - true or false
    • setIncreasing

      public void setIncreasing(boolean val)
      Sets value to true if spectrum is increasing
      Parameters:
      val - true if spectrum is increasing
    • isXIncreasing

      public boolean isXIncreasing()
      Returns true if the spectrum is increasing; used by SVGExporter only
      Returns:
      true if the spectrum is increasing
    • shouldDisplayXAxisIncreasing

      public boolean shouldDisplayXAxisIncreasing()
      Determines if the plot should be displayed decreasing by default
      Returns:
      true or false
    • setContinuous

      public void setContinuous(boolean val)
      Sets value to true if spectrum is continuous
      Parameters:
      val - true if spectrum is continuous
    • isContinuous

      public boolean isContinuous()
      Returns true if spectrum is continuous
      Returns:
      true if spectrum is continuous
    • getHeaderRowDataAsArray

      public String[][] getHeaderRowDataAsArray()
    • getDefaultUnitPrecision

      public int getDefaultUnitPrecision()
    • setMeasurementText

      public String setMeasurementText(Measurement m)
    • isNMR

      public boolean isNMR()
    • isHNMR

      public boolean isHNMR()
      Determines if a spectrum is an HNMR spectrum
      Returns:
      true if an HNMR, false otherwise
    • setXYCoords

      public void setXYCoords(Coordinate[] coords)
      Sets the array of coordinates
      Parameters:
      coords - the array of Coordinates
    • invertYAxis

      public JDXDataObject invertYAxis()
    • getFirstX

      public double getFirstX()
      Returns the first X value
      Returns:
      the first X value
    • getFirstY

      public double getFirstY()
      Returns the first Y value
      Returns:
      the first Y value
    • getLastX

      public double getLastX()
      Returns the last X value
      Returns:
      the last X value
    • getLastY

      public double getLastY()
      Returns the last Y value
      Returns:
      the last Y value
    • getMinX

      public double getMinX()
      Calculates and returns the minimum x value in the list of coordinates Fairly expensive operation
      Returns:
      the minimum x value in the list of coordinates
    • getMinY

      public double getMinY()
      Calculates and returns the minimum y value in the list of coordinates Fairly expensive operation
      Returns:
      the minimum x value in the list of coordinates
    • getMaxX

      public double getMaxX()
      Calculates and returns the maximum x value in the list of coordinates Fairly expensive operation
      Returns:
      the maximum x value in the list of coordinates
    • getMaxY

      public double getMaxY()
      Calculates and returns the maximum y value in the list of coordinates Fairly expensive operation
      Returns:
      the maximum y value in the list of coordinates
    • normalizeSimulation

      public void normalizeSimulation(double max)
    • getDeltaX

      public double getDeltaX()
      Returns the delta X
      Returns:
      the delta X
    • copyTo

      public void copyTo(JDXDataObject newObj)
    • getTypeLabel

      public String getTypeLabel()
    • getDefaultAnnotationInfo

      public Object[] getDefaultAnnotationInfo(Annotation.AType type)
    • getPeakListArray

      public double[] getPeakListArray(Measurement m, double[] last, double maxY)