public class DataToolTable extends DataTable
| Modifier and Type | Class | Description |
|---|---|---|
protected static class |
DataToolTable.DataToolTableModel |
A table model for this table.
|
protected class |
DataToolTable.TableEdit |
A class to undo/redo datatable edits.
|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategyjava.awt.Container.AccessibleAWTContainerDataTable.DefaultDataTableModel, DataTable.DoubleRenderer, DataTable.NumberFormatDialog, DataTable.PrecisionRenderer, DataTable.RowNumberRenderer, DataTable.UnitRenderer| Modifier and Type | Field | Description |
|---|---|---|
protected static int |
DELETE_CELLS_EDIT |
|
protected static int |
DELETE_COLUMN_EDIT |
|
protected static int |
DELETE_ROWS_EDIT |
|
protected static java.lang.String[] |
editTypes |
|
protected static int |
INSERT_CELLS_EDIT |
|
protected static int |
INSERT_COLUMN_EDIT |
|
protected static int |
INSERT_ROWS_EDIT |
|
protected static int |
RENAME_COLUMN_EDIT |
|
protected static int |
REPLACE_CELLS_EDIT |
|
protected static java.awt.Color |
xAxisColor |
|
protected static java.awt.Color |
yAxisColor |
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTclickCountToSort, formatDialog, labelColumnWidth, minimumDataColumnWidth, precisionRenderersByColumnName, rowName, rowNumberRenderer, unitRenderersByColumnNameABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWAUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader| Constructor | Description |
|---|---|
DataToolTable(DataToolTab tab) |
Constructs a DataToolTable for the specified DataTooltab.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
clearSelection() |
Deselects all selected columns and rows.
|
protected void |
clearSelectionIfEmptyEndRow() |
Clears the selection if it consists of only an empty end row.
|
protected void |
clearWorkingData() |
Clears the working data.
|
protected java.util.HashMap<java.lang.String,double[]> |
deleteCells(int[] rows,
java.util.HashMap<java.lang.String,double[]> values) |
Deletes cells in a column.
|
protected Dataset |
deleteColumn(java.lang.String colName) |
Deletes a column.
|
protected double[] |
deletePoints(Dataset dataset,
int[] rows) |
Deletes points from a dataset.
|
protected java.util.HashMap<java.lang.String,double[]> |
deleteRows(int[] rows) |
Deletes rows.
|
protected void |
deleteSelectedColumns() |
|
javax.swing.table.TableCellEditor |
getCellEditor(int row,
int col) |
Returns the editor for a cell specified by row and column.
|
javax.swing.table.TableCellRenderer |
getCellRenderer(int row,
int col) |
Overrides DataTable getCellRenderer() method.
|
protected Dataset |
getDataset(java.lang.String colName) |
Gets the source dataset associated with table column name.
|
DataTable.NumberFormatDialog |
getFormatDialog(java.lang.String[] names,
java.lang.String[] selected) |
Gets the format setter dialog.
|
java.lang.String[] |
getHiddenMarkers() |
Gets the names of columns with visible markers.
|
protected int |
getMinimumTableWidth() |
Returns the minimum table width.
|
int[] |
getModelColumnOrder() |
Gets the model column order.
|
protected int |
getModelRow(int row) |
Converts a table row index to the corresponding
model row number (i.e., displayed in the "row" column).
|
protected java.util.ArrayList<java.lang.String> |
getSelectedColumnNames() |
Gets the selected column names.
|
protected HighlightableDataset |
getSelectedData() |
Gets the selected data.
|
protected int[] |
getSelectedModelRows() |
Gets the selected model rows in ascending order.
|
protected int |
getViewRow(int row) |
Converts a model row index (i.e., displayed in the "row" column)
to the corresponding table row number.
|
protected org.opensourcephysics.tools.DataToolTable.WorkingDataset |
getWorkingData() |
Gets the working data: first two data columns in x-y order
|
protected org.opensourcephysics.tools.DataToolTable.WorkingDataset |
getWorkingData(java.lang.String colName) |
Gets the working data for a specified column name.
|
protected int |
getXColumn() |
Gets the x-axis view column.
|
protected int |
getYColumn() |
Gets the y-axis view column.
|
void |
hideMarkers(java.lang.String[] hiddenColumns) |
Hides markers of named columns.
|
protected java.util.HashMap<java.lang.String,double[]> |
insertCells(int[] rows,
java.util.HashMap<java.lang.String,double[]> values) |
Inserts cells with values specified by column name.
|
protected void |
insertColumn(Dataset data,
int col) |
Inserts a column dataset.
|
protected double[] |
insertPoints(Dataset dataset,
int[] rows,
double[] vals) |
Inserts points into a dataset.
|
protected java.util.HashMap<java.lang.String,double[]> |
insertRows(int[] rows,
java.util.HashMap<java.lang.String,double[]> values) |
Inserts rows with values specified by column name.
|
protected boolean |
isEmptyCells(int row,
java.util.ArrayList<java.lang.String> columnNames) |
Determines if a row is empty.
|
protected boolean |
isEmptyRow(int row) |
Determines if a row is empty.
|
void |
refreshDataFunctions() |
Refreshes the data functions.
|
void |
refreshTable() |
Refreshes the data in the table.
|
protected void |
refreshUndoItems() |
Refreshes the undo and redo menu items.
|
protected void |
removeWorkingData(java.lang.String colName) |
Removes the working data for a specified column name.
|
protected void |
renameColumn(java.lang.String oldName,
java.lang.String newName) |
Renames a column.
|
protected java.util.HashMap<java.lang.String,double[]> |
replaceCells(int[] rows,
java.util.HashMap<java.lang.String,double[]> values) |
Replaces cells.
|
protected double[] |
replacePoints(Dataset dataset,
int[] rows,
double[] vals) |
Replaces points in a dataset.
|
void |
selectAllCells() |
Selects all cells in the table.
|
void |
setFont(java.awt.Font font) |
|
protected void |
setLabelColumnWidth(int w) |
Sets the label column width
|
void |
setModelColumnOrder(int[] modelColumns) |
Sets the model column order.
|
protected void |
setSelectedColumnNames(java.util.Collection<java.lang.String> names) |
Sets the selected column names.
|
protected void |
setSelectedModelRows(int[] rows) |
Sets the selected model rows.
|
void |
setWorkingColumns(java.lang.String xColName,
java.lang.String yColName) |
Sets the working columns by name.
|
protected void |
showDataBuilder() |
Displays the data builder.
|
protected void |
trimEmptyRows(int minSize) |
Trims empty rows from bottom of table up to a specified minimum.
|
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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, validateTreeactionPerformed, add, clear, getFormatPattern, getFormattedColumnNames, getFormattedValueAt, getMaximumFractionDigits, getPrecisionRenderer, getSortedColumn, isRowNumberVisible, remove, setColumnVisible, setFormatPattern, setMaximumFractionDigits, setMaximumFractionDigits, setModel, setRefreshDelay, setRowNumberVisible, setStride, setUnits, sortaddAncestorListener, 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, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateaddColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellRect, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, unconfigureEnclosingScrollPane, updateUI, valueChangedprotected static final int RENAME_COLUMN_EDIT
protected static final int INSERT_COLUMN_EDIT
protected static final int DELETE_COLUMN_EDIT
protected static final int INSERT_CELLS_EDIT
protected static final int DELETE_CELLS_EDIT
protected static final int REPLACE_CELLS_EDIT
protected static final int INSERT_ROWS_EDIT
protected static final int DELETE_ROWS_EDIT
protected static java.lang.String[] editTypes
protected static java.awt.Color xAxisColor
protected static java.awt.Color yAxisColor
public DataToolTable(DataToolTab tab)
tab - protected org.opensourcephysics.tools.DataToolTable.WorkingDataset getWorkingData(java.lang.String colName)
colName - the name of the data columnprotected org.opensourcephysics.tools.DataToolTable.WorkingDataset getWorkingData()
protected void removeWorkingData(java.lang.String colName)
colName - the name of the data columnprotected void deleteSelectedColumns()
protected void clearWorkingData()
protected Dataset getDataset(java.lang.String colName)
colName - the column nameprotected HighlightableDataset getSelectedData()
protected int getModelRow(int row)
row - the table rowprotected int getViewRow(int row)
row - the table rowprotected int[] getSelectedModelRows()
protected void setSelectedModelRows(int[] rows)
rows - the model rows to selectprotected java.util.ArrayList<java.lang.String> getSelectedColumnNames()
protected void setSelectedColumnNames(java.util.Collection<java.lang.String> names)
names - Collection of column names to selectprotected void insertColumn(Dataset data, int col)
data - the dataset to insertcol - the insertion view column numberprotected Dataset deleteColumn(java.lang.String colName)
colName - the column name to deleteprotected java.util.HashMap<java.lang.String,double[]> insertCells(int[] rows,
java.util.HashMap<java.lang.String,double[]> values)
rows - the model rows to insertvalues - HashMap of column name to double[] valuesprotected java.util.HashMap<java.lang.String,double[]> deleteCells(int[] rows,
java.util.HashMap<java.lang.String,double[]> values)
rows - the model rows to deletevalues - HashMap of column name to (ignored) double[] valuesprotected java.util.HashMap<java.lang.String,double[]> replaceCells(int[] rows,
java.util.HashMap<java.lang.String,double[]> values)
rows - the model rows to replace in ascending ordervalues - HashMap of column name to double[] new valuesprotected java.util.HashMap<java.lang.String,double[]> insertRows(int[] rows,
java.util.HashMap<java.lang.String,double[]> values)
rows - the model rows to insertvalues - HashMap of column name to double[] valuesprotected java.util.HashMap<java.lang.String,double[]> deleteRows(int[] rows)
rows - the model rows to deleteprotected boolean isEmptyRow(int row)
row - the model row numberprotected boolean isEmptyCells(int row,
java.util.ArrayList<java.lang.String> columnNames)
row - the model row numbercolumnNames - a list of column namesprotected int getXColumn()
protected int getYColumn()
protected double[] replacePoints(Dataset dataset, int[] rows, double[] vals)
dataset - the datasetrows - the rows to replace in ascending ordervals - array of new y-valuesprotected double[] insertPoints(Dataset dataset, int[] rows, double[] vals)
dataset - the datasetrows - the rows to insert in ascending ordervals - the corresponding y-values to insertprotected double[] deletePoints(Dataset dataset, int[] rows)
dataset - the datasetrows - the rows to remove in ascending orderprotected void trimEmptyRows(int minSize)
minSize - the minimum row count to keepprotected void clearSelectionIfEmptyEndRow()
protected void showDataBuilder()
protected void renameColumn(java.lang.String oldName,
java.lang.String newName)
oldName - the old namenewName - the new nameprotected void refreshUndoItems()
public void refreshDataFunctions()
public void selectAllCells()
public void clearSelection()
clearSelection in class javax.swing.JTablepublic void refreshTable()
refreshTable in class DataTablepublic DataTable.NumberFormatDialog getFormatDialog(java.lang.String[] names, java.lang.String[] selected)
DataTablegetFormatDialog in class DataTablenames - the column name choicesselected - the initially selected namespublic int[] getModelColumnOrder()
public void setModelColumnOrder(int[] modelColumns)
modelColumns - array of model column numbers in view column orderpublic java.lang.String[] getHiddenMarkers()
public void hideMarkers(java.lang.String[] hiddenColumns)
hiddenColumns - names of columns with hidden markerspublic void setWorkingColumns(java.lang.String xColName,
java.lang.String yColName)
xColName - the name of the horizontal axis variableyColName - the name of the vertical axis variablepublic void setFont(java.awt.Font font)
setFont in class javax.swing.JComponentprotected void setLabelColumnWidth(int w)
w - the widthpublic javax.swing.table.TableCellRenderer getCellRenderer(int row,
int col)
getCellRenderer in class DataTablerow - the row numbercol - the column numberpublic javax.swing.table.TableCellEditor getCellEditor(int row,
int col)
getCellEditor in class javax.swing.JTablerow - the row numbercol - the column numberprotected int getMinimumTableWidth()