|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.swing.visuals.tableview.RowHeader
public class RowHeader
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
RB_KEYpublic static final java.lang.String RB_KEY
tableprotected TableView table
rowModelprotected TableRowModel rowModel
reorderingAllowedprotected boolean reorderingAllowed
resizingAllowedprotected boolean resizingAllowed
resizingRowprotected transient int resizingRow
draggedRowprotected transient int draggedRow
draggedDistanceprotected transient int draggedDistance
widthSetprotected boolean widthSet widthprotected int width cellsToSizeCountprotected int cellsToSizeCount holdingEnabledprotected boolean holdingEnabled numRowsSizedprotected int numRowsSized heldRowsprotected java.util.List heldRows heldRowsTopprotected java.util.List heldRowsTop heldRowsBottomprotected java.util.List heldRowsBottom rowsSizedprotected java.util.BitSet rowsSized printingpublic boolean printing
RowHeaderpublic RowHeader()
RowHeaderpublic RowHeader(TableRowModel model)
setTablepublic void setTable(TableView table)
getTablepublic TableView getTable()
setReorderingAllowedpublic void setReorderingAllowed(boolean reorderingAllowed)
getReorderingAllowedpublic boolean getReorderingAllowed()
setResizingAllowedpublic void setResizingAllowed(boolean resizingAllowed)
getResizingAllowedpublic boolean getResizingAllowed()
getDraggedRowpublic int getDraggedRow()
getDraggedDistancepublic int getDraggedDistance()
getResizingRowpublic int getResizingRow()
setDefaultRendererpublic void setDefaultRenderer(javax.swing.table.TableCellRenderer defaultRenderer)
getDefaultRendererpublic javax.swing.table.TableCellRenderer getDefaultRenderer()
prepareRendererpublic java.awt.Component prepareRenderer(javax.swing.table.TableCellRenderer renderer, int row)
rowAtPointpublic int rowAtPoint(java.awt.Point point)
rowAtPointpublic int rowAtPoint(java.awt.Point point, boolean accoundForHolds)
getHeaderRectpublic java.awt.Rectangle getHeaderRect(int row)
getValueAtpublic java.lang.Object getValueAt(int rowIndex)
getToolTipTextpublic java.lang.String getToolTipText(java.awt.event.MouseEvent event)
getUIpublic RowHeaderUI getUI()
setUIpublic void setUI(RowHeaderUI ui)
updateUIpublic void updateUI()
getUIClassIDpublic java.lang.String getUIClassID()
setRowModelpublic void setRowModel(TableRowModel model)
getRowModelpublic TableRowModel getRowModel()
createDefaultRowModelprotected TableRowModel createDefaultRowModel()
createDefaultRendererprotected javax.swing.table.TableCellRenderer createDefaultRenderer()
getViewPositionpublic java.awt.Point getViewPosition()
initializeLocalVarsprotected void initializeLocalVars()
resizeAndRepaintpublic void resizeAndRepaint()
setDraggedRowpublic void setDraggedRow(int aRow)
setDraggedDistancepublic void setDraggedDistance(int distance)
setResizingRowpublic void setResizingRow(int aRow)
isWidthSetpublic boolean isWidthSet()
setWidthpublic void setWidth(int newWidth)
getWidthpublic int getWidth()
setCellsToSizeCountpublic void setCellsToSizeCount(int newCount)
getCellsToSizeCountpublic int getCellsToSizeCount()
sizeRowToFitpublic void sizeRowToFit(int row)
sizeRowsToFitpublic int sizeRowsToFit(int firstRow, int lastRow, boolean force)
sizeRowsToFitpublic int sizeRowsToFit(boolean onlyVisible, boolean force)
calculatePreferredHeightForRowpublic int calculatePreferredHeightForRow(int row)
holdpublic void hold(int rowModelIndex)
holdpublic void hold(int rowModelIndex, int orientation)
releasepublic void release(int rowModelIndex)
releaseAllpublic void releaseAll()
getHeldIndicespublic java.util.List getHeldIndices()
getHeldIndicespublic java.util.List getHeldIndices(int orientation)
isHeldpublic boolean isHeld(int rowModelIndex)
isHeldpublic boolean isHeld(int rowModelIndex, int orientaion)
isHoldingEnabledpublic boolean isHoldingEnabled()
setHoldingEnabledpublic void setHoldingEnabled(boolean enableHolding)
isHoldingAllowedpublic boolean isHoldingAllowed(int orientation)
rowMovedpublic void rowMoved(TableRowModelEvent e)
rowMarginChangedpublic void rowMarginChanged(javax.swing.event.ChangeEvent e)
rowSelectionChangedpublic void rowSelectionChanged(javax.swing.event.ListSelectionEvent e)
tableRowsInsertedprotected void tableRowsInserted(javax.swing.event.TableModelEvent e)
tableRowsDeletedprotected void tableRowsDeleted(javax.swing.event.TableModelEvent e)
paintComponentpublic void paintComponent(java.awt.Graphics g)
printComponentpublic void printComponent(java.awt.Graphics g)
getTopHeldHeightpublic int getTopHeldHeight()
getBottomHeldHeightpublic int getBottomHeldHeight()
Copyright © 2009 SAS Institute Inc. All Rights Reserved. |