## org.das2.components.DataPointRecorder

DataPointRecorder is a GUI for storing data points selected by the user. The columns are set dynamically as the data arrives (via addDataPoint). This replaces DataPointRecorderNew. (DataPointRecorderNew replaced an older DataPointerRecorder whose name has been reclaimed.)

## DataPointRecorder( )

create a DataPointRecorder which will collect data such that X values are sorted and unique.

## DataPointRecorder( boolean sorted )

create a DataPointRecorder. When sorted is true, the data point recorder will only allow one point per X value, and the data will be sorted as it is collected. When it is false, the data will be stored in the order it arrives.

## addAccessory

addAccessory( javax.swing.JComponent c ) → void

add a small component to the lower-right portion of the DataPointRecorder. It should be roughly the size of a button.

### Parameters

c - the component.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addDataPoint

addDataPoint( QDataSet ds ) → void

add a record, which should be a rank 1 bundle.

### Parameters

ds - a QDataSet

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addDataPoint

addDataPoint( Datum x, Datum y ) → void

add just the x and y values.

### Parameters

x - the x position
y - the y position

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addDataPoint

addDataPoint( double x, double y ) → void

add just the x and y values.

### Parameters

x - the x position
y - the y position

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addDataPoint

addDataPoint( double x, double y, java.util.Map planes ) → void

add just the x and y values.

### Parameters

x - the x position
y - the y position
planes - additional planes, map from String name → String, Datum, or Number.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addDataPoint

addDataPoint( Datum x, Datum y, Object meta ) → void

add the x and y values with unnamed metadata.

### Parameters

x - the x position
y - the y position
meta - any metadata (String, Double, etc ) to be recorded along with the data point.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addDataPoint

addDataPoint( Datum x, Datum y, java.util.Map planes ) → void

add the data point, along with metadata such as the key press.

### Parameters

x - the x position
y - the y position
planes - additional planes, map from String name → String, Datum, or Number.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addDataPointSelectionListener

addDataPointSelectionListener( org.das2.event.DataPointSelectionListener listener ) → void

Registers DataPointSelectionListener to receive events.

### Parameters

listener - The listener to register.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addDataPoints

addDataPoints( QDataSet ds ) → void

append the rank 2 data. The data should be rank 2, without DEPEND_0. Note earlier versions of this code assumed there would be a DEPEND_0.

### Parameters

ds - rank 2 bundle dataset.

### Returns:

void (returns nothing)

### See Also:

addDataPoint(QDataSet)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addDataSetUpdateListener

addDataSetUpdateListener( org.das2.dataset.DataSetUpdateListener listener ) → void

### Parameters

listener - a DataSetUpdateListener

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## addSelectedDataSetUpdateListener

addSelectedDataSetUpdateListener( org.das2.dataset.DataSetUpdateListener listener ) → void

### Parameters

listener - a DataSetUpdateListener

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## appendDataSet

Deprecated: see #addDataPoints, which does not use DEPEND_0. appendDataSet( org.das2.dataset.VectorDataSet ds ) → void [view source]

## createFramed

createFramed( ) → org.das2.components.DataPointRecorder

### Returns:

org.das2.components.DataPointRecorder
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## dataPointSelected

dataPointSelected( org.das2.event.DataPointSelectionEvent e ) → void

### Parameters

e - a DataPointSelectionEvent

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## deleteAllRows

deleteAllRows( ) → void

delete all rows, clearing the component and firing off update event.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## deleteInterval

deleteInterval( DatumRange range ) → void

delete all the points within the interval. This was introduced to support the case where we are going to reprocess an interval, as with the RBSP digitizer.

### Parameters

range - range to delete, end time is exclusive.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## deleteRow

deleteRow( int row ) → void

delete the specified row.

### Parameters

row - the row, where zero is the first element.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## deleteRows

deleteRows( java.util.List selectRows ) → void

convenient method to match getSelected.

### Parameters

selectRows - a java.util.List

### Returns:

void (returns nothing)

### See Also:

deleteRows(int[])
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## deleteRows

