|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.plaf.TableHeaderUIDelegate com.jidesoft.plaf.basic.BasicCellStyleTableHeaderUIDelegate
public class BasicCellStyleTableHeaderUIDelegate
Field Summary | |
---|---|
protected JTableHeader |
_header
|
protected int |
_mouseXOffset
|
protected CellRendererPane |
_rendererPane
|
Constructor Summary | |
---|---|
BasicCellStyleTableHeaderUIDelegate(JTableHeader header,
CellRendererPane rendererPane)
|
Method Summary | |
---|---|
void |
columnAdded(TableColumnModelEvent e)
|
void |
columnMarginChanged(ChangeEvent e)
|
void |
columnMoved(TableColumnModelEvent e)
|
void |
columnRemoved(TableColumnModelEvent e)
|
void |
columnSelectionChanged(ListSelectionEvent e)
|
protected Border |
createMarginBorder(Insets insets,
Border existingBorder)
|
protected void |
customizePaint(Graphics g,
TableColumn column,
Rectangle cellRect)
|
protected void |
customizeRendererComponent(Component comp,
int rowIndex,
int columnIndex,
Rectangle cellRect)
Customizes the renderer component to be painted. |
protected void |
dragColumn(int columnIndex,
int targetX)
Drags the column to a new position. |
Insets |
getBorderInsets(Graphics g,
int columnIndex,
Rectangle cellRect)
Gets the border insets to be configured to the renderer component. |
protected int |
getHeaderPreferredHeight()
Gets the preferred height of the header. |
protected TableCellRenderer |
getHeaderRenderer(TableColumn aColumn)
Gets header renderer from the TableColumn instance and the column index. |
int |
getPreferredHeight(int column)
Gets the column's preferred height assuming the column width is fixed. |
Dimension |
getPreferredSize(JComponent c)
Gets the preferred size of the header. |
int |
getPreferredWidth(int columnIndex)
Gets the column's preferred width. |
TableColumn |
getResizingColumn(Point p,
int column)
Gets current resizing column from the mouse point and the column index. |
boolean |
hasStyledLabelColumn()
Returns if this UIDelegate have StyledLabel at least for one column. |
void |
invalidateCache(boolean originator)
Invalidates all cache. |
protected boolean |
isMouseOverPaintArea(Point p,
Rectangle cellRect,
Insets insets)
Checks if the mouse is over paint area. |
void |
mouseClicked(MouseEvent e)
|
void |
mouseDragged(MouseEvent e)
|
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
paint(Graphics g,
JComponent c)
Paint method to paint the entire header. |
protected void |
paintCell(Graphics g,
Rectangle cellRect,
int columnIndex,
Object value,
boolean isSelected,
boolean hasFocus,
boolean paintCellDecorators)
Paints the header cell. |
void |
propertyChange(PropertyChangeEvent evt)
|
protected void |
releaseRendererComponent(Component comp,
int rowIndex,
int columnIndex,
Rectangle cellRect)
Releases the customization of the renderer component after being painted. |
protected void |
resizeColumn(TableColumn resizingColumn,
int newWidth)
Resizes the target column with new width. |
protected void |
startResizingColumn(Point p,
TableColumn resizingColumn)
Post-process to start to resize column. |
void |
tableChanged(TableModelEvent e)
|
void |
uninstallAllListeners()
Uninstall all listeners before setting new table header. |
int |
viewIndexForColumn(TableColumn aColumn)
Gets the view column index from the TableColumn instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected JTableHeader _header
protected CellRendererPane _rendererPane
protected int _mouseXOffset
Constructor Detail |
---|
public BasicCellStyleTableHeaderUIDelegate(JTableHeader header, CellRendererPane rendererPane)
Method Detail |
---|
public void uninstallAllListeners()
TableHeaderUIDelegate
uninstallAllListeners
in class TableHeaderUIDelegate
public int viewIndexForColumn(TableColumn aColumn)
aColumn
- the TableColumn instance
TableColumnModel
. -1 if the TableColumn cannot be found in current TableColumnModel
.protected TableCellRenderer getHeaderRenderer(TableColumn aColumn)
aColumn
- the TableColumn instance
public Insets getBorderInsets(Graphics g, int columnIndex, Rectangle cellRect)
g
- the Graphics instancecolumnIndex
- the view column index. -1 if the column is not included in TableColumnModel. For example,
group column.cellRect
- the cell rect to paint the header
protected void paintCell(Graphics g, Rectangle cellRect, int columnIndex, Object value, boolean isSelected, boolean hasFocus, boolean paintCellDecorators)
g
- the Graphics instancecellRect
- the cell rectangle to be painted incolumnIndex
- the view column index to paintvalue
- the header value to paintisSelected
- if the column is selectedhasFocus
- if the column has focuspaintCellDecorators
- if the cell decorators should be used as wellprotected Border createMarginBorder(Insets insets, Border existingBorder)
protected boolean isMouseOverPaintArea(Point p, Rectangle cellRect, Insets insets)
p
- the mouse positioncellRect
- the cell rect to paintinsets
- the paint insets returned by TableHeaderCellDecorator
protected void customizeRendererComponent(Component comp, int rowIndex, int columnIndex, Rectangle cellRect)
CellStyleTableHeader.customizeRendererComponent(java.awt.Component, int, int, java.awt.Rectangle)
comp
- the renderer componentrowIndex
- the view row index inside the table header. Should be 0 unless it is a NestedTableHeader.columnIndex
- the view column indexcellRect
- the cell rectangle to paint the componentprotected void releaseRendererComponent(Component comp, int rowIndex, int columnIndex, Rectangle cellRect)
CellStyleTableHeader.releaseRendererComponent(java.awt.Component, int, int, java.awt.Rectangle)
Please be noted that the native table header row will always be 0. In NestedTableHeader scenario, if there were
3 rows, the row indices from top to bottom would be -2, -1, 0.
comp
- the renderer componentrowIndex
- the view row index inside the table header. Should be 0 unless it is a NestedTableHeader.columnIndex
- the view column indexcellRect
- the cell rectangle to paint the componentprotected void customizePaint(Graphics g, TableColumn column, Rectangle cellRect)
public void paint(Graphics g, JComponent c)
g
- the Graphics instancec
- the component to be paintedprotected int getHeaderPreferredHeight()
public Dimension getPreferredSize(JComponent c)
c
- the component
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
protected void dragColumn(int columnIndex, int targetX)
columnIndex
- the dragging column indextargetX
- the X position of target pointprotected void resizeColumn(TableColumn resizingColumn, int newWidth)
resizingColumn
- the column to resizenewWidth
- the new widthpublic void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public TableColumn getResizingColumn(Point p, int column)
p
- the pointcolumn
- the view column index
protected void startResizingColumn(Point p, TableColumn resizingColumn)
p
- the mouse pointresizingColumn
- the resizing columnpublic boolean hasStyledLabelColumn()
public void tableChanged(TableModelEvent e)
tableChanged
in interface TableModelListener
public void columnAdded(TableColumnModelEvent e)
columnAdded
in interface TableColumnModelListener
public void columnRemoved(TableColumnModelEvent e)
columnRemoved
in interface TableColumnModelListener
public void columnMoved(TableColumnModelEvent e)
columnMoved
in interface TableColumnModelListener
public void columnMarginChanged(ChangeEvent e)
columnMarginChanged
in interface TableColumnModelListener
public void columnSelectionChanged(ListSelectionEvent e)
columnSelectionChanged
in interface TableColumnModelListener
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public void invalidateCache(boolean originator)
originator
- the flag indicating if the other table header inside the same TableScrollPane should be invalidated.public int getPreferredHeight(int column)
column
- the visual column
public int getPreferredWidth(int columnIndex)
TableHeaderUIDelegate
getPreferredWidth
in class TableHeaderUIDelegate
columnIndex
- the visual column
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |