com.sas.swing.visuals.tableview
Class RowHeader

com.sas.swing.visuals.tableview.RowHeader
All Implemented Interfaces:
HoldInterface, TableRowModelListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.swing.SwingConstants
Direct Known Subclasses:
OLAPRowHeader

public class RowHeader
implements TableRowModelListener, HoldInterface, javax.swing.SwingConstants

See Also:
Serialized Form

Field Summary
protected  int cellsToSizeCount
           
protected  int draggedDistance
          The distance from its original position the row has been dragged.
protected  int draggedRow
          The index of the row being dragged.
protected  java.util.List heldRows
           
protected  java.util.List heldRowsBottom
           
protected  java.util.List heldRowsTop
           
protected  boolean holdingEnabled
           
protected  int numRowsSized
           
 boolean printing
           
static java.lang.String RB_KEY
           
protected  boolean reorderingAllowed
          If true, reordering of rows are allowed by the user; the default is true.
protected  boolean resizingAllowed
          If true, resizing of rows are allowed by the user; the default is true.
protected  int resizingRow
          The index of the row being resized.
protected  TableRowModel rowModel
          The TableRowModel of the row header.
protected  java.util.BitSet rowsSized
           
protected  TableView table
          The table for which this object is the header; the default is null but the table should get set to work properly.
protected  int width
           
protected  boolean widthSet
           
 
Constructor Summary
RowHeader()
          Constructs a RowHeader with a default TableRowModel.
RowHeader(TableRowModel model)
          Constructs a RowHeader which is initialized with model as the row model.
 
Method Summary
 int calculatePreferredHeightForRow(int row)
          Calculates the preferred height for the given row based on it's label and data.
protected  javax.swing.table.TableCellRenderer createDefaultRenderer()
          Returns a default renderer to be used for the row labels.
protected  TableRowModel createDefaultRowModel()
          Returns the default row model object which is a DefaultTableRowModel.
 int getBottomHeldHeight()
          Returns the height in pixels of the bottom held rows, or 0 if no bottom rows are held.
 int getCellsToSizeCount()
          Returns the number of cells in a row to measure when calculating the height of the row.
 javax.swing.table.TableCellRenderer getDefaultRenderer()
          Returns the default renderer used for teh row labels.
 int getDraggedDistance()
          Returns the row's vertical distance from its original position, if and only if, a drag is in process.
 int getDraggedRow()
          Returns the the dragged row index, if and only if, a drag is in process, otherwise returns -1.
 java.awt.Rectangle getHeaderRect(int row)
          Returns the rectangle containing the header tile at row.
 java.util.List getHeldIndices()
          Returns a list of the indices of the rows that are being held.
 java.util.List getHeldIndices(int orientation)
          Returns a list of the indices of the rows that are being held for the given orientation.
 boolean getReorderingAllowed()
          Returns true if the user is allowed to rearrange rows by dragging their headers, false otherwise.
 boolean getResizingAllowed()
          Returns true if the user is allowed to resize rows by dragging between their headers, false otherwise.
 int getResizingRow()
          Returns the resizing row.
 TableRowModel getRowModel()
          Returns the TableRowModel that contains all row information of this row header.
 TableView getTable()
          Returns the table associated with this header.
 java.lang.String getToolTipText(java.awt.event.MouseEvent event)
          Allows the renderer's tips to be used if there is text set.
 int getTopHeldHeight()
          Returns the height in pixels of the top held rows, or 0 if no top rows are held.
 RowHeaderUI getUI()
          Returns the look and feel (L&F) object that renders this component.
 java.lang.String getUIClassID()
          Returns the suffix used to construct the name of the look and feel (L&F) class used to render this component.
 java.lang.Object getValueAt(int rowIndex)
          Returns the row label for the given row.
 java.awt.Point getViewPosition()
          If the row header is placed in a
 int getWidth()
          Returns the width of the row header.
 void hold(int rowModelIndex)
          "Holds" the given row using the default orientation.
 void hold(int rowModelIndex, int orientation)
          "Holds" the given row for the given orientation.
