|
Copyright © 2005 Scientific Applications. 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.sciapp.table.WrapperCellRendererPane
com.sciapp.table.group.DefaultTreeTableHeaderRenderer
public class DefaultTreeTableHeaderRenderer
DefaultTreeTableHeaderRenderer is the default implementation of a TreeTableHeaderRenderer that uses a panel to layout a JTree's expansion control.
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 TreeTableColumnModelAdapter |
adapter
the treetable column model adapter |
protected int |
column
the column index of the cell being drawn |
protected Rectangle |
expansionControl
a rectangle that holds the bounds of the expansion control |
protected Rectangle |
expansionFrame
a rectangle that holds the bounds of the expansion frame |
protected boolean |
isExpanded
flag that determines whether the path is expanded |
protected boolean |
isLeaf
flag that determines whether the path is a leaf node |
protected TreePath |
path
the path to draw |
protected Dimension |
preferredSize
the preferred size of this component |
protected int |
row
the row index of the cell being drawn |
protected boolean |
separate
flag that determines whether a separate component should be used to layout the expansion control |
Fields inherited from class com.sciapp.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 | |
---|---|
DefaultTreeTableHeaderRenderer()
Creates a DefaultTreeTableHeaderRenderer. |
|
DefaultTreeTableHeaderRenderer(TableCellRenderer expandRenderer)
Creates a DefaultTreeTableHeaderRenderer. |
Method Summary | |
---|---|
protected Icon |
createCollapsedIcon()
Creates and returns an icon that represents the collapsed state of a 'non-leaf' column. |
protected Icon |
createExpandedIcon()
Creates and returns an icon that represents the expanded state of a 'non-leaf' column. |
Component |
getMainComponent()
Returns the main wrapped component. |
Dimension |
getPreferredSize()
Returns the preferred size of this container. |
String |
getToolTipText(MouseEvent event)
Returns the string to be used as the tooltip for event. |
Component |
getTreeTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column,
boolean isLeaf,
boolean isExpanded,
TreeTableColumnModelAdapter adapter,
TreePath path,
TableCellRenderer cellRenderer,
int level)
Returns the component used for drawing the expandable column header. |
boolean |
getUseSeparateComponent()
Determines whether a separate component is used to layout the expansion control. |
boolean |
handleEvent(MouseEvent e,
TreeTableHeader header)
Handles a mouse event on this component. |
void |
setBounds(int x,
int y,
int w,
int h)
Moves and resizes this component. |
void |
setUseSeparateComponent(boolean separate)
Defines whether a separate component is used to layout the expansion control. |
protected boolean |
swapExpandedState(MouseEvent e,
TreeTableHeader header)
Changes the expanded state of a non-leaf column, according to a mouse event on the header. |
Methods inherited from class com.sciapp.table.WrapperCellRendererPane |
---|
getMainComponent, 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 int row
protected int column
protected boolean isLeaf
protected boolean isExpanded
protected TreeTableColumnModelAdapter adapter
protected TreePath path
protected Dimension preferredSize
protected boolean separate
protected final transient Rectangle expansionFrame
protected final transient Rectangle expansionControl
Constructor Detail |
---|
public DefaultTreeTableHeaderRenderer()
public DefaultTreeTableHeaderRenderer(TableCellRenderer expandRenderer)
Method Detail |
---|
protected Icon createCollapsedIcon()
protected Icon createExpandedIcon()
public Component getMainComponent()
getMainComponent
in class WrapperCellRendererPane
public Dimension getPreferredSize()
getPreferredSize
in class Container
Dimension
that represents
the preferred size of this container.Container.getMinimumSize()
,
Container.getLayout()
,
LayoutManager.preferredLayoutSize(Container)
,
Component.getPreferredSize()
public String getToolTipText(MouseEvent event)
getToolTipText
in class WrapperCellRendererPane
event
- the mouse event producing the tooltip
public Component getTreeTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column, boolean isLeaf, boolean isExpanded, TreeTableColumnModelAdapter adapter, TreePath path, TableCellRenderer cellRenderer, int level)
getTreeTableCellRendererComponent
in interface TreeTableHeaderRenderer
table
- the JTable that is asking the renderer to draw; can be nullvalue
- the value of the cell to be rendered. It is up to the specific renderer to interpret and draw the value. For example, if value is the string "true", it could be rendered as a string or it could be rendered as a check box that is checked. null is a valid valueisSelected
- true if the cell is to be rendered with the selection highlighted; otherwise falsehasFocus
- 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 drawn. When drawing the header, the value of row is -1column
- the column index of the cell being drawnisLeaf
- true if the tree node displayed is a leaf node, false otherwiseisExpanded
- true if the column is expanded, false otherwiseadapter
- the treetable column model adapter usedpath
- identifies the tree path to drawcellRenderer
- the renderer of the column being drawnlevel
- the group level at which the component will be shown
public boolean getUseSeparateComponent()
public boolean handleEvent(MouseEvent e, TreeTableHeader header)
handleEvent
in interface TreeTableHeaderRenderer
e
- the mouse event that triggered the methodheader
- the header source of the event
public void setBounds(int x, int y, int w, int h)
x
and y
, and the
new size is specified by width
and height
.
setBounds
in class Component
x
- the new x-coordinate of this componenty
- the new y-coordinate of this componentw
- the new width
of this componenth
- the new height
of this
componentComponent.getBounds()
,
Component.setLocation(int, int)
,
Component.setLocation(Point)
,
Component.setSize(int, int)
,
Component.setSize(Dimension)
public void setUseSeparateComponent(boolean separate)
separate
- true if a separate component should be used, false otherwiseprotected boolean swapExpandedState(MouseEvent e, TreeTableHeader header)
e
- the mouse event responsible for the state changeheader
- the header source of the event
|
Copyright © 2005 Scientific Applications. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |