|
Components | |||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.swing.visuals.tableview.ColumnHeader
public class ColumnHeader
Field Summary | |
---|---|
protected int |
cellsToSizeCount
|
protected int |
height
|
protected boolean |
heightSet
|
protected boolean |
holdingEnabled
|
protected int |
lastColumnSized
|
boolean |
printing
|
static java.lang.String |
RB_KEY
|
Constructor Summary | |
---|---|
ColumnHeader()
Constructs a ColumnHeader with a default
TableColumnModel . |
|
ColumnHeader(javax.swing.table.TableColumnModel model)
Constructs a ColumnHeader which is initialized with
model as the Column model. |
Method Summary | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
int |
calculatePreferredWidthForColumn(int column)
Calculates the preferred width for the given column based on it's label and data. |
||||||||||||||||||||||
int[] |
calculatePreferredWidthForColumns(int[] columns)
Calculates the preferred width for the given column based on it's label and data. |
||||||||||||||||||||||
int |
columnAtPoint(java.awt.Point point)
Returns the index of the column that point lies in, or -1 if it
lies out of bounds. |
||||||||||||||||||||||
int |
columnAtPoint(java.awt.Point point,
boolean accountForHolds)
Returns the index of the column that point lies in, or -1 if it
lies out of bounds. |
||||||||||||||||||||||
protected javax.swing.table.TableCellRenderer |
createDefaultRenderer()
Returns a default renderer to be used when no header renderer is defined by a TableColumn . |
||||||||||||||||||||||
int |
getCellsToSizeCount()
Returns the number of cells in a column to measure when calculating the width of the column. |
||||||||||||||||||||||
java.awt.Rectangle |
getHeaderRect(int column)
Returns the rectangle containing the header tile at row . |
||||||||||||||||||||||
int |
getHeight()
Returns the height of the column header. |
||||||||||||||||||||||
java.util.List |
getHeldIndices()
Returns a list of the indices that are being held. |
||||||||||||||||||||||
java.util.List |
getHeldIndices(int orientation)
Returns a list of the indices that are being held for the given orientation. |
||||||||||||||||||||||
HoldInterface |
getHold()
|
||||||||||||||||||||||
int |
getLeadingHeldWidth()
Returns the width in pixels of the leading held columns, or 0 if no leading columns are held. |
||||||||||||||||||||||
protected int |
getPreferredHeaderWidthForColumn(int column)
|
||||||||||||||||||||||
int |
getTrailingHeldWidth()
Returns the width in pixels of the trailing held columns, or 0 if no trailing columns are held. |
||||||||||||||||||||||
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.awt.Point |
getViewPosition()
If the column header is placed in a |
void |
hold(int columnModelIndex)
"Holds" the given index using the default orientation. |
||||||||||||||||||||
void |
hold(int columnModelIndex,
int orientation)
"Holds" the given index using the orientation specified. |
||||||||||||||||||||||
protected void |
initializeLocalVars()
Initializes the local variables and properties with default values. |
||||||||||||||||||||||
boolean |
isHeightSet()
Returns true if the height of the header has been set, false otherwise. |
||||||||||||||||||||||
boolean |
isHeld(int columnModelIndex)
Returns true if the given modelIndex is held for any orientation,
false otherwise. |
||||||||||||||||||||||
boolean |
isHeld(int columnModelIndex,
int orientation)
Returns true if the given modelIndex is held for the given
orientation, 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. |
||||||||||||||||||||||
void |
paintComponent(java.awt.Graphics g)
Overrode this method as the clipBounds needs to be modified on the Graphics due to held columns, if nothing is currently being held, the clipBounds will be left untouched. |
||||||||||||||||||||||
java.awt.Component |
prepareRenderer(javax.swing.table.TableCellRenderer renderer,
int column)
Prepares the renderer by retrieving the column label and selection state of the column at column . |
||||||||||||||||||||||
void |
printComponent(java.awt.Graphics g)
Overrode this method so that the clipbounds will not be modified to accomate the held column when printing as the clipbounds should already be set to the correct size. |
||||||||||||||||||||||
void |
release(int columnModelIndex)
Releases the given modelIndex from being held, so it will
return to its original place in the view. |
||||||||||||||||||||||
void |
releaseAll()
Releases all held indices and returns them to their previous location. |
||||||||||||||||||||||
void |
setCellsToSizeCount(int newCount)
Specifies the number of cells to measure when calculating the width of the column. |
||||||||||||||||||||||
void |
setColumnModel(javax.swing.table.TableColumnModel columnModel)
Sets the column model for this table to columnModel and registers
for listener notifications from the new column model. |
||||||||||||||||||||||
void |
setHeight(int newHeight)
Sets the header's height to newHeight . |
||||||||||||||||||||||
void |
setHoldingEnabled(boolean enableHolding)
Sets the state of whether holding of indices is enabled or not. |
||||||||||||||||||||||
void |
setTable(javax.swing.JTable table)
Sets the table associated with this header. |
||||||||||||||||||||||
void |
sizeColumnsToFit()
Sizes all the columns to the width needed based on their label and data. |
||||||||||||||||||||||
void |
sizeColumnToFit(int column)
Sizes the given column to the width needed based on it's label and data. |
||||||||||||||||||||||
void |
updateUI()
Notification from the
RB_KEYpublic static final java.lang.String RB_KEY
heightSetprotected boolean heightSet heightprotected int height cellsToSizeCountprotected int cellsToSizeCount lastColumnSizedprotected int lastColumnSized printingpublic boolean printing holdingEnabledprotected boolean holdingEnabled
ColumnHeaderpublic ColumnHeader()
ColumnHeaderpublic ColumnHeader(javax.swing.table.TableColumnModel model)
isHeightSetpublic boolean isHeightSet()
setTablepublic void setTable(javax.swing.JTable table)
setColumnModelpublic void setColumnModel(javax.swing.table.TableColumnModel columnModel)
columnAtPointpublic int columnAtPoint(java.awt.Point point)
columnAtPointpublic int columnAtPoint(java.awt.Point point, boolean accountForHolds)
getHeaderRectpublic java.awt.Rectangle getHeaderRect(int column)
getViewPositionpublic java.awt.Point getViewPosition()
createDefaultRendererprotected javax.swing.table.TableCellRenderer createDefaultRenderer()
prepareRendererpublic java.awt.Component prepareRenderer(javax.swing.table.TableCellRenderer renderer, int column)
initializeLocalVarsprotected void initializeLocalVars()
updateUIpublic void updateUI()
getUIClassIDpublic java.lang.String getUIClassID()
setHeightpublic void setHeight(int newHeight)
getHeightpublic int getHeight()
setCellsToSizeCountpublic void setCellsToSizeCount(int newCount)
getCellsToSizeCountpublic int getCellsToSizeCount()
sizeColumnToFitpublic void sizeColumnToFit(int column)
sizeColumnsToFitpublic void sizeColumnsToFit()
calculatePreferredWidthForColumnspublic int[] calculatePreferredWidthForColumns(int[] columns)
getPreferredHeaderWidthForColumnprotected int getPreferredHeaderWidthForColumn(int column) calculatePreferredWidthForColumnpublic int calculatePreferredWidthForColumn(int column)
paintComponentpublic void paintComponent(java.awt.Graphics g)
printComponentpublic void printComponent(java.awt.Graphics g)
getLeadingHeldWidthpublic int getLeadingHeldWidth()
getTrailingHeldWidthpublic int getTrailingHeldWidth()
getHeldIndicespublic java.util.List getHeldIndices()
getHeldIndicespublic java.util.List getHeldIndices(int orientation)
getHoldpublic HoldInterface getHold() holdpublic void hold(int columnModelIndex)
holdpublic void hold(int columnModelIndex, int orientation)
isHeldpublic boolean isHeld(int columnModelIndex)
isHeldpublic boolean isHeld(int columnModelIndex, int orientation)
isHoldingAllowedpublic boolean isHoldingAllowed(int orientation)
releasepublic void release(int columnModelIndex)
releaseAllpublic void releaseAll()
isHoldingEnabledpublic boolean isHoldingEnabled()
setHoldingEnabledpublic void setHoldingEnabled(boolean enableHolding)
Copyright © 2009 SAS Institute Inc. All Rights Reserved. |