All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Components |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sas.table
Class TableView

    com.sas.table.TableView

All Implemented Interfaces:
  CompositeInterface, ContainerInterface, com.sas.awt.print.PrintableInterface, com.sas.awt.print.PrintScrollInterface, VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.collection.ContentsChangedListener, com.sas.collection.PropertyBagChangedListener, com.sas.ComponentInterface, com.sas.DesignTimeDropTargetInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, com.sas.PublicClonable, ContextCommandsInterface, ValidatorInterface, com.sas.ViewDefaultModelInterface, com.sas.ViewInterface, FullPaintInterface, MultipleValueEventSourceInterface, ScrollbarVisibilityInterface, ScrollingInterface, java.awt.event.AdjustmentListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

    public class TableView

implements java.awt.event.AdjustmentListener, com.sas.collection.ContentsChangedListener, FullPaintInterface, java.awt.ItemSelectable, com.sas.collection.PropertyBagChangedListener, com.sas.PublicClonable, ScrollbarVisibilityInterface, ScrollingInterface, com.sas.ViewDefaultModelInterface, com.sas.awt.print.PrintableInterface, ContextCommandsInterface, com.sas.awt.print.PrintScrollInterface

TableView is a class that allows two-dimensional data to be viewed, edited, and manipulated in tabular form.

### Creation

> `TableView tv = new TableView();
> tv.initialize();`

### Size

By default, TableView is 124 pixels wide and 248 pixels tall. You can change these (as with all visual components) with:

> `setDefaultWidth (int width);
> setDefaultHeight (int height);`

Since defaultWidth and defaultHeight are class, or static, properties, they affect the size of all object instances. To change the size (and/or position) of a single instance use:

> ``setBounds (int x, int y, int width, int height)`;`

### Model

TableView requires a model that implements StaticTableInterface.

If available, it will also utilize the following:

- TableInterface
- StaticColumnLabelInterface
- ColumnLabelInterface
- StaticRowLabelInterface
- RowLabelInterface
- StaticFormattedDataInterface
- FormattedDataInterface
- StaticTableStyleInterface
- StaticTableTypeInterface
- StaticTableTypeStylesInterface

It will also take advantage of (but not require) com.sas.collection.ContentsChangedSource.html and com.sas.beans.PropertyChangeSource (if not available will check for addPropertyChangeListener() via reflection) in order to dynamically respond to model changes. Thus models should fire com.sas.collection.ContentsChangedEvent and java.beans.PropertyChangeEvent when they change, and TableView provides several ContentsChangedEvent subclasses to facilitate describing those changes:

- ColumnChangedEvent
- RowChangedEvent
- DataCellChangedEvent
- ColumnLabelChangedEvent
- RowLabelChangedEvent

To attach a model to TableView:

> `setModelInterface (your-model);`

And to detach the model:

> `setModelInterface (null);`

### Events

Besides responding to events from its model, TableView will fire events itself -- java.beans.PropertyChangeEvents and java.awt.event.ItemEvent.html. PropertyChangeEvents are fired (as with other bean components) whenever a bound property is changed. ItemEvents are fired whenever selections are made or removed in the table. To register to receive PropertyChangeEvents:

> `addPropertyChangeListener (java.beans.PropertyChangeListener listener);`

And to receive ItemEvents:

> `addItemListener (java.awt.event.ItemListener listener);`

Here's a sample ItemEvent handler:

> `

>     public void tableView1ItemStateChangedHandler1 (java.awt.event.ItemEvent event)
>        {
>        if (event.getStateChange() == java.awt.event.ItemEvent.SELECTED)
>           printSelection ((Selection)event.getItem(), "Selected ");
>        else //if (event.getStateChange() == java.awt.event.ItemEvent.DESELECTED)
>           {
>           Object deselections[] = (Object[])event.getItem ();
>           for (int i = 0; i < deselections.length; i++)
>              printSelection ((Selection)deselections[i], "Deselected ");
>           }
>        }

> `

> `

>     private void printSelection (Selection selection, String text)
>        {
>        Object anchor = selection.getAnchor();
>        Object end = selection.getEnd();

>        if (selection instanceof CellSelection)
>           {
>           DataCell anchorCell = (DataCell)anchor;
>           DataCell endCell = (DataCell)end;
>           text += "cell(" +
>              anchorCell.getRow().getIndex() + "," +
>              anchorCell.getColumn().getIndex() + ") thru cell(" +
>              endCell.getRow().getIndex() + "," +
>              endCell.getColumn().getIndex() + ")";
>           }
>        else
>           {
>           if (selection instanceof ColumnSelection)
>              text += "columns ";
>           else //if (selection instanceof RowSelection)
>              text += "rows ";

>           CellVector anchorCV = (CellVector)anchor;
>           CellVector endCV = (CellVector)end;

>           text += anchorCV.getIndex() + " thru " + endCV.getIndex();
>           }

>        System.out.println (text);
>        }

> `

### Elements

TableView provides several helper classes to surface and allow interaction with the different elements of two-dimensional, or tabular, data:

- Cell
- Column
- Row

Columns and rows are identified by their one-based position in the model and can be retrieved via:

- Column getColumn (int index)
- Row getRow (int index)

Label cells are acquired via their corresponding column or row:

- LabelCell column.getLabel ()
- LabelCell row.getLabel ()

While data cells can be accessed via TableView or their corresponding column or row:

- DataCell tableView.getCell (Row row, Column column)
- DataCell column.getCell (int rowIndex)
- DataCell row.getCell (int columnIndex)

### Styles

A style is simply a collection of property names with associated values. TableView uses styles to provide control over the formatting and rendering characteristics of cells, columns, and rows; and provides a specific style to use with each:

- CellStyle
- ColumnStyle
- RowStyle

CellStyle defines properties such as foregroundColor, backgroundColor, and horizontalJustification among many others. ColumnStyle and RowStyle include size and resizable, as well as defaultCellStyle which is the CellStyle to apply to all cells in the affected columns or rows.

TableView provides four default styles which can be accessed, modified, and/or replaced via the customizer or:

- `getDefaultCellStyle()` and `setDefaultCellStyle()`
- `getDefaultLabelStyle()` and `setDefaultLabelStyle()`
- `getDefaultColumnStyle()` and `setDefaultColumnStyle()`
- `getDefaultRowStyle()` and `setDefaultRowStyle()`

These styles serve as the defaults for all cells, columns, and rows in the table. Data cells will defer first to defaultColumnStyle.defaultCellStyle, then to defaultRowStyle.defaultCellStyle, and finally to defaultCellStyle (actually some properties, like foregroundColor, will additionally defer as ambient properties, to for example java.awt.Component.getForeground()). Row label cells will defer first to defaultRowStyle.defaultLabelStyle, to defaultLabelStyle, then to defaultCellStyle. Likewise for column label cells except they start at defaultColumnStyle.defaultLabelStyle. Consider the following examples, though note that the following is also doable without writing code via the customizer:

If you wanted every cell to be red,

> `getDefaultCellStyle().setForegroundColor (java.awt.Color.red);`

If you wanted just the labels to be red,

> `getDefaultLabelStyle().setForegroundColor (java.awt.Color.red);`

Just the row labels,

> `CellStyle rowLabelStyle = new CellStyle();
> rowLabelStyle.setForegroundColor (java.awt.Color.red);
> getDefaultRowStyle().setDefaultLabelStyle (rowLabelStyle);`

So what did we mean when we said "defer"? That means that if a value is not found for a property at one style level, the property is looked for at the next higher level, and so on. This notion of deferring illustrates the power of styles...each style does not have to (and rarely will) define every property associated with its type. (Actually, styles are extensible so there is no notion of defining every property.) For example, defaultLabelStyle might provide a value for backgroundColor, but not foregroundColor. Instead choosing to defer to defaultCellStyle for foregroundColor. The advantage of this flexibility becomes clearer when styles are associated with individual elements...

By default, individual table elements (cells, columns, and rows) do not have a style of their own, but one may be assigned via `TableElement.setStyle()`. For example, to change the foreground color for only the cell at (row-three, column-four):

> `CellStyle cellStyle = new CellStyle();
> cellStyle.setForegroundColor (java.awt.Color.red);
> getCell (getRow(3), getColumn(4)).setStyle (cellStyle);`

And to change the foreground color of all the data cells in columns five and six:

> `ColumnStyle colStyle = new ColumnStyle();
> CellStyle cellStyle = new CellStyle();
> cellStyle.setForegroundColor (Color.red);
> colStyle.setDefaultCellStyle (cellStyle);
> getColumn(5).setStyle (colStyle);
> getColumn(6).setStyle (colStyle);`

Notice how the same style can be applied to multiple elements.

### Sizing Columns and Rows

[Note: for simplicity and ease in reading this section is written in terms of columns, but the same information and techniques are applicable to rows.]

By default, columns are sized based on their contents. A column's label cell and data cells are individually measured to determine the widest one, and its width is used as the column's width. Since a table may contain a very large number of rows only a sample number of data cells are measured. The number to measure is determined by the effective value of ColumnStyle's cellsToSizeCount property. By default the number is 25, which means that the width of a column will be determined from the width of its label and its first 25 cells. A value of zero will cause only the label to be considered, while a negative value will result in the entire column being measured -- use this when you want to guarantee that no data will be clipped, but only when you're sure that the number of rows will not be too large. Clipped numeric data will be displayed as asterisks (***), while clipped character data will be appended with ellipsis (...).

Columns can be resized interactively by grabbing their label's right border, or programmatically via Column.setSize(). Other programmatic sizing controls include TableView.setColumnsConformed(), ColumnStyle.setSize(), ColumnStyle.setMinimumSize(), and ColumnStyle.setMaximumSize(). The following illustrates the use of some of these:

> `

>      // Size a three column table such that the first column gets 25%
>      // of the available space, the second gets 50%, and the third 25%.
>     import com.sas.measures.Length;
>     for (int i = 1; i <= 3; i++)
>        {
>        Column col = tableView1.getColumn(i);
>        ColumnStyle style = new ColumnStyle();
>        Length s = null;
>        switch (i)
>           {
>           // adjust Length magnitudes to get any ratio you want
>           case 1: s = new Length (1, "px"); break;
>           case 2: s = new Length (2, "px"); break;
>           case 3: s = new Length (1, "px"); break;
>           // extend for other columns as necessary
>           }
>        style.setSize (s);
>        col.setStyle (style);
>        }
>     tableView1.setColumnsConformed (true);

> `

### Writing Your Own Cell View

As explained above in the Elements section, each cell is represented by a Cell object. However, Cell itself is nothing more than a useful abstraction. The real work of formatting, displaying, and editing cell data is delegated by Cell to a class known as a Cell View -- any class which implements CellViewInterface. This design allows TableView's cells to contain all types of data -- string, numeric, image, etc. -- and allows that data to be displayed and manipulated in a manner that's appropriate for it. For example, TextCell for string data and CheckBoxCell for boolean data.

After you've written your Cell View, you can get TableView to use it via CellStyle's viewClass property. For example, to override the default viewClass (TextCell) for cells in column 3 do the following:

> `

>     Column col = tableView1.getColumn(3);
>     ColumnStyle colStyle = new ColumnStyle();
>     CellStyle cellStyle = new CellStyle();
>     cellStyle.setViewClass (CheckBoxCell.class);
>     colStyle.setDefaultCellStyle (cellStyle);
>     col.setStyle (colStyle);

> `

### Validating Modified Cell Data

