public final class DataPointRecorder extends javax.swing.JPanel implements DataPointSelectionListener
Modifier and Type | Class and Description |
---|---|
static class |
DataPointRecorder.DataPoint
Note this is all pre-QDataSet.
|
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.util.List |
dataPoints |
protected Datum[] |
defaultsArray
value to use when the dataset input does not contain the bundled dataset (plane).
|
protected DatumFormatter[] |
formatterArray
the datumFormatter to use for each column.
|
protected javax.swing.table.AbstractTableModel |
myTableModel |
protected java.lang.String[] |
namesArray
array of plane names that are also the column headers.
|
protected javax.swing.JScrollPane |
scrollPane |
protected javax.swing.JTable |
table |
protected TimeParser |
timeFormatter |
protected Units[] |
unitsArray
units[index]==null if HashMap contains non-datum object.
|
protected javax.swing.JButton |
updateButton |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DataPointRecorder()
create a DataPointRecorder which will collect data such that X
values are sorted and unique.
|
DataPointRecorder(boolean sorted)
create a DataPointRecorder.
|
Modifier and Type | Method and Description |
---|---|
void |
addAccessory(javax.swing.JComponent c)
add a small component to the lower-right portion of the DataPointRecorder.
|
void |
addDataPoint(Datum x,
Datum y)
add just the x and y values.
|
void |
addDataPoint(Datum x,
Datum y,
java.util.Map planes)
add the data point, along with metadata such as the key press.
|
void |
addDataPoint(Datum x,
Datum y,
java.lang.Object meta)
add the x and y values with unnamed metadata.
|
void |
addDataPoint(double x,
double y)
add just the x and y values.
|
void |
addDataPoint(double x,
double y,
java.util.Map planes)
add just the x and y values.
|
void |
addDataPoint(QDataSet ds)
add a record, which should be a rank 1 bundle.
|
void |
addDataPoints(QDataSet ds)
append the rank 2 data.
|
void |
addDataPointSelectionListener(DataPointSelectionListener listener)
Registers DataPointSelectionListener to receive events.
|
void |
addDataSetUpdateListener(DataSetUpdateListener listener) |
void |
addSelectedDataSetUpdateListener(DataSetUpdateListener listener) |
void |
appendDataSet(QDataSet ds)
Deprecated.
see #addDataPoints, which does not use DEPEND_0.
|
void |
appendDataSet(VectorDataSet ds)
Deprecated.
uses old data model, use appendDataSet(QDataSet)
|
static DataPointRecorder |
createFramed() |
void |
dataPointSelected(DataPointSelectionEvent e) |
void |
deleteAllRows()
delete all rows, clearing the component and firing off update event.
|
void |
deleteInterval(DatumRange range)
delete all the points within the interval.
|
void |
deleteRow(int row)
delete the specified row.
|
void |
deleteRows(int[] selectedRows)
delete the specified rows.
|
void |
deleteRows(java.util.List<java.lang.Integer> selectRows)
convenient method to match getSelected.
|
DataSetUpdateListener |
getAppendDataSetUpListener()
this adds all the points in the DataSet to the list.
|
QDataSet |
getBundleDataSet()
Deprecated.
use getDataPoints.
|
java.io.File |
getCurrentFile()
shows the current name for the file.
|
QDataSet |
getDataPoints()
returns a entire set of data points as a rank 2 bundle.
|
QDataSet |
getDataSet()
Deprecated.
see #getDataPoints
|
Painter |
getFeedbackPainter(DasPlot p)
convenient method returns a painter which will draw the first two columns over/under a plot.
|
java.util.List<java.lang.Integer> |
getSelected()
return the array of selected indices.
|
QDataSet |
getSelectedDataPoints()
return the subset of the data points which are selected, as a rank 2 bundle.
|
QDataSet |
getSelectedDataSet()
Deprecated.
getSelectedDataPoints returns data as a simple bundle of x,y,...
|
java.lang.String |
getTimeFormat()
Get the value of timeFormat
|
java.lang.String |
getXname()
return the x column name
|
Datum |
getXTagWidth()
Getter for property xTagWidth.
|
boolean |
isModified()
return true when the data point recorder has been modified.
|
boolean |
isSnapToGrid()
Getter for property snapToGrid.
|
boolean |
isSorted()
Getter for property sorted.
|
void |
loadFromFile(java.io.File file)
load the file into the digitizer.
|
void |
removeDataPointSelectionListener(DataPointSelectionListener listener)
Removes DataPointSelectionListener from the list of listeners.
|
void |
removeDataSetUpdateListener(DataSetUpdateListener listener) |
void |
removeSelectedDataSetUpdateListener(DataSetUpdateListener listener) |
boolean |
save() |
boolean |
saveAs()
return true if the file was saved, false if cancel
|
boolean |
saveBeforeExit()
return true if the file was saved or "don't save" was pressed by the user.
|
void |
saveToFile(java.io.File file) |
int |
select(DatumRange xrange,
DatumRange yrange)
Selects all the points in the GUI where the first column is within xrange and
the second column is within yrange.
|
int |
select(DatumRange xrange,
DatumRange yrange,
boolean xOrY)
Selects all the points in the GUI where the first column is within xrange and
the second column is within yrange.
|
void |
select(java.util.List<java.lang.Integer> selection)
Selects the points in the GUI specified, using indices in the model,
where 0 is the first index.
|
void |
setActive(boolean active)
active=true means fire off events on any change.
|
void |
setColumn(int i,
java.lang.String name,
Units units,
Datum deft)
identify the name and unit for each column.
|
void |
setColumnCount(int count)
explicitly declare the number of columns.
|
void |
setSnapToGrid(boolean snapToGrid)
Setter for property snapToGrid.
|
void |
setSorted(boolean sorted)
Setter for property sorted.
|
void |
setTimeFormat(java.lang.String timeFormat)
Set the value of timeFormat
|
void |
setXname(java.lang.String name)
set the x column name
|
void |
setXTagWidth(Datum xTagWidth)
bins for the data, when xTagWidth is non-zero.
|
java.lang.String |
setYname()
return the y column name
|
void |
setYname(java.lang.String name)
set the y column name
|
void |
update()
Notify listeners that the dataset has updated.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected javax.swing.JTable table
protected javax.swing.JScrollPane scrollPane
protected javax.swing.JButton updateButton
protected final java.util.List dataPoints
protected Units[] unitsArray
protected DatumFormatter[] formatterArray
protected java.lang.String[] namesArray
protected Datum[] defaultsArray
protected javax.swing.table.AbstractTableModel myTableModel
protected TimeParser timeFormatter
public DataPointRecorder()
public DataPointRecorder(boolean sorted)
sorted
- true if X values should be unique and ordered.public void deleteInterval(DatumRange range)
range
- range to delete, end time is exclusive.public void deleteRow(int row)
row
- the row, where zero is the first element.public void deleteRows(java.util.List<java.lang.Integer> selectRows)
selectRows
- deleteRows(int[])
public void deleteRows(int[] selectedRows)
selectedRows
- the rows, where zero is the first element..public void deleteAllRows()
public QDataSet getDataSet()
getBundleDataSet()
public QDataSet getDataPoints()
which returns the selected records.
,
which is the old name for this routine.
public java.util.List<java.lang.Integer> getSelected()
public QDataSet getSelectedDataPoints()
which returns the selection in a different form
,
which returns all points.
public QDataSet getBundleDataSet()
which just makes this call name more consistent.
public QDataSet getSelectedDataSet()
which selects part of the dataset.
,
which returns a bundle dataset for the selected points.
public int select(DatumRange xrange, DatumRange yrange)
xrange
- the range constraint (non-null).yrange
- the range constraint or null if no constraint.getSelectedDataSet()
public int select(DatumRange xrange, DatumRange yrange, boolean xOrY)
xrange
- the x rangeyrange
- the y range or null if no constraintxOrY
- if true, then match if either yrange or xrange contains.getSelectedDataSet()
public void select(java.util.List<java.lang.Integer> selection)
selection
- public void setColumnCount(int count)
count
- the number of columns.public void setColumn(int i, java.lang.String name, Units units, Datum deft)
i
- the column numbername
- 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.public void saveToFile(java.io.File file) throws java.io.IOException
java.io.IOException
public void loadFromFile(java.io.File file) throws java.io.IOException
# 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
file
- java.io.IOException
public void setActive(boolean active)
active
- true means fire off events on any changepublic Painter getFeedbackPainter(DasPlot p)
p
- the plotpublic boolean saveAs()
public boolean save()
public java.io.File getCurrentFile()
public boolean saveBeforeExit()
public void update()
public static DataPointRecorder createFramed()
public void addAccessory(javax.swing.JComponent c)
c
- the component.public void setXname(java.lang.String name)
name
- a legal column nameOps.safeName(java.lang.String)
public void setYname(java.lang.String name)
name
- a legal column nameOps.safeName(java.lang.String)
public java.lang.String getXname()
public java.lang.String setYname()
public void addDataPoint(QDataSet ds)
ds
- public void addDataPoint(Datum x, Datum y)
x
- the x positiony
- the y positionpublic void addDataPoint(double x, double y)
x
- the x positiony
- the y positionpublic void addDataPoint(double x, double y, java.util.Map planes)
x
- the x positiony
- the y positionplanes
- additional planes, map from String name → String, Datum, or Number.public void addDataPoint(Datum x, Datum y, java.lang.Object meta)
x
- the x positiony
- the y positionmeta
- any metadata (String, Double, etc ) to be recorded along with the data point.public void addDataPoint(Datum x, Datum y, java.util.Map planes)
x
- the x positiony
- the y positionplanes
- additional planes, map from String name → String, Datum, or Number.java.lang.RuntimeException
- when the units are not convertible.public void appendDataSet(QDataSet ds)
ds
- addDataPoints(org.das2.qds.QDataSet)
public void addDataPoints(QDataSet ds)
ds
- rank 2 bundle dataset.addDataPoint(org.das2.qds.QDataSet)
public void appendDataSet(VectorDataSet ds)
ds
- public DataSetUpdateListener getAppendDataSetUpListener()
DataSetUpdateEvent
public void dataPointSelected(DataPointSelectionEvent e)
dataPointSelected
in interface DataPointSelectionListener
public void addDataSetUpdateListener(DataSetUpdateListener listener)
public void removeDataSetUpdateListener(DataSetUpdateListener listener)
public void addSelectedDataSetUpdateListener(DataSetUpdateListener listener)
public void removeSelectedDataSetUpdateListener(DataSetUpdateListener listener)
public boolean isSorted()
public void setSorted(boolean sorted)
sorted
- New value of property sorted.public void addDataPointSelectionListener(DataPointSelectionListener listener)
listener
- The listener to register.public void removeDataPointSelectionListener(DataPointSelectionListener listener)
listener
- The listener to remove.public Datum getXTagWidth()
public void setXTagWidth(Datum xTagWidth)
xTagWidth
- New value of property xTagWidth.public boolean isSnapToGrid()
public void setSnapToGrid(boolean snapToGrid)
snapToGrid
- New value of property snapToGrid.public java.lang.String getTimeFormat()
public void setTimeFormat(java.lang.String timeFormat)
timeFormat
- new value of timeFormatpublic boolean isModified()