protected  void initializeLocalVars()
          Initializes the local variables and properties with default values.
 boolean isHeld(int rowModelIndex)
          Returns true if the given rowModelIndex is held, false otherwise.
 boolean isHeld(int rowModelIndex, int orientaion)
          Returns true if the given rowModelIndex is held, false otherwise.
 boolean isHoldingAllowed(int orientation)
          Returns true if holding for a given orientation is allowed or false otherwise.
 boolean isHoldingEnabled()
          Returns true is holding is enabled, should return false if holding is not allowed.
 boolean isWidthSet()
          Returns true if the width of the header has been set, false otherwise.
 void paintComponent(java.awt.Graphics g)
          Overrode this method as the clipBounds needs to be modified on the Graphics due to held rows, if nothing is currently being held, the clipBounds will be left untouched.
 java.awt.Component prepareRenderer(javax.swing.table.TableCellRenderer renderer, int row)
          Prepares the renderer by retrieving the row label and selection state of the row at row.
 void printComponent(java.awt.Graphics g)
          Overrode this method so that the clipbounds will not be modified to accomate the held rows when printing as the clipbounds should already be set to the correct size.
 void release(int rowModelIndex)
          Releases the given rowModelIndex from being held, so it will return to its original place in the table.
 void releaseAll()
          Releases all held rows and returns them to their previous location.
 void resizeAndRepaint()
          Sizes the header and marks it as needing display.
 int rowAtPoint(java.awt.Point point)
          Returns the index of the row that point lies in, or -1 if it lies out of bounds.
 int rowAtPoint(java.awt.Point point, boolean accoundForHolds)
          Returns the index of the row that point lies in, or -1 if it lies out of bounds.
 void rowMarginChanged(javax.swing.event.ChangeEvent e)
          Tells listeners that a row was moved due to a margin change.
 void rowMoved(TableRowModelEvent e)
          Tells listeners that a row was repositioned.
 void rowSelectionChanged(javax.swing.event.ListSelectionEvent e)
          Tells listeners that the selection model of the TableRowModel changed.
 void setCellsToSizeCount(int newCount)
          Specifies the number of cells to measure when calculating the height of the row.
 void setDefaultRenderer(javax.swing.table.TableCellRenderer defaultRenderer)
          Sets the default renderer to be used for the row labels.
 void setDraggedDistance(int distance)
          Sets the header's draggedDistance to distance.
 void setDraggedRow(int aRow)
          Sets the header's draggedRow to aRow
 void setHoldingEnabled(boolean enableHolding)
          Sets the state of whether holding of indices is enabled or not.
 void setReorderingAllowed(boolean reorderingAllowed)
          Sets whether the user can drag row headers to reorder rows.
 void setResizingAllowed(boolean resizingAllowed)
          Sets whether the user can resize rows by dragging between headers.
 void setResizingRow(int aRow)
          Sets the header's resizingRow to aRow.
 void setRowModel(TableRowModel model)
          Sets the row model for this table to model and registers for listener notifications from the new row model.
 void setTable(TableView table)
          Sets the table associated with this header.
 void setUI(RowHeaderUI ui)
          Sets the look and feel (L&F) object that renders this component.
 void setWidth(int newWidth)
          Sets the header's width to newWidth.
 int sizeRowsToFit(boolean onlyVisible, boolean force)
          Sizes all the rows to the height needed based on their label and data.
 int sizeRowsToFit(int firstRow, int lastRow, boolean force)
          Sizes all the rows in the span of firstRow to lastRow inclusively to the height needed based on their label and data.
 void sizeRowToFit(int row)
          Sizes the given row to the height needed based on it's label and data.
protected  void tableRowsDeleted(javax.swing.event.TableModelEvent e)
          Invoked when rows have been removed from the table.
protected  void tableRowsInserted(javax.swing.event.TableModelEvent e)
          Invoked when rows have been inserted into the table.
 void updateUI()
          Notification from the
Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

table

protected TableView table
The table for which this object is the header; the default is null but the table should get set to work properly.


rowModel

protected TableRowModel rowModel
The TableRowModel of the row header.


reorderingAllowed

protected boolean reorderingAllowed
If true, reordering of rows are allowed by the user; the default is true.


resizingAllowed

protected boolean resizingAllowed
If true, resizing of rows are allowed by the user; the default is true.


resizingRow

protected transient int resizingRow
The index of the row being resized. null if not resizing.


draggedRow

protected transient int draggedRow
The index of the row being dragged. null if not dragging.


draggedDistance

protected transient int draggedDistance
The distance from its original position the row has been dragged.


widthSet

protected boolean widthSet

width

protected int width

cellsToSizeCount

protected int cellsToSizeCount

holdingEnabled

protected boolean holdingEnabled

numRowsSized

protected int numRowsSized

heldRows

protected java.util.List heldRows

heldRowsTop

protected java.util.List heldRowsTop

heldRowsBottom

