org.opensourcephysics.tools
Class DataToolTable

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTable
                  extended by org.opensourcephysics.display.DataTable
                      extended by org.opensourcephysics.tools.DataToolTable
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.CellEditorListener, javax.swing.event.ListSelectionListener, javax.swing.event.RowSorterListener, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener, javax.swing.Scrollable

public class DataToolTable
extends DataTable

This is a DataTable that displays DataColumns and constructs HighlightableDatasets for a plot.

Version:
1.0
Author:
Douglas Brown
See Also:
Serialized Form

Nested Class Summary
protected static class DataToolTable.DataToolTableModel
          A table model for this table.
protected  class DataToolTable.TableEdit
          A class to undo/redo edits.
 
Nested classes/interfaces inherited from class org.opensourcephysics.display.DataTable
DataTable.DefaultDataTableModel, DataTable.NumberFormatDialog, DataTable.PrecisionRenderer, DataTable.RowNumberRenderer, DataTable.UnitRenderer
 
Nested classes/interfaces inherited from class javax.swing.JTable
javax.swing.JTable.AccessibleJTable, javax.swing.JTable.DropLocation, javax.swing.JTable.PrintMode
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
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
           
 
Fields inherited from class org.opensourcephysics.display.DataTable
clickCountToSort, formatDialog, labelColumnWidth, minimumDataColumnWidth, precisionRenderersByColumnName, rowName, rowNumberRenderer, unitRenderersByColumnName
 
Fields inherited from class javax.swing.JTable
AUTO_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
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DataToolTable(DataToolTab tab)
          Constructs a DataToolTable for the specified DataTooltab.
 
Method Summary
 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.
 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 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.
 
Methods inherited from class org.opensourcephysics.display.DataTable
actionPerformed, add, clear, getFormatDialog, getFormatPattern, getFormattedColumnNames, getFormattedValueAt, getMaximumFractionDigits, getPrecisionRenderer, getSortedColumn, isRowNumberVisible, remove, setColumnVisible, setFormatPattern, setMaximumFractionDigits, setMaximumFractionDigits, setModel, setRefreshDelay, setRowNumberVisible, setStride, setUnits, sort
 
Methods inherited from class javax.swing.JTable
addColumn, 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, valueChanged
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, update
 
Methods inherited from class java.awt.Container
add, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RENAME_COLUMN_EDIT

protected static final int RENAME_COLUMN_EDIT
See Also:
Constant Field Values

INSERT_COLUMN_EDIT

protected static final int INSERT_COLUMN_EDIT
See Also:
Constant Field Values

DELETE_COLUMN_EDIT

protected static final int DELETE_COLUMN_EDIT
See Also:
Constant Field Values

INSERT_CELLS_EDIT

protected static final int INSERT_CELLS_EDIT
See Also:
Constant Field Values

DELETE_CELLS_EDIT

protected static final int DELETE_CELLS_EDIT
See Also:
Constant Field Values

REPLACE_CELLS_EDIT

protected static final int REPLACE_CELLS_EDIT
See Also:
Constant Field Values

INSERT_ROWS_EDIT

protected static final int INSERT_ROWS_EDIT
See Also:
Constant Field Values

DELETE_ROWS_EDIT

protected static final int DELETE_ROWS_EDIT
See Also:
Constant Field Values

editTypes

protected static java.lang.String[] editTypes

xAxisColor

protected static java.awt.Color xAxisColor

yAxisColor

protected static java.awt.Color yAxisColor
Constructor Detail

DataToolTable

public DataToolTable(DataToolTab tab)
Constructs a DataToolTable for the specified DataTooltab.

Parameters:
tab -
Method Detail

getWorkingData

protected org.opensourcephysics.tools.DataToolTable.WorkingDataset getWorkingData(java.lang.String colName)
Gets the working data for a specified column name. The working y-data is the named table column The working x-data is the x (yellow) table column

Parameters:
colName - the name of the data column
Returns:
the working dataset

getWorkingData

protected org.opensourcephysics.tools.DataToolTable.WorkingDataset getWorkingData()
Gets the working data: first two data columns in x-y order

Returns:
the working dataset

removeWorkingData

protected void removeWorkingData(java.lang.String colName)
Removes the working data for a specified column name.

Parameters:
colName - the name of the data column

deleteSelectedColumns

protected void deleteSelectedColumns()

clearWorkingData

protected void clearWorkingData()
Clears the working data.


getDataset

protected Dataset getDataset(java.lang.String colName)
Gets the source dataset associated with table column name.

Parameters:
colName - the column name
Returns:
the dataset

getSelectedData

protected HighlightableDataset getSelectedData()
Gets the selected data. The returned dataset consists of the selected rows in the first two columns of the table in x-y order. This also sets the highlights of the working data and populates the workingRows map.

Returns:
the data in the selected rows, or all data if no rows are selected

getModelRow

protected int getModelRow(int row)
Converts a table row index to the corresponding model row number (i.e., displayed in the "row" column).

Parameters:
row - the table row
Returns:
the model row

getViewRow

protected int getViewRow(int row)
Converts a model row index (i.e., displayed in the "row" column) to the corresponding table row number.

Parameters:
row - the table row
Returns:
the model row

getSelectedModelRows

protected int[] getSelectedModelRows()
Gets the selected model rows in ascending order.

Returns:
the selected rows

setSelectedModelRows

protected void setSelectedModelRows(int[] rows)
Sets the selected model rows.

Parameters:
rows - the model rows to select

getSelectedColumnNames

protected java.util.ArrayList<java.lang.String> getSelectedColumnNames()
Gets the selected column names.

Returns:
ArrayList of selected column names

setSelectedColumnNames

protected void setSelectedColumnNames(java.util.Collection<java.lang.String> names)
Sets the selected column names.

Parameters:
names - Collection of column names to select

insertColumn

protected void insertColumn(Dataset data,
                            int col)
Inserts a column dataset.

Parameters:
data - the dataset to insert
col - the insertion view column number

deleteColumn

protected Dataset deleteColumn(java.lang.String colName)
Deletes a column.

Parameters:
colName - the column name to delete
Returns:
the deleted dataset

insertCells

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. Existing cells are shifted down and other columns are padded with NaN at the end if needed.

Parameters:
rows - the model rows to insert
values - HashMap of column name to double[] values
Returns:
HashMap of column name to double[] inserted values

deleteCells

protected java.util.HashMap<java.lang.String,double[]> deleteCells(int[] rows,
                                                                   java.util.HashMap<java.lang.String,double[]> values)
Deletes cells in a column. Remaining cells are shifted up.

Parameters:
rows - the model rows to delete
values - HashMap of column name to (ignored) double[] values
Returns:
HashMap of column name to double[] deleted values

replaceCells

protected java.util.HashMap<java.lang.String,double[]> replaceCells(int[] rows,
                                                                    java.util.HashMap<java.lang.String,double[]> values)
Replaces cells.

Parameters:
rows - the model rows to replace in ascending order
values - HashMap of column name to double[] new values
Returns:
HashMap of column name to double[] old values

insertRows

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. Unspecified values are set to NaN.

Parameters:
rows - the model rows to insert
values - HashMap of column name to double[] values
Returns:
HashMap of column name to double[] inserted values

deleteRows

protected java.util.HashMap<java.lang.String,double[]> deleteRows(int[] rows)
Deletes rows.

Parameters:
rows - the model rows to delete
Returns:
the deleted values

isEmptyRow

protected boolean isEmptyRow(int row)
Determines if a row is empty.

Parameters:
row - the model row number
Returns:
true if all datasets are NaN at row index

isEmptyCells

protected boolean isEmptyCells(int row,
                               java.util.ArrayList<java.lang.String> columnNames)
Determines if a row is empty.

Parameters:
row - the model row number
columnNames - a list of column names
Returns:
true if all named columns are NaN at row index

getXColumn

protected int getXColumn()
Gets the x-axis view column.

Returns:
col the view column number

getYColumn

protected int getYColumn()
Gets the y-axis view column.

Returns:
col the view column number

replacePoints

protected double[] replacePoints(Dataset dataset,
                                 int[] rows,
                                 double[] vals)
Replaces points in a dataset.

Parameters:
dataset - the dataset
rows - the rows to replace in ascending order
vals - array of new y-values
Returns:
array of values replaced

insertPoints

protected double[] insertPoints(Dataset dataset,
                                int[] rows,
                                double[] vals)
Inserts points into a dataset.

Parameters:
dataset - the dataset
rows - the rows to insert in ascending order
vals - the corresponding y-values to insert
Returns:
array of values inserted

deletePoints

protected double[] deletePoints(Dataset dataset,
                                int[] rows)
Deletes points from a dataset.

Parameters:
dataset - the dataset
rows - the rows to remove in ascending order
Returns:
the removed y-values

trimEmptyRows

protected void trimEmptyRows(int minSize)
Trims empty rows from bottom of table up to a specified minimum.

Parameters:
minSize - the minimum row count to keep

clearSelectionIfEmptyEndRow

protected void clearSelectionIfEmptyEndRow()
Clears the selection if it consists of only an empty end row.


showDataBuilder

protected void showDataBuilder()
Displays the data builder.


renameColumn

protected void renameColumn(java.lang.String oldName,
                            java.lang.String newName)
Renames a column.

Parameters:
oldName - the old name
newName - the new name

refreshUndoItems

protected void refreshUndoItems()
Refreshes the undo and redo menu items.


refreshDataFunctions

public void refreshDataFunctions()
Refreshes the data functions.


clearSelection

public void clearSelection()
Deselects all selected columns and rows. Overrides JTable method.

Overrides:
clearSelection in class javax.swing.JTable

refreshTable

public void refreshTable()
Refreshes the data in the table. Overrides DataTable method.

Overrides:
refreshTable in class DataTable

getModelColumnOrder

public int[] getModelColumnOrder()
Gets the model column order.

Returns:
array of model column numbers in view column order

setModelColumnOrder

public void setModelColumnOrder(int[] modelColumns)
Sets the model column order.

Parameters:
modelColumns - array of model column numbers in view column order

getHiddenMarkers

public java.lang.String[] getHiddenMarkers()
Gets the names of columns with visible markers.

Returns:
array of column names

hideMarkers

public void hideMarkers(java.lang.String[] hiddenColumns)
Hides markers of named columns.

Parameters:
hiddenColumns - names of columns with hidden markers

setWorkingColumns

public void setWorkingColumns(java.lang.String xColName,
                              java.lang.String yColName)
Sets the working columns by name.

Parameters:
xColName - the name of the horizontal axis variable
yColName - the name of the vertical axis variable

setFont

public void setFont(java.awt.Font font)
Overrides:
setFont in class javax.swing.JComponent

setLabelColumnWidth

protected void setLabelColumnWidth(int w)
Sets the label column width

Parameters:
w - the width

getCellRenderer

public javax.swing.table.TableCellRenderer getCellRenderer(int row,
                                                           int col)
Overrides DataTable getCellRenderer() method.

Overrides:
getCellRenderer in class DataTable
Parameters:
row - the row number
col - the column number
Returns:
the cell editor

getCellEditor

public javax.swing.table.TableCellEditor getCellEditor(int row,
                                                       int col)
Returns the editor for a cell specified by row and column.

Overrides:
getCellEditor in class javax.swing.JTable
Parameters:
row - the row number
col - the column number
Returns:
the cell editor

getMinimumTableWidth

protected int getMinimumTableWidth()
Returns the minimum table width.

Returns:
minimum table width.