Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot
Interface PivotRowHeaderRenderer

All Known Implementing Classes:
DefaultPivotRowHeaderRenderer

public interface PivotRowHeaderRenderer

PivotRowHeaderRenderer is the renderer for a PivotTable's row header cells. It defines methods for displaying as well as expanding/collapsing tree nodes.


Method Summary
 Rectangle getEditableBounds()
          Returns the bounds of the editable component that is drawn.
 Component getTreeTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column, boolean isLeaf, boolean isExpanded, PivotRowAdapter adapter, TreePath path, TableCellRenderer cellRenderer)
          Returns the component used for drawing the expandable row.
 boolean handleEvent(MouseEvent e, PivotTable table)
          This method is called whenever a mouse event such as MOUSE_PRESSED is captured on a cell of the pivot table's row header.
 

Method Detail

getEditableBounds

Rectangle getEditableBounds()
Returns the bounds of the editable component that is drawn.

Returns:
the editable component's bounds

getTreeTableCellRendererComponent

Component getTreeTableCellRendererComponent(JTable table,
                                            Object value,
                                            boolean isSelected,
                                            boolean hasFocus,
                                            int row,
                                            int column,
                                            boolean isLeaf,
                                            boolean isExpanded,
                                            PivotRowAdapter adapter,
                                            TreePath path,
                                            TableCellRenderer cellRenderer)
Returns the component used for drawing the expandable row. This method is used to configure the renderer appropriately before drawing.

Parameters:
table - the table that is asking the renderer to draw
value - the value of the cell to be rendered
isSelected - true if the cell is to be rendered with the selection highlighted, false otherwise
hasFocus - if true, render cell appropriately. For example, put a special border on the cell, if the cell can be edited, render in the color used to indicate editing
row - the row index of the cell being drawn
column - the column index of the cell being drawn
isLeaf - true if the cell has children, false otherwise
isExpanded - true if the cell is expanded, false otherwise
adapter - the adapter that was found at the specified cell
path - the corresponding path in the adapter
cellRenderer - the renderer of the cell being drawn
Returns:
the component used for drawing the expandable row

handleEvent

boolean handleEvent(MouseEvent e,
                    PivotTable table)
This method is called whenever a mouse event such as MOUSE_PRESSED is captured on a cell of the pivot table's row header. The renderer should act on the event, such as expand/collapse a node or display a tooltip. It returns a boolean depending on whether the event should be consumed. A consumed event is not propagated to any mouse listeners added on the table, therefore the return value is crucial to an application's functionality.

Parameters:
e - the mouse event triggering the method call
table - the pivot table which is the source of the event
Returns:
true if the event should be consumed, false otherwise

Copyright © 2011 Citra Technologies. All Rights Reserved.