public 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.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
protected java.util.List |
dataPoints |
protected javax.swing.table.AbstractTableModel |
myTableModel |
protected java.lang.String[] |
planesArray
array of plane names that are also the column headers.
|
protected javax.swing.JScrollPane |
scrollPane |
protected javax.swing.JTable |
table |
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()
Creates a new instance of 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 |
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.
|
DataSetUpdateListener |
getAppendDataSetUpListener()
this adds all the points in the DataSet to the list.
|
QDataSet |
getBundleDataSet()
return ds[n,m] with n rows and m columns, where ds[:,0] is the x, ds[:,1]
is the y, and ds[:,2:] are the additional data.
|
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
|
QDataSet |
getSelectedDataPoints()
return the subset of the data points which are selected, as a rank 2 bundle.
|
QDataSet |
getSelectedDataSet()
returns a data set of the selected table data.
|
java.lang.String |
getTimeFormat()
Get the value of timeFormat
|
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) |
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 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 within the DatumRange.
|
void |
setActive(boolean active)
active=true means fire off events on any change.
|
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 |
setXTagWidth(Datum xTagWidth)
bins for the data, when xTagWidth is non-zero.
|
void |
update()
Notify listeners that the dataset has updated.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, updateadd, 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, validateTreeaction, 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, transferFocusUpCycleprotected javax.swing.JTable table
protected javax.swing.JScrollPane scrollPane
protected javax.swing.JButton updateButton
protected final java.util.List dataPoints
protected Units[] unitsArray
protected java.lang.String[] planesArray
protected javax.swing.table.AbstractTableModel myTableModel
public DataPointRecorder()
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(int[] selectedRows)
selectedRows - the rows, where zero is the first element..public QDataSet getDataSet()
getBundleDataSet()public QDataSet getDataPoints()
public QDataSet getSelectedDataPoints()
public QDataSet getBundleDataSet()
public QDataSet getSelectedDataSet()
which selects part of the dataset.public int select(DatumRange xrange, DatumRange yrange)
xrange - the range constraint (non-null).yrange - the range constraint (non-null).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 xrangepublic void saveToFile(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic void loadFromFile(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic void setActive(boolean active)
active - true means fire off events on any changepublic 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 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()
DataSetUpdateEventpublic void dataPointSelected(DataPointSelectionEvent e)
dataPointSelected in interface DataPointSelectionListenerpublic 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()