protected java.util.List heldRowsBottom

rowsSized

protected java.util.BitSet rowsSized

printing

public boolean printing
Constructor Detail

RowHeader

public RowHeader()
Constructs a RowHeader with a default TableRowModel.

See Also:
createDefaultRowModel()

RowHeader

public RowHeader(TableRowModel model)
Constructs a RowHeader which is initialized with model as the row model. If model is null this method will initialize the row header with a default TableRowModel.

Parameters:
model - the row model for the table
See Also:
createDefaultRowModel()
Method Detail

setTable

public void setTable(TableView table)
Sets the table associated with this header.

Parameters:
table - the new table

getTable

public TableView getTable()
Returns the table associated with this header.

Returns:
the table property

setReorderingAllowed

public void setReorderingAllowed(boolean reorderingAllowed)
Sets whether the user can drag row headers to reorder rows.

Parameters:
reorderingAllowed - true if the table view should allow reordering; otherwise false
See Also:
getReorderingAllowed()

getReorderingAllowed

public boolean getReorderingAllowed()
Returns true if the user is allowed to rearrange rows by dragging their headers, false otherwise. The default is true. You can rearrange rows programmatically regardless of this setting.

Returns:
the reorderingAllowed property
See Also:
setReorderingAllowed(boolean)

setResizingAllowed

public void setResizingAllowed(boolean resizingAllowed)
Sets whether the user can resize rows by dragging between headers.

Parameters:
resizingAllowed - true if table view should allow resizing
See Also:
getResizingAllowed()

getResizingAllowed

public boolean getResizingAllowed()
Returns true if the user is allowed to resize rows by dragging between their headers, false otherwise. The default is true. You can resize rows programmatically regardless of this setting.

Returns:
the resizingAllowed property
See Also:
setResizingAllowed(boolean)

getDraggedRow

public int getDraggedRow()
Returns the the dragged row index, if and only if, a drag is in process, otherwise returns -1.

Returns:
the dragged row index, if a drag is in process, otherwise returns -1
See Also:
getDraggedDistance()

getDraggedDistance

public int getDraggedDistance()
Returns the row's vertical distance from its original position, if and only if, a drag is in process. Otherwise, the the return value is meaningless.

Returns:
the row's vertical distance from its original position, if a drag is in process, otherwise the return value is meaningless
See Also:
getDraggedRow()

getResizingRow

public int getResizingRow()
Returns the resizing row. If no row is being resized this method returns -1.

Returns:
the resizing row

setDefaultRenderer

public void setDefaultRenderer(javax.swing.table.TableCellRenderer defaultRenderer)
Sets the default renderer to be used for the row labels.

Parameters:
defaultRenderer - the default renderer

getDefaultRenderer

public javax.swing.table.TableCellRenderer getDefaultRenderer()
Returns the default renderer used for teh row labels.

Returns:
the default renderer

prepareRenderer

public java.awt.Component prepareRenderer(javax.swing.table.TableCellRenderer renderer,
                                          int row)
Prepares the renderer by retrieving the row label and selection state of the row at row.

Note: Throughout the tableview package, the internal implementations always use this method to prepare renderers so that this default behavior can be safely overridden by a subclass.

Parameters:
renderer - the TableCellRenderer to prepare for the given row
row - the row index of the row to render, where 0 is the first row

rowAtPoint

public int rowAtPoint(java.awt.Point point)
Returns the index of the row that point lies in, or -1 if it lies out of bounds.

Returns:
the index of the row that point lies in, or -1 if it lies out of bounds

rowAtPoint

public int rowAtPoint(java.awt.Point point,
                      boolean accoundForHolds)
Returns the index of the row that point lies in, or -1 if it lies out of bounds.

Parameters:
accountForHolds - if false and the point is over a held row, this method will return the row index for the row beneath the held row. If true, this will return the index of the row the point is on, taking into account the held rows.
Returns:
the index of the row that point lies in, or -1 if it lies out of bounds

getHeaderRect

public java.awt.Rectangle getHeaderRect(int row)
Returns the rectangle containing the header tile at row. When the row parameter is out of bounds this method uses the same conventions as the TableView method getCellRect.

Returns:
the rectangle containing the header tile at row
See Also:
TableView.getCellRect(int, int, boolean, boolean)

getValueAt

public java.lang.Object getValueAt(int rowIndex)
Returns the row label for the given row. If the table has a model that is an instance of InsertRowInterface and has an uncomitted row present, the row label will be an '*'. If the table has a model that is an instance of StaticRowLabelInterface, the label will be retreived froma call to getRowLabel on the model, otherwise just the row index will be returned as the label, starting at 1.

Parameters:
rowIndex - the viewer row index of the label to retrieve, this index is zero based.
Returns:
the object that gets renderer as teh label for the given row

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
Allows the renderer's tips to be used if there is text set.

Overrides:
getToolTipText in class javax.swing.JComponent
Parameters:
event - the location of the event identifies the proper renderer and, therefore, the proper tip
Returns:
the tool tip for this component

getUI

public RowHeaderUI getUI()
Returns the look and feel (L&F) object that renders this component.

Returns:
the RowHeaderUI object that renders this component

setUI

public void setUI(RowHeaderUI ui)
Sets the look and feel (L&F) object that renders this component.

Parameters:
ui - the RowHeaderUI L&F object
See Also:
UIDefaults.getUI(javax.swing.JComponent)

updateUI

public void updateUI()
Notification from the UIManager that the look and feel (L&F) has changed. Replaces the current UI object with the latest version from the UIManager.

Overrides:
updateUI in class javax.swing.JComponent
See Also:
JComponent.updateUI()

getUIClassID

public java.lang.String getUIClassID()
Returns the suffix used to construct the name of the look and feel (L&F) class used to render this component.

Overrides:
getUIClassID in class javax.swing.JComponent
Returns:
the string "RowHeaderUI"
See Also:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

setRowModel

public void setRowModel(TableRowModel model)
Sets the row model for this table to model and registers for listener notifications from the new row model.

Parameters:
model - the new row model this row header
See Also:
getRowModel()

getRowModel

public TableRowModel getRowModel()
Returns the TableRowModel that contains all row information of this row header.

Returns:
the rowModel property
See Also:
setRowModel(com.sas.swing.visuals.tableview.TableRowModel)

createDefaultRowModel

protected TableRowModel createDefaultRowModel()
Returns the default row model object which is a DefaultTableRowModel. A subclass can override this method to return a different row model object

Returns:
the default row model object

createDefaultRenderer

protected javax.swing.table.TableCellRenderer createDefaultRenderer()
Returns a default renderer to be used for the row labels.

Parameters:
default - renderer to be used

getViewPosition

public java.awt.Point getViewPosition()
If the row header is placed in a JScrollPane the this will return the view position of the JViewport that contains the row header.

Returns:
a point the represents the region of the row header that is currently scrolled into view, the point will be the upper left corner of the row header that is currently in view

initializeLocalVars

protected void initializeLocalVars()
Initializes the local variables and properties with default values. Used by the constructor methods.


resizeAndRepaint

public void resizeAndRepaint()
Sizes the header and marks it as needing display. Equivalent to revalidate followed by repaint.


setDraggedRow

public void setDraggedRow(int aRow)
Sets the header's draggedRow to aRow

Parameters:
aRow - the new value for draggedRow

setDraggedDistance

public void setDraggedDistance(int distance)
Sets the header's draggedDistance to distance.

Parameters:
distance - the distance dragged

setResizingRow

public void setResizingRow(int aRow)
Sets the header's resizingRow to aRow.

Parameters:
aRow - the row being resized

isWidthSet

public boolean isWidthSet()
Returns true if the width of the header has been set, false otherwise. Is used to determine if the row header should size itself based on its preferred size of its labels or not.

Returns:
true if the width has been set, false otherwise

setWidth

public void setWidth(int newWidth)
Sets the header's width to newWidth. This also sets the widthSet property to true if the width is not equal to the current width.

Parameters:
newWidth - the new width the the row header

getWidth

public int getWidth()
Returns the width of the row header.

Overrides:
getWidth in class javax.swing.JComponent
Returns:
the width of the row header in pixels.
See Also:
setWidth(int)

setCellsToSizeCount

public void setCellsToSizeCount(int newCount)
Specifies the number of cells to measure when calculating the height of the row. A value of zero will cause only the row's label to be measured, while a negative value will measure all cells. The default value is 1.

Parameters:
newCount - the number of cells to measure to determine the height of the rows, a negative value equates to calculating the height of all cells.
See Also:
getCellsToSizeCount()

getCellsToSizeCount

public int getCellsToSizeCount()
Returns the number of cells in a row to measure when calculating the height of the row. A value of zero will cause only the row's label to be measured, while a negative value will measure all cells in the row. The default value is 1.

Returns:
the number of cells to measure the height of to determine the height of a row
See Also:
setCellsToSizeCount(int)