[Note: all cells are protected from modification by default. To unprotect them, use CellStyle's activationLevel property.]

TableView itself does not get involved in validating data. Validation is left to the Cell Views (see preceding section) and to the model. Cell Views can validate data as it's entered -- i.e. keystroke-by-keystroke -- while models validate data on a cell-by-cell basis. In the latter case, the user has finished modifying a cell and has indicated -- either by a ui-action such as changing the current cell or programmatically via commitModifiedCells() -- to commit the change to the model. When this occurs, TableView calls StaticTableInterface.setCell() with the data. The model is then free to accept or reject the data. If it rejects the data, it should throw a TableException with an appropriate message. TableView will catch this exception and pass its message to any registered error handler, see COMMIT_CELL_ERROR. The cell will also be added to the invalid cells collection, and displayed with the default invalid cell style.

### Using TableView as a Listbox

The typical listbox is a single column of selectable, but not editable, items. First, to get the right appearance, you'll want to turn-off row and column labels and size the column to be as wide as the component. This can be accomplished via the customizer or with the following code:

> `setRowLabelsVisible (false);
> setColumnLabelsVisible (false);
> setColumnsConformed (true);`

The cells are already selectable and uneditable by default, but if this is a single selection list you'll want to disable extended and multiple selection. Again this can be done via the customizer or with the following code:

> `setExtendedSelectionAllowed (false);
> setMultipleSelectionAllowed (false);`

If you have a multi-column list, then in addition to leaving column labels visible, you will probably want each selection action to select an entire row instead of one cell at a time. See the "selection element" radiobox in the customizer's selections tab or use:

> `setSelectionElement (TableView.ROW);`

As for your list data itself, com.sas.models.SimpleTable should meet your needs.

### Using TableView as a Spreadsheet

Spreadsheets usually have alphabetic column labels (A,B,C,...) and numeric row labels (1,2,3,...) that surround an initially empty but fully editable matrix of data cells. A com.sas.models.SimpleTable can be used as your matrix. For example,

> `com.sas.models.SimpleTable matrix = new SimpleTable();
> matrix.initialize();
> matrix.setSize (100, 100);
> tableView.setModelInterface (matrix);
> `

TableView will automatically provide row and column labels. Since spreadsheet labels usually aren't editable, label selections typically are translated into selections of the corresponding row or column. TableView has properties, rowsSelectedByLabel and columnsSelectedByLabel (`true` by default), to allow this.

To enable cell editing, there is a "cells are protected" checkbox on the customizer's table tab. Editing is enabled programmatically via CellStyle's activationLevel property:

> `tableView.getDefaultCellStyle().setActivationLevel (CellActiveStates.ACTIVATED);`

### Using TableView as a Database Access Grid

The com.sas.sasserver.dataset.DataSetInterface model will allow you to view and edit SAS datasets.

Cell editing can be enabled as described above in the spreadsheet example. If your database is read-only, TableView will recognize this and not allow editing regardless of your customizations.

See Also:
  `MultidimensionalTableView`, Serialized Form

Field Summary
`static int` | `CELL` Cell constant for the selectionElement and transactionElement properties.
`static int` | `COLUMN` Column constant for the selectionElement and transactionElement properties.
`static int` | `COLUMN_MAJOR` Constant value for the printOrder property which indicates that columns should be given precedence when printing.
`static java.lang.String` | `COMMIT_CELL_ERROR` Constant used to identify errors that occur when committing cell changes to the model.
`Scrollbar` | `m_vbar`
`static java.lang.String` | `RB_KEY`
`static int` | `ROW` Row constant for the selectionElement and transactionElement properties.
`static int` | `ROW_MAJOR` Constant value for the printOrder property which indicates that rows should be given precedence when printing.
`static int` | `USER_DEFINED` User-defined constant for the transactionElement property.

Fields inherited from interface com.sas.visuals.ScrollbarVisibilityInterface
`SCROLLBARS_ALWAYS, SCROLLBARS_AS_NEEDED, SCROLLBARS_NEVER`

Fields inherited from interface com.sas.visuals.ScrollingInterface
`SCROLL_BLOCK, SCROLL_COLUMN, SCROLL_ELEMENT, SCROLL_HALF_PAGE, SCROLL_MAXIMUM, SCROLL_PAGE, SCROLL_PIXEL, SCROLL_ROW`

Constructor Summary
`TableView()` Constructor.

Method Summary
`void` | `addItemListener(java.awt.event.ItemListener listener)` Adds a listener to receive java.awt.event.ItemEvent which are generated when items are selected and deselected in the table.
`void` | `adjustmentValueChanged(java.awt.event.AdjustmentEvent event)` Processes an java.awt.event.AdjustmentEvent sent by the scrollbars.
`void` | `attachModel(com.sas.ModelInterface model)` Framework method; call setModelInterface(model) instead.
`java.lang.Object` | `clone()` Clones this component.
`protected TableView` | `clone(double horizontalScale, double verticalScale)` Clones this component.
`protected void` | `cloneModelDependentState(TableView clone, double horizontalScale, double verticalScale)` Clones this component's model dependent state.
`protected void` | `cloneModelIndependentState(TableView clone, double horizontalScale, double verticalScale)` Clones this component's model independent state.
`boolean` | `commitModifiedCells()` Commits any modified cells to the model.
`java.awt.Dimension` | `computePreferredSize()` Determines the preferred size of this component.
`void` | `contentsChanged(com.sas.collection.ContentsChangedEvent event)` Processes a com.sas.collection.ContentsChangedEvent sent by the model.
`protected DataCell` | `createCell(Row row, Column col)` Factory method for creating cells.
`protected Column` | `createColumn(int index)` Factory method for creating columns.
`protected LabelCell` | `createColumnLabel(Column col)` Factory method for creating column labels.
`protected LabelCell` | `createOriginCell()` Factory method for creating the cell associated with the origin cell.
`protected Row` | `createRow(int index)` Factory method for creating rows.
`protected LabelCell` | `createRowLabel(Row row)` Factory method for creating row labels.
`void` | `detachModel(com.sas.ModelInterface model)` Framework method; call setModelInterface(null) instead.
`void` | `disableFullPaint()` Disables full (normal) painting.
`void` | `enableFullPaint()` Enables full (normal) painting.
`Cell` | `findCell(java.awt.Point point)` Finds the cell that contains a given point.
`Column` | `findColumn(int x)` Finds the column that contains a given x-coordinate.
`Row` | `findRow(int y)` Finds the row that contains a given y-coordinate.
`protected void` | `formatView(java.awt.Graphics g)` Formats the model's data as defined by this view.
`DataCell` | `getCell(Row row, Column col)` Returns the cell at the intersection of a given row and column.
`com.sas.collection.StaticDictionaryInterface` | `getCellTypeStyles()` Returns the set of cell types and their associated styles.
`Column` | `getColumn(int index)` Returns the column at a given index.
`java.awt.Rectangle` | `getColumnLabelBounds()` Returns a rectangle that represents the location and size of the column label area.
`int` | `getColumnsConformedThreshold()` Returns the percentage, 0 to 99, of the table's width to the component's width above which columns should be conformed.
`com.sas.util.Command[]` | `getContextCommands(java.lang.Object context, int x, int y)` Returns a list of commands associated with a given context.
`TableElement` | `getCurrentElement()` Returns the value of the current element.
`java.awt.Rectangle` | `getDataCellBounds()` Returns a rectangle that represents the location and size of the data cell area.
`CellStyle` | `getDefaultCellStyle()` Returns the set of style properties that serve as defaults for all cells.
`protected int` | `getDefaultColumnIndex()` Returns the index of the first column that should be displayed following a refresh.
`ColumnStyle` | `getDefaultColumnStyle()` Returns the set of style properties that serve as defaults for all columns.
`static int` | `getDefaultHeight()` Returns the default height for instances of this class.
`CellStyle` | `getDefaultInvalidCellStyle()` Returns the set of style properties that serve as defaults for invalid cells.
`CellStyle` | `getDefaultLabelStyle()` Returns the set of style properties that serve as defaults for all labels.
`com.sas.ModelInterface` | `getDefaultModel()` Returns the default model.
`protected int` | `getDefaultRowIndex()` Returns the index of the first row that should be displayed following a refresh.
`RowStyle` | `getDefaultRowStyle()` Returns the set of style properties that serve as defaults for all rows.
`static int` | `getDefaultWidth()` Returns the default width for instances of this class.
`com.sas.collection.StaticOrderedCollectionInterface` | `getDisplayedColumns()` Returns the set of columns that are currently scrolled into view.
`com.sas.collection.StaticOrderedCollectionInterface` | `getDisplayedRows()` Returns the set of rows that are currently scrolled into view.
`static com.sas.beans.ExtendedBeanInfo` | `getExtendedBeanInfo()` Returns metadata describing this class's properties.
`java.awt.Graphics` | `getGraphics()` Creates a graphics context for this component.
`java.awt.Color` | `getGridColor()` Returns the color of the grid lines.
`com.sas.collection.StaticOrderedCollectionInterface` | `getHeldColumns()` Returns the set of held columns.
`com.sas.collection.StaticOrderedCollectionInterface` | `getHeldRows()` Returns the set of held rows.
`int` | `getHorizontalScrollbarVisibility()` Returns a constant indicating whether the horizontal scrollbar is always visible, never visible, or visible only as needed.
`com.sas.collection.StaticOrderedCollectionInterface` | `getInvalidCells()` Returns the set of cells that are invalid.
`protected java.awt.Insets` | `getLabelInsets()` Returns the label insets.
`com.sas.collection.StaticOrderedCollectionInterface` | `getModifiedCells()` Returns the set of cells that have been modified.
`LabelCell` | `getOriginCell()` Returns the cell at the intersection of the row of column labels and the column of row labels.
`java.awt.Rectangle` | `getOriginCellBounds()` Returns a rectangle that represents the location and size of the origin cell.
`java.awt.Rectangle` | `getPageBounds(java.awt.Graphics g, int pageNumber, int pageWidth, int pageHeight)` Returns the bounds of a given page.
`java.awt.Rectangle` | `getPaintableBounds()` Returns a rectangle that represents the location and size of the paintable area.
`java.awt.Panel` | `getPrintOptionsPanel()` Returns a gui for specifying a row or column major print order.
`int` | `getPrintOrder()` Returns a constant that indicates how the table should be split into multiple pages when printed.
`java.util.Vector` | `getRequiredInterfaces()` Returns the interfaces required of a model by this view.
`Row` | `getRow(int index)` Returns the row at a given index.
`java.awt.Rectangle` | `getRowLabelBounds()` Returns a rectangle that represents the location and size of the row label area.
`int` | `getRowsConformedThreshold()` Returns the percentage, 0 to 99, of the table's height to the component's height above which rows should be conformed.
`java.util.Enumeration` | `getSelectedCells()` Returns the set of selected cells.
`java.util.Enumeration` | `getSelectedColumns()` Returns the set of selected columns.
`java.lang.Object[]` | `getSelectedObjects()` Returns the set of selected ranges (if any).
`java.util.Enumeration` | `getSelectedRanges()` Returns the set of selected ranges.
`java.util.Enumeration` | `getSelectedRows()` Returns the set of selected rows.
`int` | `getSelectionElement()` Returns the type of table element that is selected when an interactive selection is made.
`java.awt.Rectangle` | `getTableBounds()` Returns a rectangle that represents the location and size of the table within the component's bounds.
`protected java.awt.Rectangle` | `getTableBounds(java.awt.Graphics g)` Returns a rectangle that represents the location and size of the table within the component's bounds.
`int` | `getTransactionElement()` Returns how often modified cells are committed to the model.
`int` | `getVerticalScrollbarVisibility()` Returns a constant indicating whether the vertical scrollbar is always visible, never visible, or visible only as needed.
`void` | `hold(CellVector cellVector)` "Holds" a given column or row.
`void` | `initialize()` Initialization: register as listener to default styles, and set default model (if appropriate).
`boolean` | `isActiveCellHighlighted()` Returns whether the active cell is visually distinguished from the other cells.
`boolean` | `isColumnLabelsVisible()` Returns whether column labels should be displayed.
`boolean` | `isColumnsConformed()` Returns whether columns are resized to fill the horizontal extent of the component.
`boolean` | `isColumnsSelectedByLabel()` Returns whether a column label selection selects the entire column.
`boolean` | `isCurrentElementHighlighted()` Returns whether the current element is visually distinguished from the other selected elements.
`boolean` | `isDefaultModelAttached()` Returns whether the default model is attached.
`boolean` | `isExtendedSelectionAllowed()` Returns whether selections can be extended.
`boolean` | `isFocusTraversable()` Returns whether this component can be traversed using tab or shift-tab keyboard focus traversal.
`boolean` | `isFullPaintDisabled()` Returns whether full painting is disabled.
`boolean` | `isGridVisible()` Returns whether grid lines are drawn over the data cells.
`boolean` | `isMultipleSelectionAllowed()` Returns whether a single interactive selection action can span more than one element.
`boolean` | `isPartialColumnVisible()` Returns whether the displayed column furthest from the row labels should be shown even if it's only partially displayed (clipped).
`boolean` | `isPartialRowVisible()` Returns whether the displayed row furthest from the column labels should be shown even if it's only partially displayed (clipped).
`boolean` | `isPopupMenuVisible()` Returns whether a popup menu will be shown when TableView receives the popup event.
`boolean` | `isPrintScrollNeeded(int direction)` Get if a scroll is needed in the specified direction to show more data.
`boolean` | `isRowLabelsVisible()` Returns whether row labels should be displayed.
`boolean` | `isRowsConformed()` Returns whether rows are resized to fill the vertical extent of the component.
`boolean` | `isRowsSelectedByLabel()` Returns whether a row label selection selects the entire row.
`boolean` | `isSelectionAllowed()` Returns whether interactive selections can be made.
`boolean` | `isTableSelectedByOriginCell()` Returns whether a selection of the origin cell selects the entire table.
`protected TableView` | `newTableView()` Deprecated. As of AppDevStudio version 1.1.
`int` | `nextPrintScrollDirection()` Get the direction needed for the next scroll of the table.
`protected void` | `onAllChanged()` Performs a complete refresh of the view's state from its model.
`protected void` | `onSizeColumn(Column col, java.awt.Graphics g)` Sizes a given column.
`protected void` | `onSizeRow(Row row, java.awt.Graphics g)` Sizes a given row.
`boolean` | `pageExists(int pageNumber)` Determines if a given page exists.
`void` | `paint(java.awt.Graphics g)` Paints this component.
`protected void` | `paintTable(java.awt.Graphics g, java.awt.Rectangle invalidBounds)` Paints the table.
`protected void` | `populatePopupMenu(java.awt.PopupMenu popupMenu, TableElement element)` Populates a popup menu based on a given context (element).
`int` | `previousPrintScrollDirection()` Get the direction of the previous scroll.
`void` | `print(java.awt.Graphics g)` Prints this component.
`void` | `print(java.awt.Graphics g, int pageNumber, int pageWidth, int pageHeight)` Prints the requested page.
`void` | `printFinalize()` Notification that printing is complete.
`void` | `printInitialize(java.awt.Graphics g)` Notification that printing is about to begin.
`protected void` | `processChanges()` Processes any changes that have been reported by the model.
`protected boolean` | `processContentsChangedEvent(com.sas.collection.ContentsChangedEvent event)` Processes a contents changed event.
`protected void` | `processEvent(java.awt.AWTEvent event)` Processes awt-events occurring on this component.
`protected void` | `processFocusEvent(java.awt.event.FocusEvent fe)` Processes focus events occurring on this component.
`protected void` | `processKeyEvent(java.awt.event.KeyEvent ke)` Processes key events occurring on this component.
`protected void` | `processMouseEvent(java.awt.event.MouseEvent me)` Processes mouse events occurring on this component.
`protected void` | `processMouseMotionEvent(java.awt.event.MouseEvent me)` Processes mouse motion events occurring on this component.
`void` | `propertyBagChanged(com.sas.collection.PropertyBagChangedEvent e)` Processes a com.sas.collection.PropertyBagChangedEvent sent by a style.
`void` | `propertyChange(java.beans.PropertyChangeEvent e)` Processes a java.beans.PropertyChangeEvent sent by the model.
`void` | `refresh()` Alias for `refresh(getModelInterface())`.
`void` | `refresh(com.sas.ModelInterface model)` Notifies the view that a model has changed.
`void` | `refreshModifiedCells()` Refreshes any modified cells to their values as maintained by the model.
`void` | `release(CellVector cellVector)` "Releases" a given column or row.
`void` | `releaseAllColumns()` Releases any held columns.
`void` | `releaseAllRows()` Releases any held rows.
`void` | `remeasureAllColumns(boolean preserveResizes)` Resets all columns to their preferred width.
`void` | `remeasureAllRows(boolean preserveResizes)` Resets all rows to their preferred height.
`void` | `removeItemListener(java.awt.event.ItemListener listener)` Removes a listener of java.awt.event.ItemEvent which are generated when items are selected and deselected in the table.
`void` | `repaint()` Repaints this component.
`void` | `repaint(int x, int y, int width, int height)` Repaints the specified rectangle of this component.
`void` | `repaintColumns()` Repaint the whole table except for the row labels.
`void` | `repaintRows()` Repaint the whole table except for the column labels.
`void` | `scrollHorizontally(int numUnits, int unit)` Scrolls the table horizontally.
`void` | `scrollToCell(Cell cell, boolean makeFirst)` Ensures that a cell is scrolled fully into view.
`void` | `scrollToColumn(Column col, boolean makeFirst)` Ensures that a column is scrolled fully into view.
`void` | `scrollToRow(Row row, boolean makeFirst)` Ensures that a row is scrolled fully into view.
`void` | `scrollVertically(int numUnits, int unit)` Scrolls the table vertically.
`void` | `select(Column start, Column end, boolean extend)` Selects a contiguous range of columns.
`void` | `select(DataCell start, DataCell end, boolean extend)` Selects a rectangular range of cells.
`void` | `select(Row start, Row end, boolean extend)` Selects a contiguous range of rows.
`void` | `select(Selection range, boolean extend)` Selects a range.
`void` | `setActiveCellHighlighted(boolean newValue)` Specifies whether the active cell is visually distinguished from the other cells.
`void` | `setBounds(int x, int y, int width, int height)` Moves and resizes this component.
`void` | `setColumnLabelsVisible(boolean newValue)` Specifies whether column labels should be displayed.
`void` | `setColumnsConformed(boolean newValue)` Specifies whether columns should be resized to fill the horizontal extent of the component.
`void` | `setColumnsConformedThreshold(int newValue)` Specifies the percentage, 0 to 99, of the table's width to the component's width above which columns should be conformed.
`void` | `setColumnsSelectedByLabel(boolean newValue)` Returns whether a column label selection selects the entire column.
`void` | `setCurrentElement(TableElement newValue)` Sets the value of the current element.
`void` | `setCurrentElementHighlighted(boolean newValue)` Returns whether the current element is visually distinguished from the other selected elements.
`void` | `setCursor(java.awt.Cursor cursor)` Sets the cursor image to a predefined cursor.
`protected void` | `setCursor(java.awt.Point point)` Sets the cursor image based on a given mouse pointer location.
`void` | `setDefaultCellStyle(CellStyle newValue)` Specifies the set of style properties to use as defaults for all cells.
`void` | `setDefaultColumnStyle(ColumnStyle newValue)` Specifies the set of style properties to use as defaults for all columns.
`static void` | `setDefaultHeight(int newValue)` Sets the default height for instances of this class.
`void` | `setDefaultInvalidCellStyle(CellStyle newValue)` Specifies the set of style properties to use as defaults for invalid cells.
`void` | `setDefaultLabelStyle(CellStyle newValue)` Specifies the set of style properties to use as defaults for all labels.
`void` | `setDefaultModel(com.sas.ModelInterface newValue)` Sets the default model.
`void` | `setDefaultRowStyle(RowStyle newValue)` Specifies the set of style properties to use as defaults for all rows.
`void` | `setDefaultValues()` Sets default values for this component's non-transient fields.
`static void` | `setDefaultWidth(int newValue)` Returns the default width for instances of this class.
`void` | `setExtendedSelectionAllowed(boolean newValue)` Specifies whether selections can be extended.
`void` | `setFont(java.awt.Font newValue)` Sets the font of this component.
`void` | `setGridColor(java.awt.Color newValue)` Specifies the color of the grid lines.
`void` | `setGridVisible(boolean newValue)` Specifies whether grid lines are drawn over the data cells.
`void` | `setHorizontalScrollbarVisibility(int newValue)` Specifies when a horizontal scrollbar should be used: always, never, or as needed.
`void` | `setModelInterface(com.sas.ModelInterface newValue)` Specifies the model to display in the view.
`void` | `setMultipleSelectionAllowed(boolean newValue)` Specifies whether a single interactive selection action can span more than one element.
`void` | `setPartialColumnVisible(boolean newValue)` Specifies whether the displayed column furthest from the row labels should be shown even if it's only partially displayed (clipped).
`void` | `setPartialRowVisible(boolean newValue)` Specifies whether the displayed row furthest from the column labels should be shown even if it's only partially displayed (clipped).
`void` | `setPopupMenuVisible(boolean newValue)` Specifies whether a popup menu should be shown when TableView receives the popup event.
`void` | `setPrintOrder(int newValue)` Specifies how the table should be split into multiple pages when printed.
`void` | `setRowLabelsVisible(boolean newValue)` Specifies whether row labels should be displayed.
`void` | `setRowsConformed(boolean newValue)` Specifies whether rows should be resized to fill the vertical extent of the component.
`void` | `setRowsConformedThreshold(int newValue)` Specifies the percentage, 0 to 99, of the table's height to the component's height above which rows should be conformed.
`void` | `setRowsSelectedByLabel(boolean newValue)` Specifies whether a row label selection selects the entire row.
`void` | `setSelectionAllowed(boolean newValue)` Specifies whether interactive selections can be made.
`void` | `setSelectionElement(int newValue)` Specifies the type of table element that is selected when an interactive selection is made.
`void` | `setTableSelectedByOriginCell(boolean newValue)` Specifies whether a selection of the origin cell selects the entire table.
`void` | `setTransactionElement(int newValue)` Specifies how often modified cells are committed to the model.
`void` | `setVerticalScrollbarVisibility(int newValue)` Specifies when a vertical scrollbar should be used: always, never, or as needed.
`void` | `unselect()` Unselects all cells, columns, and rows.
`protected void` | `updateDisplayedColumns(java.awt.Graphics g)` Updates the set of displayed columns.
`protected void` | `updateDisplayedRows(java.awt.Graphics g)` Updates the set of displayed rows.
`protected void` | `updateView(java.awt.Graphics g)` Updates this view to reflect the current state of its model.

Methods inherited from class com.sas.awt.ContainerContainerComponent
`addNotify, dragEnter, dragLeave, dragOver, drop, getContainerInterfaceSupportInfo, getErrorHandler, getInsets, getValidator, isIDEDnDDropBarrier, isIDEDnDDropTarget, isValid, removeNotify, setContainerInterfaceSupportInfo, setErrorHandler, setIDEDnDDropBarrier, setIDEDnDDropTarget, setInsets, setInsets, setValidator, superAddNotify, superGetInsets, superRemoveNotify, superSetDefaultValues`

Methods inherited from class com.sas.awt.ContainerVisualComponent
`addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachView, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getMinimumSize, getModelInterface, getPreferredSize, getPrePainter, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, queryLinks, queryLinks, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBackgroundColor, setBorder, setComponentDescription, setComponentSupportInfo, setEnabled, setFocus, setForegroundColor, setHeight, setHorizontalPosition, setLinkInfo, setPreferredSize, setPrePainter, setRequiredInterfaces, setTransparent, setVerticalPosition, setViewInterfaceSupportInfo, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, update, validateObject`

Methods inherited from interface com.sas.awt.ContainerInterface
`getComponents, getLayout, invalidate, setLayout, validate`

Methods inherited from interface com.sas.awt.VisualInterface
`getBackgroundColor, getBorder, getFont, getForegroundColor, getHeight, getHorizontalPosition, getMinimumSize, getPreferredSize, getPrePainter, getVerticalPosition, getVisualInterfaceSupportInfo, getWidth, isEnabled, isFocus, isTransparent, isVisible, setBackgroundColor, setBorder, setEnabled, setFocus, setForegroundColor, setHeight, setHorizontalPosition, setPreferredSize, setPrePainter, setTransparent, setVerticalPosition, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate`

Field Detail

### RB_KEY

    public static final java.lang.String RB_KEY

See Also:
  Constant Field Values

### CELL

    public static final int CELL

  Cell constant for the selectionElement and transactionElement properties.

  See Also:
    `getSelectionElement()`, `getTransactionElement()`, Constant Field Values

### COLUMN

    public static final int COLUMN

  Column constant for the selectionElement and transactionElement properties.

  See Also:
    `getSelectionElement()`, `getTransactionElement()`, Constant Field Values

### ROW

    public static final int ROW

  Row constant for the selectionElement and transactionElement properties.

  See Also:
    `getSelectionElement()`, `getTransactionElement()`, Constant Field Values

### USER_DEFINED

    public static final int USER_DEFINED

  User-defined constant for the transactionElement property.

  See Also:
    `getTransactionElement()`, Constant Field Values

### COMMIT_CELL_ERROR

    public static final java.lang.String COMMIT_CELL_ERROR

  Constant used to identify errors that occur when committing cell changes to the model. Passed to com.sas.util.errorhandlers.ErrorHandlerInterface.handleError by commitModifiedCells.

  See Also:
    Constant Field Values

### ROW_MAJOR

    public static final int ROW_MAJOR

  Constant value for the printOrder property which indicates that rows should be given precedence when printing. This means that if the table has to be split into multiple pages horizontally, i.e. if it takes more than one page to see an entire row, then those pages should be printed before the table is scrolled vertically to print additional pages in the vertical direction.

  See Also:
    `COLUMN_MAJOR`, `setPrintOrder(int)`, Constant Field Values

### COLUMN_MAJOR

    public static final int COLUMN_MAJOR

  Constant value for the printOrder property which indicates that columns should be given precedence when printing. This means that if the table has to be split into multiple pages vertically, i.e. if it takes more than one page to see an entire column, then those pages should be printed before the table is scrolled horizontally to print additional pages in the horizontal direction.

  See Also:
    `ROW_MAJOR`, `setPrintOrder(int)`, Constant Field Values

### m_vbar

    public transient Scrollbar m_vbar

Constructor Detail

### TableView

    public TableView()

  Constructor. Must be followed by a call to initialize().

Method Detail

### getDefaultHeight

    public static int getDefaultHeight()

  Returns the default height for instances of this class.

  Returns:
    The value of the defaultHeight property.

### setDefaultHeight

    public static void setDefaultHeight(int newValue)

  Sets the default height for instances of this class.

  Parameters:
    `newValue` - The new value to assign the defaultHeight property.

### getDefaultWidth

    public static int getDefaultWidth()

  Returns the default width for instances of this class.

  Returns:
    The value of the defaultWidth property.

### setDefaultWidth

    public static void setDefaultWidth(int newValue)

  Returns the default width for instances of this class.

  Parameters:
    `newValue` - The new value to assign the defaultWidth property.

### getExtendedBeanInfo

    public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()

  Returns metadata describing this class's properties.

### addItemListener

    public void addItemListener(java.awt.event.ItemListener listener)

  Adds a listener to receive java.awt.event.ItemEvent which are generated when items are selected and deselected in the table.

  When ItemEvent.getStateChange() is SELECTED, ItemEvent.getObject() will return a Selection.

  When ItemEvent.getStateChange() is DESELECTED, ItemEvent.getObject() will return an Object array of Selections.

  Specified by:
    `addItemListener` in interface `java.awt.ItemSelectable`
  Parameters:
    `listener` - An object which handles ItemEvents.
  See Also:
    `removeItemListener(java.awt.event.ItemListener)`, `ItemListener`, `ItemSelectable`

### clone

    public java.lang.Object clone()
                           throws java.lang.CloneNotSupportedException

  Clones this component.

  Implemented as `return clone(1, 1)`, so subclasses should override it or one of the clone framework methods it calls, but should not override this -- it would be declared `final` if it had not been already released as is.

  Specified by:
    `clone` in interface `com.sas.PublicClonable`
  Overrides:
    `clone` in class `ContainerContainerComponent`
  Returns:
    A clone of this component.
  Throws:
    `java.lang.CloneNotSupportedException` - TableView supports cloning, but a subclass may not.
  See Also:
    `clone(double, double)`

### commitModifiedCells

    public boolean commitModifiedCells()

  Commits any modified cells to the model. Any cells that are rejected by the model are added to the set of invalid cells and remain in the set of modified cells; otherwise they are removed from the set of modified cells. Thus, once committed modified cells can't be reset to their original values.

  The messages from any exceptions generated by the model are passed to the java.awt.ContainerContainerComponent.setErrorHandler method with a message code of COMMIT_CELL_ERROR.

  Returns:
    `true` if all cells were accepted by the model, and `false` otherwise.
  See Also:
    `refreshModifiedCells()`, `getModifiedCells()`, `getInvalidCells()`, `setTransactionElement(int)`

### computePreferredSize

    public java.awt.Dimension computePreferredSize()

  Determines the preferred size of this component. The preferred size will be the table view's default size unless all the model's data fits in a smaller area in which case that size will be returned.

  Specified by:
    `computePreferredSize` in interface `VisualInterface`
  Overrides:
    `computePreferredSize` in class `ContainerVisualComponent`
  Returns:
    The preferred size of the table view.
  See Also:
    `getDefaultHeight()`, `getDefaultWidth()`

### disableFullPaint

    public void disableFullPaint()

  Disables full (normal) painting. When full painting is disabled, `paint()` will only paint a component border and nothing more.

  Specified by:
    `disableFullPaint` in interface `FullPaintInterface`
  See Also:
    `enableFullPaint()`, `isFullPaintDisabled()`, `FullPaintInterface`

### enableFullPaint

    public void enableFullPaint()

  Enables full (normal) painting.

  Specified by:
    `enableFullPaint` in interface `FullPaintInterface`
  See Also:
    `disableFullPaint()`, `isFullPaintDisabled()`, `FullPaintInterface`

### findCell

    public Cell findCell(java.awt.Point point)

  Finds the cell that contains a given point.

  Returns:
    The matching cell or `null` if no match.
  See Also:
    `findColumn(int)`, `findRow(int)`

### findColumn

    public Column findColumn(int x)

  Finds the column that contains a given x-coordinate.

  Returns:
    The matching column or `null` if no match.
  See Also:
    `findCell(java.awt.Point)`, `findRow(int)`

### findRow

    public Row findRow(int y)

  Finds the row that contains a given y-coordinate.

  Returns:
    The matching row or `null` if no match.
  See Also:
    `findColumn(int)`, `findCell(java.awt.Point)`

### getContextCommands

    public com.sas.util.Command[] getContextCommands(java.lang.Object context,
                                                     int x,
                                                     int y)

  Returns a list of commands associated with a given context. The list may contain sublists by making one of the items a MenuCommand.

  TableView does not have any commands, but a subclass might.

  Specified by:
    `getContextCommands` in interface `ContextCommandsInterface`
  Parameters:
    `context` - The context to return commands for.
    `x` - The horizontal coordinate of the location within the visual coordinate space of the context for which the caller would like commands. For example, if this method is being called in response to a mouse click, then x would be the x-position of the click. If the caller doesn't have a location in mind, `-1` should be specified.
    `y` - The vertical coordinate of the location within the visual coordinate space of the context for which the caller would like commands. For example, if this method is being called in response to a mouse click, then y would be the y-position of the click. If the caller doesn't have a location in mind, `-1` should be specified.
  Returns:
    An array of commands.
  See Also:
    `ContextCommandsInterface`

### hold

    public void hold(CellVector cellVector)

  "Holds" a given column or row. A held column/row is one that has been made non-scrollable and is thus always, space permitting, displayed; i.e. it is never scrolled out of view.

  The order in which columns/rows are held controls the order in which they are displayed.

  Does nothing if the column/row is already held.

  Parameters:
    `cellVector` - The column or row to hold.
  See Also:
    `release(com.sas.table.CellVector)`, `getHeldColumns()`, `getHeldRows()`, `CellVector.isHeld()`

### getCell

    public DataCell getCell(Row row,
                            Column col)

  Returns the cell at the intersection of a given row and column.

  Parameters:
    `row` - The desired cell's row.
    `col` - The desired cell's column.
  Returns:
    The requested cell.
  See Also:
    `getColumn(int)`, `getRow(int)`

### getColumn

    public Column getColumn(int index)

  Returns the column at a given index.

  Parameters:
    `index` - The position of the column using one-based indexing.
  Returns:
    The column associated with the index.
  Throws:
    `java.lang.IndexOutOfBoundsException` - If index is not in the range [1, getModelInterface().getColumnCount()].
  See Also:
    `getCell(com.sas.table.Row, com.sas.table.Column)`, `getRow(int)`

### getRow

    public Row getRow(int index)

  Returns the row at a given index.

  Parameters:
    `index` - The position of the row using one-based indexing.
  Returns:
    The row associated with the index.
  Throws:
    `java.lang.IndexOutOfBoundsException` - If index is not in the range [1, getModelInterface().getRowCount()].
  See Also:
    `getColumn(int)`, `getCell(com.sas.table.Row, com.sas.table.Column)`

### initialize

    public void initialize()

  Initialization: register as listener to default styles, and set default model (if appropriate).

  Specified by:
    `initialize` in interface `com.sas.ComponentInterface`
  Overrides:
    `initialize` in class `ContainerVisualComponent`
  See Also:
    `ComponentInterface.initialize()`

### isDefaultModelAttached

    public final boolean isDefaultModelAttached()

  Returns whether the default model is attached. Alias for `(getDefaultModel() == getModelInterface() && (getDefaultModel() != null)`

  Specified by:
    `isDefaultModelAttached` in interface `com.sas.ViewDefaultModelInterface`
  See Also:
    `getDefaultModel()`

### isFullPaintDisabled

    public boolean isFullPaintDisabled()

  Returns whether full painting is disabled.

  Returns:
    `true` if full painting is disabled, and `false` otherwise.
  See Also:
    `disableFullPaint()`, `enableFullPaint()`

### paint

    public void paint(java.awt.Graphics g)

  Paints this component. Calls super to paint component border, then either returns if isFullPaintDisabled() returns `true`, or calls updateView() and paintTable().

  Overrides:
    `paint` in class `ContainerVisualComponent`
  Parameters:
    `g` - The graphics context to use for painting.
  See Also:
    `VisualInterfaceSupport.paint(com.sas.ComponentInterface, com.sas.awt.VisualInterface, java.awt.Component, java.awt.Graphics)`

### print

    public void print(java.awt.Graphics g)

  Prints this component.

  The default implementation of this method calls the `paint` method.

  Overrides:
    `print` in class `java.awt.Container`
  Parameters:
    `g` - the graphics context to use for printing.

### print

    public void print(java.awt.Graphics g,
                      int pageNumber,
                      int pageWidth,
                      int pageHeight)
               throws com.sas.awt.print.PrintException

  Prints the requested page.

  Specified by:
    `print` in interface `com.sas.awt.print.PrintableInterface`
  Overrides:
    `print` in class `ContainerVisualComponent`
  Parameters:
    `g` - The graphics context to use for printing.
    `pageNumber` - The one-based index of the page to be printed.
    `pageWidth` - The width of the page (in pixels) being printed to.
    `pageHeight` - The height of the page (in pixels) being printed to.
  Throws:
    `com.sas.awt.print.PrintException` - Thrown if a failure occurred while printing.
    `java.lang.IndexOutOfBoundsException` - Thrown if `pageExists(pageNumber)` is `false`.
  See Also:
    `PrintableInterface.print(java.awt.Graphics, int, int, int)`

### nextPrintScrollDirection

    public int nextPrintScrollDirection()

  Get the direction needed for the next scroll of the table. This will return either PrintScrollInterface.HORIZONTAL, VERTICAL, or NONE based on what direction the table was scrolled in last. THIS ONLY WORKS WHILE PRINTING.

  Specified by:
    `nextPrintScrollDirection` in interface `com.sas.awt.print.PrintScrollInterface`
  Returns:
    PrintScrollInterface HORIZONTAL, VERTICAL, or NONE based on the next scroll needed for the table.

### previousPrintScrollDirection

    public int previousPrintScrollDirection()

  Get the direction of the previous scroll. This will return either PrintScrollInterface.HORIZONTAL, VERTICAL, or NONE based on what direction the table was scrolled in last. THIS ONLY WORKS WHILE PRINTING.

  Specified by:
    `previousPrintScrollDirection` in interface `com.sas.awt.print.PrintScrollInterface`

### isPrintScrollNeeded

    public boolean isPrintScrollNeeded(int direction)

  Get if a scroll is needed in the specified direction to show more data. THIS ONLY WORKS WHILE PRINTING. Valid directions are: PrintScrollInterface.HORIZONTAL or PrintScrollInterface.VERTICAL

  Specified by:
    `isPrintScrollNeeded` in interface `com.sas.awt.print.PrintScrollInterface`
  Returns:
    true if more data is available in the specified direction, false otherwise.

### printInitialize

    public void printInitialize(java.awt.Graphics g)
                         throws com.sas.awt.print.PrintException

  Notification that printing is about to begin.

  Specified by:
    `printInitialize` in interface `com.sas.awt.print.PrintableInterface`
  Overrides:
    `printInitialize` in class `ContainerVisualComponent`
  Parameters:
    `g` - A graphics context for the device being printed to.
  Throws:
    `com.sas.awt.print.PrintException` - Thrown if a failure occurred while initializing.
  See Also:
    `PrintableInterface.printInitialize(java.awt.Graphics)`

### printFinalize

    public void printFinalize()

  Notification that printing is complete.

  Specified by:
    `printFinalize` in interface `com.sas.awt.print.PrintableInterface`
  Overrides:
    `printFinalize` in class `ContainerVisualComponent`
  See Also:
    `PrintableInterface.printFinalize()`

### pageExists

    public boolean pageExists(int pageNumber)

  Determines if a given page exists.

  `pageExists(n)` may be called anytime it's legal to call `print()` with the same page number n.

  Specified by:
    `pageExists` in interface `com.sas.awt.print.PrintableInterface`
  Overrides:
    `pageExists` in class `ContainerVisualComponent`
  Parameters:
    `pageNumber` - The one-based index of the page to verify.
  Returns:
    `true` if the page exists, and `false` otherwise.
  See Also:
    `PrintableInterface.pageExists(int)`

### getPageBounds

    public java.awt.Rectangle getPageBounds(java.awt.Graphics g,
                                            int pageNumber,
                                            int pageWidth,
                                            int pageHeight)

  Returns the bounds of a given page.

  `getPageBounds(n)` may be called anytime it's legal to call `print()` with the same page number n.

  Specified by:
    `getPageBounds` in interface `com.sas.awt.print.PrintableInterface`
  Overrides:
    `getPageBounds` in class `ContainerVisualComponent`
  Parameters:
    `g` - The graphics context to use for printing.
    `pageNumber` - The one-based index of the page to measure.
    `pageWidth` - The width of the page (in pixels) being printed to.
    `pageHeight` - The height of the page (in pixels) being printed to.
  Returns:
    The page's bounds relative to (0,0) in pixels.
  See Also:
    `print(java.awt.Graphics)`

### getPrintOptionsPanel

    public java.awt.Panel getPrintOptionsPanel()

  Returns a gui for specifying a row or column major print order.

  Specified by:
    `getPrintOptionsPanel` in interface `com.sas.awt.print.PrintableInterface`
  Overrides:
    `getPrintOptionsPanel` in class `ContainerVisualComponent`
  Returns:
    A java.awt.Panel.
  See Also:
    `setPrintOrder(int)`

### getPrintOrder

    public int getPrintOrder()

  Returns a constant that indicates how the table should be split into multiple pages when printed.

  Returns:
    `ROW_MAJOR` (the default) or `COLUMN_MAJOR`.
  See Also:
    `ROW_MAJOR`, `COLUMN_MAJOR`, `setPrintOrder(int)`

### setPrintOrder

    public void setPrintOrder(int newValue)

  Specifies how the table should be split into multiple pages when printed.

  Parameters:
    `newValue` - `ROW_MAJOR` or `COLUMN_MAJOR`.
  See Also:
    `ROW_MAJOR`, `COLUMN_MAJOR`, `getPrintOrder()`

### refresh

    public final void refresh()

  Alias for `refresh(getModelInterface())`.

### refresh

    public void refresh(com.sas.ModelInterface model)

  Notifies the view that a model has changed. Usually only needed if the model is not a ContentsChangedSource, as the view will listen for ContentsChangedEvents and refresh itself.

  Specified by:
    `refresh` in interface `com.sas.ViewInterface`
  Overrides:
    `refresh` in class `ContainerVisualComponent`
  Parameters:
    `model` - The changed model.
  See Also:
    `ViewInterface.refresh(com.sas.ModelInterface)`

### refreshModifiedCells

    public void refreshModifiedCells()

  Refreshes any modified cells to their values as maintained by the model. Use this method to cancel a set of edits that have not yet been committed to the model (the set of modified cells), or a set of edits that have been rejected by the model (the set of invalid cells). The set of modified cells and the set of invalid cells will both be empty following the execution of this method.

  See Also:
    `commitModifiedCells()`, `getModifiedCells()`, `getInvalidCells()`

### release

    public void release(CellVector cellVector)

  "Releases" a given column or row. The column/row is returned to its normal scroll position.

  Does nothing if the column/row is not held.

  Parameters:
    `cellVector` - The column/row to release.
  See Also:
    `hold(com.sas.table.CellVector)`, `releaseAllColumns()`, `releaseAllRows()`

### releaseAllColumns

    public void releaseAllColumns()

  Releases any held columns. All columns will be scrollable again.

  See Also:
    `release(com.sas.table.CellVector)`

### releaseAllRows

    public void releaseAllRows()

  Releases any held rows. All rows will be scrollable again.

  See Also:
    `release(com.sas.table.CellVector)`

### remeasureAllColumns

    public void remeasureAllColumns(boolean preserveResizes)

  Resets all columns to their preferred width.

  Parameters:
    `preserveResizes` - if `true` don't remeasure columns that have been explicitly resized.
  See Also:
    `remeasureAllRows(boolean)`

### remeasureAllRows

    public void remeasureAllRows(boolean preserveResizes)

  Resets all rows to their preferred height.

  Parameters:
    `preserveResizes` - if `true` don't remeasure rows that have been explicitly resized.
  See Also:
    `remeasureAllColumns(boolean)`

### removeItemListener

    public void removeItemListener(java.awt.event.ItemListener listener)

  Removes a listener of java.awt.event.ItemEvent which are generated when items are selected and deselected in the table.

  Specified by:
    `removeItemListener` in interface `java.awt.ItemSelectable`
  Parameters:
    `listener` - An object previously registered with addItemListener().

### repaint

    public void repaint()

  Repaints this component.

  Overrides:
    `repaint` in class `java.awt.Component`

### repaint

    public void repaint(int x,
                        int y,
                        int width,
                        int height)

  Repaints the specified rectangle of this component.

  Overrides:
    `repaint` in class `java.awt.Component`
  Parameters:
    `x` - The x coordinate of the rectangle in pixels relative to the top-left corner of the component.
    `y` - The y coordinate of the rectangle in pixels relative to the top-left corner of the component.
    `width` - The width of the rectangle in pixels.
    `height` - The height of the rectangle in pixels.
  See Also:
    `Component.repaint()`

### repaintColumns

    public void repaintColumns()

  Repaint the whole table except for the row labels.

  See Also:
    `repaintRows()`, `repaint()`, `Column.repaint()`

### repaintRows

    public void repaintRows()

  Repaint the whole table except for the column labels.

  See Also:
    `repaintColumns()`, `repaint()`, `Row.repaint()`

### scrollHorizontally

    public void scrollHorizontally(int numUnits,
                                   int unit)

  Scrolls the table horizontally.

  Specified by:
    `scrollHorizontally` in interface `ScrollingInterface`
  Parameters:
    `numUnits` - Indicates the direction and amount to scroll. A positive number scrolls forward (right). A negative number scrolls backward (left).
    `unit` - Indicates how to interpret numUnits. Must be one of: SCROLL_COLUMN, SCROLL_PAGE, SCROLL_MAXIMUM.
  See Also:
    `scrollVertically(int, int)`

### scrollVertically

    public void scrollVertically(int numUnits,
                                 int unit)

  Scrolls the table vertically.

  Specified by:
    `scrollVertically` in interface `ScrollingInterface`
  Parameters:
    `numUnits` - Indicates the direction and amount to scroll. A positive number scrolls forward (down). A negative number scrolls backward (up).
    `unit` - Indicates how to interpret numUnits. Must be one of: SCROLL_ROW, SCROLL_PAGE, SCROLL_MAXIMUM.
  See Also:
    `scrollHorizontally(int, int)`

### scrollToCell

    public void scrollToCell(Cell cell,
                             boolean makeFirst)

  Ensures that a cell is scrolled fully into view.

  Parameters:
    `cell` - The cell to scroll into view.
    `makeFirst` - If `true` make cell the first displayed cell; otherwise scroll the minimum amount necessary.

### scrollToColumn

    public void scrollToColumn(Column col,
                               boolean makeFirst)

  Ensures that a column is scrolled fully into view.

  Parameters:
    `col` - The column to scroll into view.
    `makeFirst` - If `true` make col the first column following the column of row labels; otherwise scroll the minimum amount necessary.

### scrollToRow

    public void scrollToRow(Row row,
                            boolean makeFirst)

  Ensures that a row is scrolled fully into view.

  Parameters:
    `row` - The row to scroll into view.
    `makeFirst` - If `true` make row the first row following the row of column labels; otherwise scroll the minimum amount necessary.

### select

    public void select(DataCell start,
                       DataCell end,
                       boolean extend)

  Selects a rectangular range of cells. (The range may be specified in any order.) The new selection replaces or extends the current selection set depending on the value of the extend parameter.

  Parameters:
    `start` - Identifies the first cell in the range, i.e. one of the "corners".
    `startCol` - Identifies the last cell in the range, i.e. the other "corner".
    `extend` - If `true` the selection extends the current selection set, otherwise it replaces it.

### select

    public void select(Column start,
                       Column end,
                       boolean extend)

  Selects a contiguous range of columns. (The range may be specified in any order.) The new selection replaces or extends the current selection set depending on the value of the extend parameter.

  Parameters:
    `start` - Identifies the first column in the range.
    `end` - Identifies the last column in the range.
    `extend` - If `true` the selection extends the current selection set, otherwise it replaces it.

### select

    public void select(Selection range,
                       boolean extend)

  Selects a range. The new selection replaces or extends the current selection set depending on the value of the extend parameter.

  Parameters:
    `range` - The range to select.
    `extend` - If `true` the selection extends the current selection set, otherwise it replaces it.

### select

    public void select(Row start,
                       Row end,
                       boolean extend)

  Selects a contiguous range of rows. (The range may be specified in any order.) The new selection replaces or extends the current selection set depending on the value of the extend parameter.

  Parameters:
    `start` - Identifies the first row in the range.
    `end` - Identifies the last row in the range.
    `extend` - If `true` the selection extends the current selection set, otherwise it replaces it.

### setBounds

    public void setBounds(int x,
                          int y,
                          int width,
                          int height)

  Moves and resizes this component.

  Specified by:
    `setBounds` in interface `VisualInterface`
  Overrides:
    `setBounds` in class `ContainerVisualComponent`
  Parameters:
    `x` - The new x-coordinate of this component.
    `y` - The new y-coordinate of this component.
    `width` - The new width of this component.
    `height` - The new height of this component.
  See Also:
    `VisualInterface.setBounds(int, int, int, int)`

### unselect

    public void unselect()

  Unselects all cells, columns, and rows.

### isActiveCellHighlighted

    public boolean isActiveCellHighlighted()

  Returns whether the active cell is visually distinguished from the other cells. When the current cell has been activated (usually when it's being edited), it is known as the active cell. The default is `true`.

  Returns:
    `true` if the active cell is highlighted, and `false` otherwise.
  See Also:
    `setActiveCellHighlighted(boolean)`

### setActiveCellHighlighted

    public void setActiveCellHighlighted(boolean newValue)

  Specifies whether the active cell is visually distinguished from the other cells. When the current cell has been activated (usually when it's being edited), it is known as the active cell. The default is `true`.

  Parameters:
    `newValue` - The new value to assign the activeCellHighlighted property.

### getCellTypeStyles

    public com.sas.collection.StaticDictionaryInterface getCellTypeStyles()

  Returns the set of cell types and their associated styles. The set is represented as a StaticDictionaryInterface with String keys corresponding to the types and CellStyle values corresponding to the styles.

  The cell types are defined by the model in order to categorize cells. For example, the cells in a column of numeric grades, 0 to 100, might be categorized as "pass" for grades 65 or greater and "fail" for grades less than 65.

  The CellStyles, one for each type, are provided by the view and can be individually customized. For example,

        StaticDictionaryInterface map = TableView.getCellTypeStyles ();
        CellStyle style = (CellStyle)map.get ("fail");
        style.setForegroundColor (Color.red);

  Returns:
    The value of the cellTypeStyles property; will never be `null`.
  See Also:
    `StaticTableTypeStylesInterface`

### getColumnLabelBounds

    public java.awt.Rectangle getColumnLabelBounds()

  Returns a rectangle that represents the location and size of the column label area.

  Returns:
    The copied value of the columnLabelBounds property.
  See Also:
    `getDataCellBounds()`, `getOriginCellBounds()`, `getPaintableBounds()`, `getRowLabelBounds()`, `getTableBounds()`

### isColumnLabelsVisible

    public boolean isColumnLabelsVisible()

  Returns whether column labels should be displayed. The default is `true`.

  Returns:
    `true` if column labels should be displayed, and `false` otherwise.
  See Also:
    `setColumnLabelsVisible(boolean)`, `isRowLabelsVisible()`

### setColumnLabelsVisible

    public void setColumnLabelsVisible(boolean newValue)

  Specifies whether column labels should be displayed. The default is `true`.

  Parameters:
    `newValue` - The new value to assign the columnLabelsVisible property.
  See Also:
    `isColumnLabelsVisible()`, `setRowLabelsVisible(boolean)`

### isColumnsConformed

    public boolean isColumnsConformed()

  Returns whether columns are resized to fill the horizontal extent of the component. If columnsConformed is `true`, all columns are fully in view, and the percentage ratio of the collective width of the columns to the component's width is greater than columnsConformedThreshold, then the width of each column is increased proportionally so that the table completely fills the horizontal extent of the component. The default is `false`.

  Returns:
    `true` if columns are conformed, and `false` otherwise.
  See Also:
    `setColumnsConformed(boolean)`, `getColumnsConformedThreshold()`, `isRowsConformed()`

### setColumnsConformed

    public void setColumnsConformed(boolean newValue)

  Specifies whether columns should be resized to fill the horizontal extent of the component. See `isColumnsConformed()` for more details.

  Parameters:
    `newValue` - The new value to assign the columnsConformed property.
  See Also:
    `isColumnsConformed()`, `setColumnsConformedThreshold(int)`

### getColumnsConformedThreshold

    public int getColumnsConformedThreshold()

  Returns the percentage, 0 to 99, of the table's width to the component's width above which columns should be conformed. Ignored unless `isColumnsConformed()` returns `true`. The default is `0`.

  Returns:
    The value of the columnsConformedThreshold property.
  See Also:
    `setColumnsConformedThreshold(int)`, `isColumnsConformed()`

### setColumnsConformedThreshold

    public void setColumnsConformedThreshold(int newValue)

  Specifies the percentage, 0 to 99, of the table's width to the component's width above which columns should be conformed. Ignored unless `isColumnsConformed()` returns `true`.

  Parameters:
    `newValue` - The new value to assign the columnsConformedThreshold property.
  See Also:
    `getColumnsConformedThreshold()`, `setColumnsConformed(boolean)`

### isColumnsSelectedByLabel

    public boolean isColumnsSelectedByLabel()

  Returns whether a column label selection selects the entire column. Ignored unless `getSelectionElement()` returns `CELL` and `isMultipleSelectionAllowed()` returns `true`. The default is `true`.

  Returns:
    `true` if columns should be selectable via their label, and `false` otherwise.
  See Also:
    `setColumnsSelectedByLabel(boolean)`, `isRowsSelectedByLabel()`, `isTableSelectedByOriginCell()`

### setColumnsSelectedByLabel

    public void setColumnsSelectedByLabel(boolean newValue)

  Returns whether a column label selection selects the entire column. Ignored unless `getSelectionElement()` returns `CELL` and `isMultipleSelectionAllowed()` returns `true`. The default is `true`.

  See Also:
    `isColumnsSelectedByLabel()`, `setRowsSelectedByLabel(boolean)`, `setTableSelectedByOriginCell(boolean)`

### getCurrentElement

    public TableElement getCurrentElement()

  Returns the value of the current element. A return value of `null` indicates that no element is current. See `setCurrentElement()` for more details.

  Returns:
    The value of the currentElement property.
  See Also:
    `setCurrentElement(com.sas.table.TableElement)`

### setCurrentElement

    public void setCurrentElement(TableElement newValue)
                           throws java.beans.PropertyVetoException

  Sets the value of the current element. The current element is the anchor of the current selection, and if it is of type Cell identifies the cell which is receiving input events. Its type depends on the value of `getSelectionElement()` with possible types being Cell if the selection element is `CELL`, Column if the selection element is `COLUMN`, and Row if the selection element is `ROW`. Specify `null` to indicate that no element is current.

  Parameters:
    `newValue` - The new value to assign the currentElement property; its type must correspond with the selection element as described above.
  Throws:
    `java.beans.PropertyVetoException` - currentElement is a constrained, or vetoable, property, so a PropertyVetoException is thrown when the set gets vetoed.
  See Also:
    `getCurrentElement()`

### isCurrentElementHighlighted

    public boolean isCurrentElementHighlighted()

  Returns whether the current element is visually distinguished from the other selected elements. The default is `true`.

  Returns:
    `true` if the current element is highlighted, and `false` otherwise.
  See Also:
    `setCurrentElementHighlighted(boolean)`, `isActiveCellHighlighted()`, `getCurrentElement()`

### setCurrentElementHighlighted

    public void setCurrentElementHighlighted(boolean newValue)

  Returns whether the current element is visually distinguished from the other selected elements. The default is `true`.

  Parameters:
    `newValue` - The new value to assign the currentElementHighlighted property.
  See Also:
    `isCurrentElementHighlighted()`

### getDataCellBounds

    public java.awt.Rectangle getDataCellBounds()

  Returns a rectangle that represents the location and size of the data cell area.

  Returns:
    The copied value of the dataCellBounds property.
  See Also:
    `getColumnLabelBounds()`, `getOriginCellBounds()`, `getPaintableBounds()`, `getRowLabelBounds()`, `getTableBounds()`

### getDefaultCellStyle

    public CellStyle getDefaultCellStyle()

  Returns the set of style properties that serve as defaults for all cells.

  Returns:
    The value of the defaultCellStyle property; will never be `null`.
  See Also:
    `setDefaultCellStyle(com.sas.table.CellStyle)`, `getDefaultLabelStyle()`

### setDefaultCellStyle

    public void setDefaultCellStyle(CellStyle newValue)

  Specifies the set of style properties to use as defaults for all cells.

  Parameters:
    `newValue` - The new value to assign the defaultCellStyle property; it must be non-null.
  See Also:
    `getDefaultCellStyle()`, `setDefaultLabelStyle(com.sas.table.CellStyle)`

### getDefaultColumnStyle

    public ColumnStyle getDefaultColumnStyle()

  Returns the set of style properties that serve as defaults for all columns.

  Returns:
    The value of the defaultColumnStyle property; will never be `null`.
  See Also:
    `setDefaultColumnStyle(com.sas.table.ColumnStyle)`, `getDefaultRowStyle()`

### setDefaultColumnStyle

    public void setDefaultColumnStyle(ColumnStyle newValue)

  Specifies the set of style properties to use as defaults for all columns.

  Parameters:
    `newValue` - The new value to assign the defaultColumnStyle property; it must be non-null.
  See Also:
    `getDefaultColumnStyle()`, `setDefaultRowStyle(com.sas.table.RowStyle)`

### getDefaultInvalidCellStyle

    public CellStyle getDefaultInvalidCellStyle()

  Returns the set of style properties that serve as defaults for invalid cells. These properties will override the normal defaults for any cells that return `true` from `Cell.isDataInvalid()`. By default the foreground color is set to red.

  Returns:
    The value of the defaultInvalidCellStyle property; will never be `null`.
  See Also:
    `setDefaultInvalidCellStyle(com.sas.table.CellStyle)`, `getInvalidCells()`, `Cell.isDataInvalid()`

### setDefaultInvalidCellStyle

    public void setDefaultInvalidCellStyle(CellStyle newValue)

  Specifies the set of style properties to use as defaults for invalid cells. See `getDefaultInvalidCellStyle()` for more details.

  Parameters:
    `newValue` - The new value to assign the defaultInvalidCellStyle property; it must be non-null.
  See Also:
    `getDefaultInvalidCellStyle()`

### getDefaultLabelStyle

    public CellStyle getDefaultLabelStyle()

  Returns the set of style properties that serve as defaults for all labels.

  Returns:
    The value of the defaultLabelStyle property; will never be `null`.
  See Also:
    `setDefaultLabelStyle(com.sas.table.CellStyle)`, `getDefaultCellStyle()`

### setDefaultLabelStyle

    public void setDefaultLabelStyle(CellStyle newValue)

  Specifies the set of style properties to use as defaults for all labels.

  Parameters:
    `newValue` - The new value to assign the defaultLabelStyle property; it must be non-null.
  See Also:
    `getDefaultLabelStyle()`, `setDefaultCellStyle(com.sas.table.CellStyle)`

### getDefaultModel

    public com.sas.ModelInterface getDefaultModel()

  Returns the default model. The default model will be used as the view's model whenever its model would otherwise be `null`.

  Returns:
    The default model.
  See Also:
    `isDefaultModelAttached()`, `setDefaultModel(com.sas.ModelInterface)`

### setDefaultModel

    public void setDefaultModel(com.sas.ModelInterface newValue)

  Sets the default model. The default model will be used as the view's model whenever its model would otherwise be `null`.

  Parameters:
    `newValue` - The new value to assign the defaultModel property.
  See Also:
    `isDefaultModelAttached()`

### getDefaultRowStyle

    public RowStyle getDefaultRowStyle()

  Returns the set of style properties that serve as defaults for all rows.

  Returns:
    The value of the defaultRowStyle property; will never be `null`.
  See Also:
    `setDefaultRowStyle(com.sas.table.RowStyle)`, `getDefaultColumnStyle()`

### setDefaultRowStyle

    public void setDefaultRowStyle(RowStyle newValue)

  Specifies the set of style properties to use as defaults for all rows.

  Parameters:
    `newValue` - The new value to assign the defaultRowStyle property; it must be non-null.
  See Also:
    `getDefaultRowStyle()`, `setDefaultColumnStyle(com.sas.table.ColumnStyle)`

### getDisplayedColumns

    public com.sas.collection.StaticOrderedCollectionInterface getDisplayedColumns()

  Returns the set of columns that are currently scrolled into view.

  Returns:
    The value of the displayedColumns property; will never be `null`.
  See Also:
    `getDisplayedRows()`

### getDisplayedRows

    public com.sas.collection.StaticOrderedCollectionInterface getDisplayedRows()

  Returns the set of rows that are currently scrolled into view.

  Returns:
    The value of the displayedRows property; will never be `null`.
  See Also:
    `getDisplayedColumns()`

### isExtendedSelectionAllowed

    public boolean isExtendedSelectionAllowed()

  Returns whether selections can be extended. If `true` an existing selection can be extended or added-to via a non-contiguous selection action such as ctrl-click; if `false`an existing selection can not be extended and the non-contiguous selection action will simply act like a regular selection and replace the existing selection.

  The default is `true`.

  Note that this property has no effect on selections made programmatically.

  ``
  Returns:
    `true` if selections can be extended, and `false` otherwise.
  See Also:
    `setExtendedSelectionAllowed(boolean)`, `isMultipleSelectionAllowed()`

### setExtendedSelectionAllowed

    public void setExtendedSelectionAllowed(boolean newValue)

  Specifies whether selections can be extended. See `isExtendedSelectionAllowed()` for more details.

  Parameters:
    `newValue` - The new value to assign the extendedSelectionAllowed property.
  See Also:
    `isExtendedSelectionAllowed()`, `setMultipleSelectionAllowed(boolean)`

### isFocusTraversable

    public boolean isFocusTraversable()

  Returns whether this component can be traversed using tab or shift-tab keyboard focus traversal.

  Overrides:
    `isFocusTraversable` in class `java.awt.Component`
  Returns:
    `true` in order to receive focus from tab and shift-tab key events in our parent container.

### setFont

    public void setFont(java.awt.Font newValue)

  Sets the font of this component. Cells will be displayed in this font if not specified otherwise via style properties (CellStyle.fontStyle).

  Specified by:
    `setFont` in interface `VisualInterface`
  Overrides:
    `setFont` in class `ContainerVisualComponent`
  Parameters:
    `newValue` - The new value to assign the font property.
  See Also:
    `Component.getFont()`

### getGraphics

    public java.awt.Graphics getGraphics()

  Creates a graphics context for this component. This method will return `null` if this component is currently not on the screen.

  Overrides:
    `getGraphics` in class `java.awt.Component`
  Returns:
    A graphics context for this component, or `null` if it has none.

### getGridColor

    public java.awt.Color getGridColor()

  Returns the color of the grid lines.

  Returns:
    The value of the gridColor property; will never be `null`.

### setGridColor

    public void setGridColor(java.awt.Color newValue)

  Specifies the color of the grid lines.

  Parameters:
    `newValue` - The new value to assign the gridColor property; it must be non-null.

### isGridVisible

    public boolean isGridVisible()

  Returns whether grid lines are drawn over the data cells. The default is `true`.

  Returns:
    `true` if grid lines are drawn, and `false` otherwise

### setGridVisible

    public void setGridVisible(boolean newValue)

  Specifies whether grid lines are drawn over the data cells. The default is `true`.

  Parameters:
    `newValue` - The new value to assign the gridVisible property.

### getHeldColumns

    public com.sas.collection.StaticOrderedCollectionInterface getHeldColumns()

  Returns the set of held columns. Held columns are columns that have been made non-scrollable.

  Returns:
    The value of the heldColumns property; will never be null.
  See Also:
    `hold(com.sas.table.CellVector)`

### getHeldRows

    public com.sas.collection.StaticOrderedCollectionInterface getHeldRows()

  Returns the set of held rows. Held rows are rows that have been made non-scrollable.

  Returns:
    The value of the heldRows property; will never be null.
  See Also:
    `hold(com.sas.table.CellVector)`

### getHorizontalScrollbarVisibility

    public int getHorizontalScrollbarVisibility()

  Returns a constant indicating whether the horizontal scrollbar is always visible, never visible, or visible only as needed.

  Specified by:
    `getHorizontalScrollbarVisibility` in interface `ScrollbarVisibilityInterface`
  Returns:
    SCROLLBARS_AS_NEEDED, SCROLLBARS_ALWAYS, or SCROLLBARS_NEVER.
  See Also:
    `ScrollbarVisibilityInterface`, `setHorizontalScrollbarVisibility(int)`, `getVerticalScrollbarVisibility()`

### setHorizontalScrollbarVisibility

    public void setHorizontalScrollbarVisibility(int newValue)

  Specifies when a horizontal scrollbar should be used: always, never, or as needed.

  Specified by:
    `setHorizontalScrollbarVisibility` in interface `ScrollbarVisibilityInterface`
  Parameters:
    `newValue` - The newValue to assign the horizontalScrollbarVisibility property. Possible values are SCROLLBARS_AS_NEEDED, SCROLLBARS_ALWAYS, and SCROLLBARS_NEVER.
  See Also:
    `ScrollbarVisibilityInterface`, `getHorizontalScrollbarVisibility()`, `setVerticalScrollbarVisibility(int)`

### getInvalidCells

    public com.sas.collection.StaticOrderedCollectionInterface getInvalidCells()

  Returns the set of cells that are invalid. Invalid cells are cells that have had their values edited, but were rejected when attempting to commit those values to the model. Thus invalid cells are also members of the set of modified cells.

  Invalid cells can be displayed specially, such as with red text, via the defaultInvalidCellStyle.

  Returns:
    The value of the invalidCells property; will be never be `null`.
  See Also:
    `commitModifiedCells()`, `refreshModifiedCells()`, `getModifiedCells()`, `getDefaultInvalidCellStyle()`

### setModelInterface

    public void setModelInterface(com.sas.ModelInterface newValue)

  Specifies the model to display in the view. The model must implement StaticTableInterface. Pass `null` to disassociate the view from its model.

  Specified by:
    `setModelInterface` in interface `com.sas.ViewInterface`
  Overrides:
    `setModelInterface` in class `ContainerVisualComponent`
  Parameters:
    `newValue` - The new value to assign the modelInterface property.
  See Also:
    `ViewInterface.setModelInterface(com.sas.ModelInterface)`

### getModifiedCells

    public com.sas.collection.StaticOrderedCollectionInterface getModifiedCells()

  Returns the set of cells that have been modified. Modified cells are cells that have had their values edited, but not committed to the model.

  Returns:
    The value of the modifiedCells property; will be never be `null`.
  See Also:
    `commitModifiedCells()`, `refreshModifiedCells()`, `getInvalidCells()`

### isMultipleSelectionAllowed

    public boolean isMultipleSelectionAllowed()

  Returns whether a single interactive selection action can span more than one element. If `true`, multiple elements can be interactively selected at once as with a mouse drag, a shift-click, or a shift-arrow-key; if `false`, they can't. The default is `true`. Note this property has no effect on selections made programmatically.

  Returns:
    `true` if multiple selection is allowed, and `false` otherwise.
  See Also:
    `setMultipleSelectionAllowed(boolean)`, `isExtendedSelectionAllowed()`, `isSelectionAllowed()`

### setMultipleSelectionAllowed

    public void setMultipleSelectionAllowed(boolean newValue)

  Specifies whether a single interactive selection action can span more than one element. See `isMultipleSelectionAllowed()` for more details.

  Parameters:
    `newValue` - The new value to assign the multipleSelectionAllowed property.
  See Also:
    `isMultipleSelectionAllowed()`, `setExtendedSelectionAllowed(boolean)`, `setSelectionAllowed(boolean)`

### getOriginCell

    public LabelCell getOriginCell()

  Returns the cell at the intersection of the row of column labels and the column of row labels.

  Returns:
    The value of the originCell property; will be never be `null`.

### getOriginCellBounds

    public java.awt.Rectangle getOriginCellBounds()

  Returns a rectangle that represents the location and size of the origin cell. The origin cell is the cell at the intersection of the row of column labels and the column of row labels.

  Returns:
    The copied value of the originCellBounds property.
  See Also:
    `getColumnLabelBounds()`, `getDataCellBounds()`, `getPaintableBounds()`, `getRowLabelBounds()`, `getTableBounds()`

### getPaintableBounds

    public java.awt.Rectangle getPaintableBounds()

  Returns a rectangle that represents the location and size of the paintable area. The paintable area is the area of the component that can be used by the table, i.e. the area left after applying insets and accounting for the scrollbars.

  Returns:
    The copied value of the paintableBounds property.
  See Also:
    `getColumnLabelBounds()`, `getDataCellBounds()`, `getOriginCellBounds()`, `getRowLabelBounds()`, `getTableBounds()`

### isPartialColumnVisible

    public boolean isPartialColumnVisible()

  Returns whether the displayed column furthest from the row labels should be shown even if it's only partially displayed (clipped). If `true` partial columns will be displayed; if `false` partial columns will not be displayed. It's ignored if there's only one displayed column. The default is `true`.

  Returns:
    `true` if a partial column should be displayed, and `false` otherwise.
  See Also:
    `setPartialColumnVisible(boolean)`, `isPartialRowVisible()`

### setPartialColumnVisible

    public void setPartialColumnVisible(boolean newValue)

  Specifies whether the displayed column furthest from the row labels should be shown even if it's only partially displayed (clipped). See `isPartialColumnVisible()` for more details.

  Parameters:
    `newValue` - The new value to assign the partialColumnVisible property.
  See Also:
    `isPartialColumnVisible()`, `setPartialRowVisible(boolean)`

### isPartialRowVisible

    public boolean isPartialRowVisible()

  Returns whether the displayed row furthest from the column labels should be shown even if it's only partially displayed (clipped). If `true` partial rows will be displayed; if `false` partial rows will not be displayed. It's ignored if there's only one displayed row. The default is `true`.

  Returns:
    `true` if a partial row should be displayed, and `false` otherwise.
  See Also:
    `setPartialRowVisible(boolean)`, `isPartialColumnVisible()`

### setPartialRowVisible

    public void setPartialRowVisible(boolean newValue)

  Specifies whether the displayed row furthest from the column labels should be shown even if it's only partially displayed (clipped). See `isPartialRowVisible()` for more details.

  Parameters:
    `newValue` - The new value to assign the partialRowVisible property.
  See Also:
    `isPartialRowVisible()`, `setPartialColumnVisible(boolean)`

### isPopupMenuVisible

    public boolean isPopupMenuVisible()

  Returns whether a popup menu will be shown when TableView receives the popup event.

  Returns:
    `true` if the popup menu will be shown, and `false` otherwise
  See Also:
    `setPopupMenuVisible(boolean)`

### setPopupMenuVisible

    public void setPopupMenuVisible(boolean newValue)

  Specifies whether a popup menu should be shown when TableView receives the popup event.

  Note that setting this to `true` does not guarantee that a popup menu will be shown; just that populatePopupMenu() will be driven giving subclasses a chance to populate one.

  In order to configure a popup menu without subclassing, create a PopupMenuAdapter and set popupMenuVisible to `false`, as the adapter has its own popup menu. Any commands provided by TableView, or its subclasses, can still be used with the adapter's menu because TableView implements ContextCommandsInterface, and therefore it can be registered with the adapter via `addContextCommandsProducer()`.

  Parameters:
    `newValue` - `true` if the popup menu should be shown, and `false` otherwise

### getRequiredInterfaces

    public java.util.Vector getRequiredInterfaces()

  Returns the interfaces required of a model by this view.

  Specified by:
    `getRequiredInterfaces` in interface `com.sas.ViewInterface`
  Overrides:
    `getRequiredInterfaces` in class `ContainerVisualComponent`
  Returns:
    The required interfaces.
  See Also:
    `ViewInterface.getRequiredInterfaces()`

### getRowLabelBounds

    public java.awt.Rectangle getRowLabelBounds()

  Returns a rectangle that represents the location and size of the row label area.

  Returns:
    The copied value of the rowLabelBounds property.
  See Also:
    `getColumnLabelBounds()`, `getDataCellBounds()`, `getOriginCellBounds()`, `getPaintableBounds()`, `getTableBounds()`

### isRowLabelsVisible

    public boolean isRowLabelsVisible()

  Returns whether row labels should be displayed. The default is `true`.

  Returns:
    `true` if row labels should be displayed, and `false` otherwise.
  See Also:
    `setRowLabelsVisible(boolean)`, `isColumnLabelsVisible()`

### setRowLabelsVisible

    public void setRowLabelsVisible(boolean newValue)

  Specifies whether row labels should be displayed. The default is `true`.

  Parameters:
    `newValue` - The new value to assign the rowLabelsVisible property.
  See Also:
    `isRowLabelsVisible()`, `setColumnLabelsVisible(boolean)`

### isRowsConformed

    public boolean isRowsConformed()

  Returns whether rows are resized to fill the vertical extent of the component. If rowsConformed is true, all rows are fully in view, and the percentage ratio of the collective height of the rows to the component's height is greater than rowsConformedThreshold, then the height of each row is increased proportionally so that the table completely fills the vertical extent of the component. The default is `false`.

  Returns:
    `true` if rows are conformed, and `false` otherwise.
  See Also:
    `setRowsConformed(boolean)`, `getRowsConformedThreshold()`, `isColumnsConformed()`

### setRowsConformed

    public void setRowsConformed(boolean newValue)

  Specifies whether rows should be resized to fill the vertical extent of the component. See `isRowsConformed()` for more details.

  Parameters:
    `newValue` - The new value to assign the rowsConformed property.
  See Also:
    `isRowsConformed()`, `setRowsConformedThreshold(int)`

### getRowsConformedThreshold

    public int getRowsConformedThreshold()

  Returns the percentage, 0 to 99, of the table's height to the component's height above which rows should be conformed. Ignored unless `isRowsConformed()` returns `true`. The default is `0`.

  Returns:
    The value of the rowsConformedThreshold property.
  See Also:
    `setRowsConformedThreshold(int)`, `isRowsConformed()`

### setRowsConformedThreshold

    public void setRowsConformedThreshold(int newValue)

  Specifies the percentage, 0 to 99, of the table's height to the component's height above which rows should be conformed. Ignored unless `isRowsConformed()` returns `true`. The default is `0`.

  Parameters:
    `newValue` - The new value to assign the rowsConformedThreshold property.
  See Also:
    `getRowsConformedThreshold()`, `setRowsConformed(boolean)`

### isRowsSelectedByLabel

    public boolean isRowsSelectedByLabel()

  Returns whether a row label selection selects the entire row. Ignored unless `getSelectionElement()` returns `CELL` and `isMultipleSelectionAllowed()` returns `true`. The default is `true`.

  Returns:
    `true` if rows should be selectable via their label, and `false` otherwise.
  See Also:
    `setRowsSelectedByLabel(boolean)`, `isColumnsSelectedByLabel()`, `isTableSelectedByOriginCell()`

### setRowsSelectedByLabel

    public void setRowsSelectedByLabel(boolean newValue)

  Specifies whether a row label selection selects the entire row. Ignored unless `getSelectionElement()` returns `CELL` and `isMultipleSelectionAllowed()` returns `true`. The default is `true`.

  See Also:
    `isRowsSelectedByLabel()`, `setColumnsSelectedByLabel(boolean)`, `setTableSelectedByOriginCell(boolean)`

### getSelectedCells

    public java.util.Enumeration getSelectedCells()

  Returns the set of selected cells. Just data cells, not label cells, are included.

  Returns:
    An java.util.Enumeration of DataCell.
  See Also:
    `getSelectedColumns()`, `getSelectedObjects()`, `getSelectedRanges()`, `getSelectedRows()`

### getSelectedColumns

    public java.util.Enumeration getSelectedColumns()

  Returns the set of selected columns.

  Returns:
    An java.util.Enumeration of Column.
  See Also:
    `getSelectedCells()`, `getSelectedObjects()`, `getSelectedRanges()`, `getSelectedRows()`

### getSelectedObjects

    public java.lang.Object[] getSelectedObjects()

  Returns the set of selected ranges (if any).

  Specified by:
    `getSelectedObjects` in interface `java.awt.ItemSelectable`
  Returns:
    An array of Selection or `null`.
  See Also:
    `getSelectedCells()`, `getSelectedColumns()`, `getSelectedRanges()`, `getSelectedRows()`

### getSelectedRanges

    public java.util.Enumeration getSelectedRanges()

  Returns the set of selected ranges.

  Returns:
    An java.util.Enumeration of Selection.
  See Also:
    `getSelectedCells()`, `getSelectedColumns()`, `getSelectedObjects()`, `getSelectedRows()`

### getSelectedRows

    public java.util.Enumeration getSelectedRows()

  Returns the set of selected rows.

  Returns:
    An java.util.Enumeration of Row.
  See Also:
    `getSelectedCells()`, `getSelectedColumns()`, `getSelectedObjects()`, `getSelectedRanges()`

### isSelectionAllowed

    public boolean isSelectionAllowed()

  Returns whether interactive selections can be made. If `true` selections can be made; if `false` selections can not be made. The default is `true`. Note this property has no effect on selections made programmatically.

  Returns:
    `true` if selection is allowed, and `false` otherwise.
  See Also:
    `setSelectionAllowed(boolean)`, `isExtendedSelectionAllowed()`, `isMultipleSelectionAllowed()`

### setSelectionAllowed

    public void setSelectionAllowed(boolean newValue)

  Specifies whether interactive selections can be made. See `isSelectionAllowed()` for more details.

  Parameters:
    `newValue` - The new value to assign the selectionAllowed property.
  See Also:
    `isSelectionAllowed()`, `setExtendedSelectionAllowed(boolean)`, `setMultipleSelectionAllowed(boolean)`

### getSelectionElement

    public int getSelectionElement()

  Returns the type of table element that is selected when an interactive selection is made. Its possible values are `CELL` (the default), `COLUMN`, and `ROW`. Note that this property has no effect on selections made programmatically.

  Returns:
    The value of the selectionElement property.

### setSelectionElement

    public void setSelectionElement(int newValue)

  Specifies the type of table element that is selected when an interactive selection is made. Its possible values are `CELL` (the default), `COLUMN`, and `ROW`. Note that this property has no effect on selections made programmatically.

  Parameters:
    `newValue` - The new value to assign the selectionElement property.

### getTableBounds

    public final java.awt.Rectangle getTableBounds()

  Returns a rectangle that represents the location and size of the table within the component's bounds. In other words, where the "ink" is.

  Returns:
    The copied value of the tableBounds property.
  See Also:
    `getColumnLabelBounds()`, `getDataCellBounds()`, `getOriginCellBounds()`, `getPaintableBounds()`, `getRowLabelBounds()`

### isTableSelectedByOriginCell

    public boolean isTableSelectedByOriginCell()

  Returns whether a selection of the origin cell selects the entire table. Ignored unless `getSelectionElement()` returns `CELL` and `isMultipleSelectionAllowed()` returns `true`. The default is `false`.

  Returns:
    `true` if the table is selectable via the orign cell, and `false` otherwise.
  See Also:
    `setTableSelectedByOriginCell(boolean)`, `isColumnsSelectedByLabel()`, `isRowsSelectedByLabel()`, `getOriginCell()`

### setTableSelectedByOriginCell

    public void setTableSelectedByOriginCell(boolean newValue)

  Specifies whether a selection of the origin cell selects the entire table. Ignored unless `getSelectionElement()` returns `CELL` and `isMultipleSelectionAllowed()` returns `true`. The default is `false`.

  Parameters:
    `newValue` - The new value to assign the tableSelectedByOriginCell property.
  See Also:
    `isTableSelectedByOriginCell()`, `setColumnsSelectedByLabel(boolean)`, `setRowsSelectedByLabel(boolean)`

### getTransactionElement

    public int getTransactionElement()

  Returns how often modified cells are committed to the model. Possible values are `CELL, COLUMN, ROW, and USER_DEFINED`.

  When transactionElement is `CELL`, modified cells are committed whenever a cell is deactivated.

  When transactionElement is `COLUMN`, modified cells are committed whenever the current column is changed.

  When transactionElement is `ROW`, modified cells are committed whenever the current row is changed.

  When transactionElement is `USER_DEFINED`, modified cells are committed only when `commitModifiedCells()` is called.

  Returns:
    The value of the transactionElement property.
  See Also:
    `setTransactionElement(int)`, `commitModifiedCells()`

### setTransactionElement

    public void setTransactionElement(int newValue)

  Specifies how often modified cells are committed to the model. See `getTransactionElement()` for more details.

  Parameters:
    `newValue` - The new value to assign the transactionElement property.
  See Also:
    `getTransactionElement()`

### getVerticalScrollbarVisibility

    public int getVerticalScrollbarVisibility()

  Returns a constant indicating whether the vertical scrollbar is always visible, never visible, or visible only as needed.

  Specified by:
    `getVerticalScrollbarVisibility` in interface `ScrollbarVisibilityInterface`
  Returns:
    SCROLLBARS_AS_NEEDED, SCROLLBARS_ALWAYS, or SCROLLBARS_NEVER.
  See Also:
    `ScrollbarVisibilityInterface`, `setVerticalScrollbarVisibility(int)`, `getHorizontalScrollbarVisibility()`

### setVerticalScrollbarVisibility

    public void setVerticalScrollbarVisibility(int newValue)

  Specifies when a vertical scrollbar should be used: always, never, or as needed.

  Specified by:
    `setVerticalScrollbarVisibility` in interface `ScrollbarVisibilityInterface`
  Parameters:
    `newValue` - The newValue to assign the verticalScrollbarVisibility property. Possible values are SCROLLBARS_AS_NEEDED, SCROLLBARS_ALWAYS, and SCROLLBARS_NEVER.
  See Also:
    `ScrollbarVisibilityInterface`, `getVerticalScrollbarVisibility()`, `setHorizontalScrollbarVisibility(int)`

### attachModel

    public void attachModel(com.sas.ModelInterface model)

  Framework method; call setModelInterface(model) instead.

  Associates a model with this view. This view can only be associated with a single model at a time, therefore detachModel() must be called between two calls to attachModel().

  Specified by:
    `attachModel` in interface `com.sas.ViewInterface`
  Overrides:
    `attachModel` in class `ContainerVisualComponent`
  Parameters:
    `model` - The model to attach. It must implement StaticTableInterface.
  See Also:
    `ViewInterface.attachModel(com.sas.ModelInterface)`

### detachModel

    public void detachModel(com.sas.ModelInterface model)

  Framework method; call setModelInterface(null) instead.

  Disassociates a model from this view.

  Specified by:
    `detachModel` in interface `com.sas.ViewInterface`
  Overrides:
    `detachModel` in class `ContainerVisualComponent`
  Parameters:
    `model` - The model to detach. Must have been previously attached via attachModel(model) instead.
  See Also:
    `ViewInterface.detachModel(com.sas.ModelInterface)`

### adjustmentValueChanged

    public void adjustmentValueChanged(java.awt.event.AdjustmentEvent event)

  Processes an java.awt.event.AdjustmentEvent sent by the scrollbars. This is logically a protected method which is public solely to satisfy the java.awt.event.AdjustmentListener.html interface.

  Specified by:
    `adjustmentValueChanged` in interface `java.awt.event.AdjustmentListener`
  Parameters:
    `event` - The event to react to.

### contentsChanged

    public void contentsChanged(com.sas.collection.ContentsChangedEvent event)

  Processes a com.sas.collection.ContentsChangedEvent sent by the model. This is logically a protected method which is public solely to satisfy the com.sas.collection.ContentsChangedListener interface.

  Implementation note: The events are simply queued-up here and processed later, so subclasses will likely want to override processContentsChangedEvent() instead.

  Specified by:
    `contentsChanged` in interface `com.sas.collection.ContentsChangedListener`
  Parameters:
    `event` - The event to react to.

### propertyBagChanged

    public void propertyBagChanged(com.sas.collection.PropertyBagChangedEvent e)

  Processes a com.sas.collection.PropertyBagChangedEvent sent by a style. This is logically a protected method which is public solely to satisfy the com.sas.collection.PropertyBagChangedListener interface.

  Specified by:
    `propertyBagChanged` in interface `com.sas.collection.PropertyBagChangedListener`
  Parameters:
    `e` - The event to react to.

### propertyChange

    public void propertyChange(java.beans.PropertyChangeEvent e)

  Processes a java.beans.PropertyChangeEvent sent by the model. This is logically a protected method which is public solely to satisfy the java.beans.PropertyChangeListener interface.

  Specified by:
    `propertyChange` in interface `java.beans.PropertyChangeListener`
  Overrides:
    `propertyChange` in class `ContainerVisualComponent`
  Parameters:
    `e` - The event to react to.
  See Also:
    `PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)`

### setDefaultValues

    public void setDefaultValues()

  Sets default values for this component's non-transient fields. This is logically a protected method which is public solely to satisfy ContainerInterface.

  Specified by:
    `setDefaultValues` in interface `ContainerInterface`
  Specified by:
    `setDefaultValues` in interface `VisualInterface`
  Specified by:
    `setDefaultValues` in interface `com.sas.ComponentInterface`
  Overrides:
    `setDefaultValues` in class `CompositeContainer`
  Throws:
    `java.lang.IllegalStateException` - Thrown if called a second time.
  See Also:
    `ContainerInterface.setDefaultValues()`

### clone

    protected TableView clone(double horizontalScale,
                              double verticalScale)
                       throws java.lang.CloneNotSupportedException

  Clones this component.

  Constructs a clone, then calls `cloneModelIndependentState (clone, horizontalScale, verticalScale)` followed by `cloneModelDependentState (clone, horizontalScale, verticalScale)`.

  Parameters:
    `horizontalScale` - Specifies the scaling factor that should be applied to any x-pixel values such as column widths. Normally one is specified, but if the clone is to be parented to a container (device) that has a different horizontal resolution than is in effect for this component, then the ratio of that resolution to the resolution in effect should be specified so that pixel values can be appropriately scaled.
    `verticalScale` - Specifies the scaling factor that should be applied to any y-pixel values such as row heights. Normally one is specified, but if the clone is to be parented to a container (device) that has a different vertical resolution than is in effect for this component, then the ratio of that resolution to the resolution in effect should be specified so that pixel values can be appropriately scaled.
  Returns:
    A clone of this component.
  Throws:
    `java.lang.CloneNotSupportedException` - TableView supports cloning, but a subclass may not.
  See Also:
    `cloneModelIndependentState(com.sas.table.TableView, double, double)`, `cloneModelDependentState(com.sas.table.TableView, double, double)`

### cloneModelDependentState

    protected void cloneModelDependentState(TableView clone,
                                            double horizontalScale,
                                            double verticalScale)
                                     throws java.lang.CloneNotSupportedException

  Clones this component's model dependent state. "Model dependent state" refers to the properties that are related to the data being viewed such as the sizes of individual rows and columns.

  Called by clone(double, double).

  Parameters:
    `clone` - The instance that is to be this component's clone.
    `horizontalScale` - Specifies the scaling factor that should be applied to any x-pixel values such as column widths. Normally one is specified, but if the clone is to be parented to a container (device) that has a different horizontal resolution than is in effect for this component, then the ratio of that resolution to the resolution in effect should be specified so that pixel values can be appropriately scaled.
    `verticalScale` - Specifies the scaling factor that should be applied to any y-pixel values such as row heights. Normally one is specified, but if the clone is to be parented to a container (device) that has a different vertical resolution than is in effect for this component, then the ratio of that resolution to the resolution in effect should be specified so that pixel values can be appropriately scaled.
  Throws:
    `java.lang.CloneNotSupportedException` - TableView supports cloning, but a subclass may not.
  See Also:
    `cloneModelIndependentState(com.sas.table.TableView, double, double)`

### cloneModelIndependentState

    protected void cloneModelIndependentState(TableView clone,
                                              double horizontalScale,
                                              double verticalScale)
                                       throws java.lang.CloneNotSupportedException

  Clones this component's model independent state. "Model independent state" refers to the properties that are unrelated to the data being viewed such as selectionElement and defaultCellStyle .

  Called by clone(double, double).

  Parameters:
    `clone` - The instance that is to be this component's clone.
    `horizontalScale` - Specifies the scaling factor that should be applied to any x-pixel values such as column widths. Normally one is specified, but if the clone is to be parented to a container (device) that has a different horizontal resolution than is in effect for this component, then the ratio of that resolution to the resolution in effect should be specified so that pixel values can be appropriately scaled.
    `verticalScale` - Specifies the scaling factor that should be applied to any y-pixel values such as row heights. Normally one is specified, but if the clone is to be parented to a container (device) that has a different vertical resolution than is in effect for this component, then the ratio of that resolution to the resolution in effect should be specified so that pixel values can be appropriately scaled.
  Throws:
    `java.lang.CloneNotSupportedException` - TableView supports cloning, but a subclass may not.
  See Also:
    `cloneModelDependentState(com.sas.table.TableView, double, double)`

### createCell

    protected DataCell createCell(Row row,
                                  Column col)

  Factory method for creating cells. Default implementation instantiates a DataCell. Subclasses may override to provide a DataCell subclass.

  Parameters:
    `row` - The row that contains the cell.
    `col` - The column that contains the cell.
  Returns:
    A new cell.

### createColumn

    protected Column createColumn(int index)

  Factory method for creating columns. Default implementation instantiates a Column. Subclasses may override to provide a Column subclass.

  Parameters:
    `index` - The one-based position of the column in the model.
  Returns:
    A new column.

### createColumnLabel

    protected LabelCell createColumnLabel(Column col)

  Factory method for creating column labels. Default implementation instantiates a LabelCell. Subclasses may override to provide a LabelCell subclass.

  Parameters:
    `col` - The column that contains the label.
  Returns:
    A new label.

### createOriginCell

    protected LabelCell createOriginCell()

  Factory method for creating the cell associated with the origin cell. Default implementation instantiates a LabelCell. Subclasses may override to provide a LabelCell subclass.

  Returns:
    A new label.

### createRow

    protected Row createRow(int index)

  Factory method for creating rows. Default implementation instantiates a Row. Subclasses may override to provide a Row subclass.

  Parameters:
    `index` - The one-based position of the row in the model.
  Returns:
    A new row.

### createRowLabel

    protected LabelCell createRowLabel(Row row)

  Factory method for creating row labels. Default implementation instantiates a LabelCell. Subclasses may override to provide a LabelCell subclass.

  Parameters:
    `row` - The row that contains the label.
  Returns:
    A new label.

### getDefaultColumnIndex

    protected int getDefaultColumnIndex()

  Returns the index of the first column that should be displayed following a refresh.

  Returns:
    A one-based column index.

### getDefaultRowIndex

    protected int getDefaultRowIndex()

  Returns the index of the first row that should be displayed following a refresh.

  Returns:
    A one-based row index.

### getLabelInsets

    protected java.awt.Insets getLabelInsets()

  Returns the label insets. By default, these are the regular insets, `getInsets()`, but subclasses that want to assume responsibility for measuring and painting their own row and column labels can override this without calling super to return larger insets in order to offset the data cells as TableView will always call this instead of `getInsets()`.

  Returns:
    The insets to use with this component.
  See Also:
    `Container.getInsets()`

### getTableBounds

    protected java.awt.Rectangle getTableBounds(java.awt.Graphics g)

  Returns a rectangle that represents the location and size of the table within the component's bounds. In other words, where the "ink" is.

  Called by getTableBounds() with `null` and by paint(Graphics g) with `g`.

  Calls updateView().

  Parameters:
    `g` - The graphics context to format with. If `null`, one will be acquired if needed via `getGraphics()`.
  Returns:
    The copied value of the tableBounds property.
  See Also:
    `getColumnLabelBounds()`, `getDataCellBounds()`, `getOriginCellBounds()`, `getPaintableBounds()`, `getRowLabelBounds()`

### newTableView

    protected TableView newTableView()

  Deprecated. As of AppDevStudio version 1.1.

### paintTable

    protected void paintTable(java.awt.Graphics g,
                              java.awt.Rectangle invalidBounds)

  Paints the table. Called by paint().

  Parameters:
    `g` - The graphics context to use for painting.
    `invalidBounds` - The area to paint.

### populatePopupMenu

    protected void populatePopupMenu(java.awt.PopupMenu popupMenu,
                                     TableElement element)

  Populates a popup menu based on a given context (element).

  Called by processMouseEvent(event) with an empty popupMenu whenever both `event.isPopupTrigger()` and `isPopupMenuVisible()` return `true`.

  Parameters:
    `popupMenu` - The menu to populate.
    `element` - The table element -- Cell, Column, Row, or `null` (the table itself) -- to use as context when populating the menu.
  See Also:
    `isPopupMenuVisible()`

### processEvent

    protected void processEvent(java.awt.AWTEvent event)

  Processes awt-events occurring on this component. By default this method does: `if (isEnabled()) super.processEvent(event);`.

  Overrides:
    `processEvent` in class `java.awt.Container`
  Parameters:
    `event` - The awt-event to process.

### processFocusEvent

    protected void processFocusEvent(java.awt.event.FocusEvent fe)

  Processes focus events occurring on this component. Subclasses should always call super so that events are delivered to any FocusListeners.

  Overrides:
    `processFocusEvent` in class `java.awt.Component`
  Parameters:
    `fe` - The focus event.
  See Also:
    `FocusListener`

### processKeyEvent

    protected void processKeyEvent(java.awt.event.KeyEvent ke)

  Processes key events occurring on this component. Subclasses should always call super so that events are delivered to any KeyListeners, but can still override TableView's behavior by consuming the event.

  Overrides:
    `processKeyEvent` in class `java.awt.Component`
  Parameters:
    `ke` - The key event.
  See Also:
    `KeyListener`, `InputEvent.consume()`

### processMouseEvent

    protected void processMouseEvent(java.awt.event.MouseEvent me)

  Processes mouse events occurring on this component. Subclasses should always call super so that events are delivered to any MouseListeners, but can still override TableView's behavior by consuming the event.

  Overrides:
    `processMouseEvent` in class `java.awt.Component`
  Parameters:
    `me` - The mouse event.
  See Also:
    `MouseListener`, `InputEvent.consume()`

### processMouseMotionEvent

    protected void processMouseMotionEvent(java.awt.event.MouseEvent me)

  Processes mouse motion events occurring on this component. Subclasses should always call super so that events are delivered to any MouseMotionListeners, but can still override TableView's behavior by consuming the event.

  Overrides:
    `processMouseMotionEvent` in class `java.awt.Component`
  Parameters:
    `me` - The mouse motion event.
  See Also:
    `MouseMotionListener`, `InputEvent.consume()`

### updateView

    protected void updateView(java.awt.Graphics g)

  Updates this view to reflect the current state of its model. Calls processChanges() followed-by formatView(g).

  Parameters:
    `g` - The graphics context to format with. If `null`, one will be acquired if needed via `getGraphics()`.
  See Also:
    `processChanges()`, `formatView(java.awt.Graphics)`

### processChanges

    protected void processChanges()

  Processes any changes that have been reported by the model.

  Calls processContentsChangedEvent() for each com.sas.collection.ContentsChangedEvent that has been queued by contentsChanged() and empties the queue.

  Called by updateView().

### processContentsChangedEvent

    protected boolean processContentsChangedEvent(com.sas.collection.ContentsChangedEvent event)

  Processes a contents changed event.

  Called by processChanges().

  When the event indicates that everything has changed, onAllChanged() is called and `true` is returned.

  Parameters:
    `event` - The event to process.
  Returns:
    `true` if everything changed, i.e. the equivalent of refresh(), and `false` otherwise

### onAllChanged

    protected void onAllChanged()

  Performs a complete refresh of the view's state from its model.

  Called by processContentsChangedEvent().

  This implementation resets some internal data structures and calls repaint().

### formatView

    protected void formatView(java.awt.Graphics g)

  Formats the model's data as defined by this view.

  Called by updateView(g).

  Calls updateDisplayedColumns(g) and updateDisplayedRows(g).

  Parameters:
    `g` - The graphics context to format with. If `null`, one will be acquired if needed via `getGraphics()`.

### updateDisplayedColumns

    protected void updateDisplayedColumns(java.awt.Graphics g)

  Updates the set of displayed columns.

  Called by formatView(g).

  Calls onSizeColumn().

  Parameters:
    `g` - The graphics context to format with.
  See Also:
    `updateDisplayedRows(java.awt.Graphics)`, `getDisplayedColumns()`

### updateDisplayedRows

    protected void updateDisplayedRows(java.awt.Graphics g)

  Updates the set of displayed rows.

  Called by formatView(g).

  Calls onSizeRow().

  Parameters:
    `g` - The graphics context to format with.
  See Also:
    `updateDisplayedColumns(java.awt.Graphics)`, `getDisplayedRows()`

### onSizeColumn

    protected void onSizeColumn(Column col,
                                java.awt.Graphics g)

  Sizes a given column.

  Called by updateDisplayedColumns() whenever a column has no size (`col.getSize()` returns zero).

  The default implementation is `col.setPreferredSize (col.computePreferredSize(g));`.

  Parameters:
    `col` - The column to size.
    `g` - The graphics context to format with.
  See Also:
    `onSizeRow(com.sas.table.Row, java.awt.Graphics)`

### onSizeRow

    protected void onSizeRow(Row row,
                             java.awt.Graphics g)

  Sizes a given row.

  Called by updateDisplayedRows() whenever a row has no size (`row.getSize()` returns zero).

  The default implementation is `row.setPreferredSize (row.computePreferredSize(g));`.

  Parameters:
    `row` - The row to size.
    `g` - The graphics context to format with.
  See Also:
    `onSizeColumn(com.sas.table.Column, java.awt.Graphics)`

### setCursor

    protected void setCursor(java.awt.Point point)

  Sets the cursor image based on a given mouse pointer location.

  Called by processMouseMotionEvent().

  Parameters:
    `point` - The location of the mouse pointer.
  See Also:
    `setCursor(java.awt.Point)`

### setCursor

    public void setCursor(java.awt.Cursor cursor)

  Sets the cursor image to a predefined cursor.

  Overrides:
    `setCursor` in class `java.awt.Component`
  Parameters:
    `cursor` - One of the cursor constants defined by the Cursor class. If this parameter is `null` then this component will inherit the cursor of its parent.

All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Components |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 SAS Institute Inc. All Rights Reserved.