|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.CellRendererPane
com.citra.table.WrapperCellRendererPane
com.citra.pivot.DefaultPivotRowHeaderRenderer
public class DefaultPivotRowHeaderRenderer
DefaultPivotRowHeaderRenderer is the default PivotRowHeaderRenderer implementation. It draws an icon on the left of the cell that indicates whether the row can be expanded or if it is collapsed. If it is a leaf row (no children), then no icon is drawn. The row is expanded/collapsed upon MOUSE_PRESSED events, which is handled in the implemented method handleEvent.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.CellRendererPane |
---|
CellRendererPane.AccessibleCellRendererPane |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected Icon |
collapsedIcon
the collapsed icon |
protected Icon |
expandedIcon
the expanded icon |
protected Icon |
waitIcon
the wait icon |
Fields inherited from class com.citra.table.WrapperCellRendererPane |
---|
opaqueFalse |
Fields inherited from class javax.swing.CellRendererPane |
---|
accessibleContext |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DefaultPivotRowHeaderRenderer()
Constructs a DefaultPivotRowHeaderRenderer. |
Method Summary | |
---|---|
protected Icon |
createCollapsedIcon()
Creates and returns an icon that represents the collapsed state of a 'non-leaf' node. |
protected Icon |
createExpandedIcon()
Creates and returns an icon that represents the expanded state of a 'non-leaf' node. |
protected void |
createIcons()
Creates icons to be used by the renderer. |
protected Icon |
createWaitIcon()
Creates and returns an icon that represents a loading state of an expanding node. |
Rectangle |
getEditableBounds()
Returns the bounds of the editable component that is drawn. |
protected Icon |
getIcon(boolean isExpanded,
boolean isLeaf,
PivotRowAdapter adapter,
TreePath path)
Retrieves the icon to be used at a given node. |
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. |
boolean |
swapExpandedState(MouseEvent e,
PivotTable table)
Changes the expanded state of a non-leaf column, according to a mouse event on the header. |
Methods inherited from class com.citra.table.WrapperCellRendererPane |
---|
getMainComponent, getMainComponent, getToolTipText, paint, paintComponent |
Methods inherited from class javax.swing.CellRendererPane |
---|
addImpl, getAccessibleContext, invalidate, paintComponent, paintComponent, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Icon expandedIcon
protected Icon collapsedIcon
protected Icon waitIcon
Constructor Detail |
---|
public DefaultPivotRowHeaderRenderer()
Method Detail |
---|
protected Icon createWaitIcon()
protected Icon createCollapsedIcon()
protected Icon createExpandedIcon()
protected void createIcons()
public Rectangle getEditableBounds()
getEditableBounds
in interface PivotRowHeaderRenderer
public Component getTreeTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column, boolean isLeaf, boolean isExpanded, PivotRowAdapter adapter, TreePath path, TableCellRenderer cellRenderer)
getTreeTableCellRendererComponent
in interface PivotRowHeaderRenderer
table
- the table that is asking the renderer to drawvalue
- the value of the cell to be renderedisSelected
- true if the cell is to be rendered with the selection highlighted, false otherwisehasFocus
- 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 editingrow
- the row index of the cell being drawncolumn
- the column index of the cell being drawnisLeaf
- true if the cell has children, false otherwiseisExpanded
- true if the cell is expanded, false otherwiseadapter
- the adapter that was found at the specified cellpath
- the corresponding path in the adaptercellRenderer
- the renderer of the cell being drawn
public boolean handleEvent(MouseEvent e, PivotTable table)
handleEvent
in interface PivotRowHeaderRenderer
e
- the mouse event triggering the method calltable
- the pivot table which is the source of the event
public boolean swapExpandedState(MouseEvent e, PivotTable table)
e
- the mouse event responsible for the state change
protected Icon getIcon(boolean isExpanded, boolean isLeaf, PivotRowAdapter adapter, TreePath path)
isExpanded
- whether the node is expandedisLeaf
- whether the node is a leafadapter
- the adapter to which the node belongspath
- the node's path
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |