Package jspecview.common
Class Spectrum
java.lang.Object
jspecview.source.JDXHeader
jspecview.source.JDXDataObject
jspecview.common.Spectrum
JDXSpectrum implements the Interface Spectrum for the display of
JDX Files.- Author:
- Bob Hanson, Debbie-Ann Facey, Khari A. Bryan, Prof Robert J. Lancashire
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class jspecview.source.JDXHeader
JDXHeader.DataLDRTable -
Field Summary
FieldsFields inherited from class jspecview.source.JDXDataObject
blockID, ERROR, fileFirstX, fileLastX, fileNPoints, freq2dX, freq2dY, isSimulation, nucleusX, nucleusY, parent, REF_TYPE_BRUKER, REF_TYPE_STANDARD, REF_TYPE_UNSPECIFIED, REF_TYPE_VARIAN, sourceID, xFactor, xLabel, xUnits, xyCoords, y2DUnits, yFactor, yLabel, yUnits -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleaddSpecShift(double dx) booleanaddSubSpectrum(Spectrum spectrum, boolean forceSub) adds an nD subspectrum and titles it "Subspectrum" These spectra can be iterated over using the UP and DOWN keys. intadvanceSubSpectrum(int dir) static booleanallowSubSpec(Spectrum s1, Spectrum s2) static booleanareLinkableX(Spectrum s1, Spectrum s2) static booleanareLinkableY(Spectrum s1, Spectrum s2) static booleanareXScalesCompatible(Spectrum s1, Spectrum s2, boolean isSubspecCheck, boolean isLinkCheck) copy()specifically for Abs/Trans conversion.voiddispose()findPeakByCoord(int xPixel, Coordinate coord) doublefindXForPeakNearest(double x) getAssociatedPeakInfo(int xPixel, Coordinate coord) getAxisLabel(boolean isX) checks in order: (1) Peaks tag attribute xUnits/yUnits, then (2) ##XLABEL/##YLABEL, then (3) ##XUNITS/##YUNITSfloatdoublegetPercentYValueAt(double x) intdoubleReturns the array of coordinatesdoublegetYValueAt(double x) booleanbooleanbooleanmatchesPeakTypeModel(String type, String model) Find a matching spectrum by type (IR, 1HNMR,...) and model namestatic SpectrumnewSpectrum(Spectrum spectrum, Coordinate[] newXYCoords, String units) copy spectrum with new coordinatesstatic booleanprocess(Lst<Spectrum> specs, Spectrum.IRMode irMode) selectPeakByFileIndex(String filePath, String index, String atomKey) selectPeakByFilePathTypeModel(String filePath, String type, String model) voidsetConvertedSpectrum(Spectrum spectrum) intsetCurrentSubSpectrum(int n) voidsetExportXAxisDirection(boolean leftToRight) voidsetFillColor(GenericColor color) voidsetHighlightedPeak(PeakInfo peak) voidintsetNextPeak(Coordinate coord, int istep) intsetPeakList(Lst<PeakInfo> list, String peakXLabel, String peakYLabel) voidsetSelectedPeak(PeakInfo peak) voidsetSimulated(String filePath) voidsetUserYFactor(double userYFactor) Set by JSViewerstatic SpectrumtaConvert(Spectrum spectrum, Spectrum.IRMode mode) toString()Methods inherited from class jspecview.source.JDXDataObject
canConvertTransAbs, canIntegrate, canSaveAsJDX, canShowSolutionColor, checkJDXRequiredTokens, copyTo, getDefaultAnnotationInfo, getDefaultUnitPrecision, getDeltaX, getFilePath, getFilePathForwardSlash, getFirstX, getFirstY, getGyromagneticRatio, getHeaderRowDataAsArray, getHydrogenCount, getInlineData, getLastX, getLastY, getMaxX, getMaxY, getMinX, getMinY, getNominalSpecFreq, getNumDim, getObservedFreq, getObservedNucleus, getPeakListArray, getSpecFreq, getTypeLabel, getXFactor, getXUnits, getY2D, getY2DPPM, getYFactor, getYRef, getYUnits, invertYAxis, is1D, isAbsorbance, isAutoOverlayFromJmolClick, isContinuous, isGC, isHNMR, isHZtoPPM, isImaginary, isInverted, isMS, isNMR, isScalable, isStackable, isTransmittance, isXIncreasing, normalizeSimulation, setBlockID, setContinuous, setFilePath, setHydrogenCount, setHZtoPPM, setIncreasing, setInlineData, setMeasurementText, setNucleusAndFreq, setNumDim, setObservedFreq, setObservedNucleus, setVarName, setXFactor, setXLabel, setXUnits, setXYCoords, setY2D, setY2DUnits, setYFactor, setYLabel, setYUnits, shouldDisplayXAxisIncreasingMethods inherited from class jspecview.source.JDXHeader
getDataClass, getDataType, getDate, getHeaderRowDataAsArray, getHeaderTable, getJcampdx, getLongDate, getOrigin, getOwner, getQualifiedDataType, getTime, getTitle, setDataClass, setDataType, setDate, setHeaderTable, setJcampdx, setLongDate, setOrigin, setOwner, setTime, setTitle
-
Field Details
-
id
-
MAXABS
public static final double MAXABS- See Also:
-
-
Constructor Details
-
Spectrum
public Spectrum()Constructor
-
-
Method Details
-
dispose
public void dispose() -
isForcedSubset
public boolean isForcedSubset() -
setId
-
copy
specifically for Abs/Trans conversion. Note that we do NOT carry over piUnitsY- Returns:
- a copy of this
JDXSpectrum
-
getXYCoords
Returns the array of coordinates- Returns:
- the array of coordinates
-
getPeakList
-
setPeakList
-
selectPeakByFileIndex
-
selectPeakByFilePathTypeModel
-
matchesPeakTypeModel
Find a matching spectrum by type (IR, 1HNMR,...) and model name- Parameters:
type- if null, then model is a sourceID to matchmodel-- Returns:
- true for match
-
setSelectedPeak
-
setHighlightedPeak
-
getSelectedPeak
-
getModelPeakInfoForAutoSelectOnLoad
-
getAssociatedPeakInfo
-
findPeakByCoord
-
getPeakTitle
-
getTitleLabel
-
setNextPeak
-
getPercentYValueAt
public double getPercentYValueAt(double x) -
getYValueAt
public double getYValueAt(double x) -
setUserYFactor
public void setUserYFactor(double userYFactor) Set by JSViewer- Parameters:
userYFactor-
-
getUserYFactor
public double getUserYFactor() -
getConvertedSpectrum
-
setConvertedSpectrum
-
taConvert
-
newSpectrum
copy spectrum with new coordinates- Parameters:
spectrum-newXYCoords-units-- Returns:
- new spectrum
-
process
-
getSubSpectra
-
getCurrentSubSpectrum
-
advanceSubSpectrum
public int advanceSubSpectrum(int dir) -
setCurrentSubSpectrum
public int setCurrentSubSpectrum(int n) -
addSubSpectrum
adds an nD subspectrum and titles it "Subspectrum" These spectra can be iterated over using the UP and DOWN keys. - Parameters:
spectrum-forceSub-- Returns:
- true if was possible
-
getSubIndex
public int getSubIndex() -
setExportXAxisDirection
public void setExportXAxisDirection(boolean leftToRight) -
isExportXAxisLeftToRight
public boolean isExportXAxisLeftToRight() -
getInfo
-
findMatchingPeakInfo
-
getBasePeakInfo
-
getAxisLabel
checks in order: (1) Peaks tag attribute xUnits/yUnits, then (2) ##XLABEL/##YLABEL, then (3) ##XUNITS/##YUNITS- Parameters:
isX-- Returns:
- suitable label or ""
-
findXForPeakNearest
public double findXForPeakNearest(double x) -
addSpecShift
public double addSpecShift(double dx) -
allowSubSpec
-
areXScalesCompatible
-
areLinkableX
-
areLinkableY
-
getPeakWidth
public float getPeakWidth() -
setSimulated
-
setFillColor
-
toString
-