deleteRows( int[] selectedRows ) → void

delete the specified rows.

### Parameters

selectedRows - the rows, where zero is the first element..

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getAppendDataSetUpListener

getAppendDataSetUpListener( ) → org.das2.dataset.DataSetUpdateListener

this adds all the points in the DataSet to the list. This will also check the dataset for the special property "comment" and add it as a comment.

### Returns:

the listener to receive data set updates

### See Also:

org.das2.dataset.DataSetUpdateEvent
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getBundleDataSet

Deprecated: use getDataPoints.

## getCurrentFile

getCurrentFile( ) → java.io.File

shows the current name for the file.

### Returns:

the current name for the file.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getDataPoints

getDataPoints( ) → QDataSet

returns a entire set of data points as a rank 2 bundle. This is the same as getBundleDataSet, and just calls it.

### Returns:

rank 2 bundle

### See Also:

getSelectedDataPoints() which returns the selected records.
getBundleDataSet() which is the old name for this routine.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getDataSet

Deprecated: see #getDataPoints

## getFeedbackPainter

getFeedbackPainter( org.das2.graph.DasPlot p ) → org.das2.graph.Painter

convenient method returns a painter which will draw the first two columns over/under a plot.

### Parameters

p - the plot

### Returns:

the Painter, which uses the plot's x axis and y axis.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getSelected

getSelected( ) → java.util.List

return the array of selected indices.

### Returns:

the array of selected indices.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getSelectedDataPoints

getSelectedDataPoints( ) → QDataSet

return the subset of the data points which are selected, as a rank 2 bundle.

### Returns:

rank 2 dataset

### See Also:

getSelectedDataSet() which returns the selection in a different form
getDataPoints() which returns all points.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getSelectedDataSet

Deprecated: getSelectedDataPoints returns data as a simple bundle of x,y,...

## getTimeFormat

getTimeFormat( ) → String

Get the value of timeFormat

### Returns:

the value of timeFormat
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getXTagWidth

getXTagWidth( ) → Datum

Getter for property xTagWidth. When xTagWidth is zero, this implies there is no binning.

### Returns:

Value of property xTagWidth.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getXname

getXname( ) → String

return the x column name

### Returns:

a String
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## isModified

isModified( ) → boolean

return true when the data point recorder has been modified.

### Returns:

true when the data point recorder has been modified.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## isSnapToGrid

isSnapToGrid( ) → boolean

Getter for property snapToGrid.

### Returns:

Value of property snapToGrid.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## isSorted

isSorted( ) → boolean

Getter for property sorted.

### Returns:

Value of property sorted.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## loadFromFile

loadFromFile( java.io.File file ) → void

load the file into the digitizer. Columns will be created for the each column of the file. This should be able to read files created by the DataPointRecorder. Here's an example of a file which works:

     # Generated by Autoplot on Tue Nov 24 14:53:25 CST 2020
     x(UTC), y(Hz), BMag(nT), Fce(nT), Fci(nT), Fpe(nT), Fpe_Fce, Fuhr(Hz), Flhr(nT), F_L0(Hz), F_R0(Hz), N_e(cm!a-3!n), markedType, visualFeature, qualityIndex, comment
     2017-03-27T09:30:22.378Z, 3466.8, 1.72870E5, 4.84030E6, 2636.3, 96486.0, 0.019934, 4.84120E6, 3466.8, 4558.9, 4.84220E6, 115.44, Flhr, peak, f, v20200213x
     2017-03-27T09:30:23.634Z, 3515.6, 1.72730E5, 4.83650E6, 2634.3, 99779.0, 0.02063, 4.83750E6, 3515.6, 4691.9, 4.83860E6, 123.46, Flhr, peak, f, v20200213x
     2017-03-27T09:30:24.889Z, 3515.6, 1.72620E5, 4.83340E6, 2632.5, 99862.0, 0.020661, 4.83440E6, 3515.6, 4694.9, 4.83540E6, 123.67, Flhr, peak, f, v20200213

### Parameters