sizeRowToFit

public void sizeRowToFit(int row)
Sizes the given row to the height needed based on it's label and data. Resizing on the row header must be allowed in order for any resizing to occur. This method calls calculatePreferredHeightForRow(int) to determine the height for the row.

Parameters:
row - the viewer index of the row to remeasure to fit
See Also:
getCellsToSizeCount(), setCellsToSizeCount(int), sizeRowsToFit(boolean, boolean), sizeRowsToFit(int, int, boolean), calculatePreferredHeightForRow(int)

sizeRowsToFit

public int sizeRowsToFit(int firstRow,
                         int lastRow,
                         boolean force)
Sizes all the rows in the span of firstRow to lastRow inclusively to the height needed based on their label and data. Resizing on the row header must be allowed in order for any resizing to occur. If the value of force is true, the rows will get resized even if they have been resized before, where if force is false, each row will only get resized if it has not been resized before. This method calls calculatePreferredHeightForRow(int) to determine the height for each row. The method will return the index of the last row sized, or -1 if no rows are sized.

Parameters:
firstRow - the first row index to resize
lastRow - the last row index to resize
force - if true, the rows will be resized, if false, the rows will only be sized if they have not been sized before
Returns:
the index of the last row sized, or -1 if no row has been sized
See Also:
getCellsToSizeCount(), setCellsToSizeCount(int), sizeRowToFit(int), sizeRowsToFit(boolean, boolean), calculatePreferredHeightForRow(int)

sizeRowsToFit

public int sizeRowsToFit(boolean onlyVisible,
                         boolean force)
Sizes all the rows to the height needed based on their label and data. Resizing on the row header must be allowed in order for any resizing to occur. This method calls calculatePreferredHeightForRow(int) to determine the height for each row. If the onlyVisible parameter is set to true, only the rows that are visible will possibly be resized, whereas if it is false, all the rows may get sized. If the forceResize parameter is set to true, the rows will be resized, where as if it is false, the rows will only be sized if they have not been sized before. The method will return the index of the last row sized, or -1 if no rows are sized.

Parameters:
onlyVisible - if true, only the rows visible in the table will be sized, false if all rows should be sized
forceResize - if true, the rows will be resized, if false, the rows will only be sized if they have not been sized before
Returns:
the index of the last row sized, or -1 if no row has been sized
See Also:
getCellsToSizeCount(), setCellsToSizeCount(int), sizeRowsToFit(int, int, boolean), calculatePreferredHeightForRow(int)

calculatePreferredHeightForRow

public int calculatePreferredHeightForRow(int row)
Calculates the preferred height for the given row based on it's label and data. The method uses the value from getCellToSizeCount() to determine the number of cells to measure to determine the row height. This is compared with the preferred height of the row label and the larger size is returned for the row. This height may not be the best fit as the value returned from getCellToSizeCount() may be too small so that too few of cells were measured to determine the row height.

Parameters:
row - the viewer index of the row to measure
See Also:
getCellsToSizeCount(), setCellsToSizeCount(int), sizeRowsToFit(boolean, boolean), sizeRowsToFit(int, int, boolean), sizeRowToFit(int)

hold

public void hold(int rowModelIndex)
"Holds" the given row using the default orientation. The default orientation for rows is TOP. A held 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 rows are held controls the order in which they are displayed.

Does nothing if the row is already held.

Specified by:
hold in interface HoldInterface
Parameters:
rowModelIndex - the data model index of the row wishing to be held
See Also:
release(int), releaseAll()

hold

public void hold(int rowModelIndex,
                 int orientation)
"Holds" the given row for the given orientation. The valid values are TOP or BOTTOM for the orientation paramter. A held 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 rows are held controls the order in which they are displayed.

Does nothing if the row is already held.

Specified by:
hold in interface HoldInterface
Parameters:
rowModelIndex - the data model index of the row wishing to be held
orientation - the orientation or location the index is to be held
See Also:
release(int), releaseAll()

release

public void release(int rowModelIndex)
Releases the given rowModelIndex from being held, so it will return to its original place in the table. If the rowModelIndex is not held, nothing is done.

Specified by:
release in interface HoldInterface
Parameters:
rowModelIndex - the row currently held that is wishing to be released
See Also:
hold(int), releaseAll()

releaseAll

public void releaseAll()
Releases all held rows and returns them to their previous location.

Specified by:
releaseAll in interface HoldInterface
See Also:
hold(int)

getHeldIndices

