# Class ViewData

java.lang.Object
jspecview.common.ViewData

public class ViewData extends Object
Stores information that `GraphSet` needs to display a view with one or more spectra.

## Constructor Summary

Constructors
Constructor
Description
`ViewData(Lst<Spectrum> spectra, double yPt1, double yPt2, boolean isContinuous)`
`ViewData(Lst<Spectrum> spectra, double yPt1, double yPt2, int[] startList, int[] endList, boolean isContinuous, boolean is2D)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`areYScalesSame(int i, int j)`
`int`
`getEndingPointIndex(int i)`
in some cases, there is only one scaleData, but there are more than that number of spectra this is no problem -- we just use mod to set this to 0
`ScaleData[]`
`getNewScales(int iSelected, boolean isXOnly, double y1, double y2)`
`ScaleData`
`getScale()`
`ScaleData[]`
`getScaleData()`
`int`
`getStartingPointIndex(int i)`
in some cases, there is only one scaleData, but there are more than that number of spectra this is no problem -- we just use mod to set this to 0
`void`
`newSpectrum(Lst<Spectrum> spectra)`
`void`
`resetScaleFactors()`
`void`
`scaleSpectrum(int i, double f)`
`void`
`setScale(int i, int xPixels, int yPixels, boolean isInverted)`
`void`
`setXRangeForSubSpectrum(Coordinate[] xyCoords)`

### Methods inherited from class Object

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

## Constructor Details

### ViewData

public ViewData(Lst<Spectrum> spectra, double yPt1, double yPt2, int[] startList, int[] endList, boolean isContinuous, boolean is2D)

Parameters:
  `spectra` - an array of spectra
  `yPt1` -
  `yPt2` -
  `startList` - the start indices
  `endList` - the end indices
  `isContinuous` -
  `is2D` -

### ViewData

public ViewData(Lst<Spectrum> spectra, double yPt1, double yPt2, boolean isContinuous)

## Method Details

### getScaleData

public ScaleData[] getScaleData()

### getScale

public ScaleData getScale()

### newSpectrum

public void newSpectrum(Lst<Spectrum> spectra)

### setXRangeForSubSpectrum

public void setXRangeForSubSpectrum(Coordinate[] xyCoords)

### getStartingPointIndex

public int getStartingPointIndex(int i)
in some cases, there is only one scaleData, but there are more than that number of spectra this is no problem -- we just use mod to set this to 0

Parameters:
  `i` -
Returns:
  starting point data index

### getEndingPointIndex

public int getEndingPointIndex(int i)
in some cases, there is only one scaleData, but there are more than that number of spectra this is no problem -- we just use mod to set this to 0

Parameters:
  `i` -
Returns:
  ending point data index

### areYScalesSame

public boolean areYScalesSame(int i, int j)

### setScale

public void setScale(int i, int xPixels, int yPixels, boolean isInverted)

### resetScaleFactors

public void resetScaleFactors()

### scaleSpectrum

public void scaleSpectrum(int i, double f)

### getNewScales

public ScaleData[] getNewScales(int iSelected, boolean isXOnly, double y1, double y2)