file - a File

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## removeDataPointSelectionListener

removeDataPointSelectionListener( org.das2.event.DataPointSelectionListener listener ) → void

Removes DataPointSelectionListener from the list of listeners.

### Parameters

listener - The listener to remove.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## removeDataSetUpdateListener

removeDataSetUpdateListener( org.das2.dataset.DataSetUpdateListener listener ) → void

### Parameters

listener - a DataSetUpdateListener

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## removeSelectedDataSetUpdateListener

removeSelectedDataSetUpdateListener( org.das2.dataset.DataSetUpdateListener listener ) → void

### Parameters

listener - a DataSetUpdateListener

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## save

save( ) → boolean

### Returns:

boolean
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## saveAs

saveAs( ) → boolean

return true if the file was saved, false if cancel

### Returns:

true if the file was saved, false if cancel
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## saveBeforeExit

saveBeforeExit( ) → boolean

return true if the file was saved or "don't save" was pressed by the user.

### Returns:

true if the file was saved or "don't save" was pressed by the user.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## saveToFile

saveToFile( java.io.File file ) → void

### Parameters

file - a File

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## select

select( DatumRange xrange, DatumRange yrange ) → int

Selects all the points in the GUI where the first column is within xrange and the second column is within yrange. Returns the first of the selected indices, or -1 if no elements are found.

### Parameters

xrange - the range constraint (non-null).
yrange - the range constraint or null if no constraint.

### Returns:

the first of the selected indices, or -1 if no elements are found.

### See Also:

getSelectedDataSet()
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## select

select( DatumRange xrange, DatumRange yrange, boolean xOrY ) → int

Selects all the points in the GUI where the first column is within xrange and the second column is within yrange. Returns the first of the selected indices, or -1 if no elements are found.

### Parameters

xrange - the x range
yrange - the y range or null if no constraint
xOrY - if true, then match if either yrange or xrange contains.

### Returns:

the first of the selected indices, or -1 if no elements are found.

### See Also:

getSelectedDataSet()
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## select

select( java.util.List selection ) → void

Selects the points in the GUI specified, using indices in the model, where 0 is the first index.

### Parameters

selection - a java.util.List

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setActive

setActive( boolean active ) → void

active=true means fire off events on any change. false= wait for update button.

### Parameters

active - true means fire off events on any change

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setColumn

setColumn( int i, String name, Units units, Datum deft ) → void

identify the name and unit for each column.

### Parameters

i - the column number
name - a Java identifier for the column, e.g. "StartTime"
units - units for the column, or null for dimensionless.
deft - default value to use when data is not provided.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setColumnCount

setColumnCount( int count ) → void

explicitly declare the number of columns. Call this and then setColumn to define each column.

### Parameters

count - the number of columns.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setSnapToGrid

setSnapToGrid( boolean snapToGrid ) → void

Setter for property snapToGrid. true indicates the xtag will be reset so that the tags are equally spaced, each xTagWidth apart.

### Parameters

snapToGrid - New value of property snapToGrid.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setSorted

setSorted( boolean sorted ) → void

Setter for property sorted.

### Parameters

sorted - New value of property sorted.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setTimeFormat

setTimeFormat( String timeFormat ) → void

Set the value of timeFormat

### Parameters

timeFormat - new value of timeFormat

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setXTagWidth

setXTagWidth( Datum xTagWidth ) → void

bins for the data, when xTagWidth is non-zero.

### Parameters

xTagWidth - New value of property xTagWidth.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setXname

setXname( String name ) → void

set the x column name

### Parameters

name - a legal column name

### Returns:

void (returns nothing)

### See Also:

Ops#safeName(java.lang.String)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setYname

setYname( String name ) → void

set the y column name

### Parameters

name - a legal column name

### Returns:

void (returns nothing)

### See Also:

Ops#safeName(java.lang.String)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## setYname

setYname( ) → String

return the y column name

### Returns:

a String
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## update

update( ) → void

Notify listeners that the dataset has updated. Pressing the "Update" button calls this.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]