public java.util.List getHeldIndices()
Returns a list of the indices of the rows that are being held. This list will include all the indices for all the orientations. Modifications to this list will not be reflected in the held list, this list is a duplicate.

Specified by:
getHeldIndices in interface HoldInterface
Returns:
a list of the held rows
See Also:
HoldInterface.getHeldIndices(int)

getHeldIndices

public java.util.List getHeldIndices(int orientation)
Returns a list of the indices of the rows that are being held for the given orientation. Modifications to this list will be reflected in the held list as this is the true list.

Specified by:
getHeldIndices in interface HoldInterface
Parameters:
orientation - the orientation of the held indices that are being returned
Returns:
a list of the held rows
See Also:
HoldInterface.getHeldIndices()

isHeld

public boolean isHeld(int rowModelIndex)
Returns true if the given rowModelIndex is held, false otherwise.

Specified by:
isHeld in interface HoldInterface
Parameters:
rowModelIndex - the data model index of the row
Returns:
true if the row is held, false otherwise
See Also:
HoldInterface.isHeld(int, int)

isHeld

public boolean isHeld(int rowModelIndex,
                      int orientaion)
Returns true if the given rowModelIndex is held, false otherwise.

Specified by:
isHeld in interface HoldInterface
Parameters:
rowModelIndex - the data model index of the row
orientation - the orientation or location that the index is being queried for
Returns:
true if the row is held, false otherwise
See Also:
HoldInterface.isHeld(int)

isHoldingEnabled

public boolean isHoldingEnabled()
Returns true is holding is enabled, should return false if holding is not allowed.

Specified by:
isHoldingEnabled in interface HoldInterface
Returns:
true is holding of indices is enabled, false otherwise
See Also:
setHoldingEnabled(boolean)

setHoldingEnabled

public void setHoldingEnabled(boolean enableHolding)
Sets the state of whether holding of indices is enabled or not.

Specified by:
setHoldingEnabled in interface HoldInterface
Parameters:
enableHolding - true to enable holding, false otherwise
See Also:
isHoldingEnabled()

isHoldingAllowed

public boolean isHoldingAllowed(int orientation)
Returns true if holding for a given orientation is allowed or false otherwise. Holding must be enabled for this to return true.

Specified by:
isHoldingAllowed in interface HoldInterface
Parameters:
orientation - the orientation being queried about
Returns:
true is holding is enabled an dallowed for a given orientation, false otherwise

rowMoved

public void rowMoved(TableRowModelEvent e)
Tells listeners that a row was repositioned.

Specified by:
rowMoved in interface TableRowModelListener

rowMarginChanged

public void rowMarginChanged(javax.swing.event.ChangeEvent e)
Tells listeners that a row was moved due to a margin change.

Specified by:
rowMarginChanged in interface TableRowModelListener

rowSelectionChanged

public void rowSelectionChanged(javax.swing.event.ListSelectionEvent e)
Tells listeners that the selection model of the TableRowModel changed.

Specified by:
rowSelectionChanged in interface TableRowModelListener

tableRowsInserted

protected void tableRowsInserted(javax.swing.event.TableModelEvent e)
Invoked when rows have been inserted into the table.

Application code will not use these methods explicitly, they are used internally by the TableView.

Parameters:
e - the TableModelEvent encapsulating the insertion

tableRowsDeleted

protected void tableRowsDeleted(javax.swing.event.TableModelEvent e)
Invoked when rows have been removed from the table.

Parameters:
e - the TableModelEvent encapsulating the deletion

paintComponent

public void paintComponent(java.awt.Graphics g)
Overrode this method as the clipBounds needs to be modified on the Graphics due to held rows, if nothing is currently being held, the clipBounds will be left untouched.

Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
g - The Graphics context used for the painting

printComponent

public void printComponent(java.awt.Graphics g)
Overrode this method so that the clipbounds will not be modified to accomate the held rows when printing as the clipbounds should already be set to the correct size.

Overrides:
printComponent in class javax.swing.JComponent
Parameters:
g - The Graphics context used for printing

getTopHeldHeight

public int getTopHeldHeight()
Returns the height in pixels of the top held rows, or 0 if no top rows are held.

Returns:
the height in pixels of the top rows being held

getBottomHeldHeight

public int getBottomHeldHeight()
Returns the height in pixels of the bottom held rows, or 0 if no bottom rows are held.

Returns:
the height in pixels of the bottom rows being held



Copyright © 2009 SAS Institute Inc. All Rights Reserved.