|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JLabel | +--kiwi.ui.ModelTreeCellRenderer
An implementation of TreeCellRenderer
for use with
JTree
s that are connected to a ITreeModel
via a
TreeModelTreeAdapter
. This cell renderer consults the tree
model for a cell's rendering information, such as its label and icon.
JList
,
ITreeModel
,
TreeModelListAdapter
, Serialized FormInner classes inherited from class javax.swing.JLabel |
JLabel.AccessibleJLabel |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Fields inherited from class javax.swing.JLabel |
labelFor |
Fields inherited from class javax.swing.JComponent |
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
ModelTreeCellRenderer(ITreeModel model)
Construct a new ModelTreeCellRenderer . |
Method Summary | |
Component |
getTreeCellRendererComponent(JTree tree,
Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)
Return the component (in this case a JLabel that is used as
a "rubber stamp" for drawing items in the JTree . |
void |
setHighlightBackground(Color bg)
Set the background color for a highlighted item. |
void |
setHighlightForeground(Color fg)
Set the foreground color for a highlighted item. |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setLayout,
validate,
validateTree |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public ModelTreeCellRenderer(ITreeModel model)
ModelTreeCellRenderer
.model
- The tree model that will be used with this renderer.Method Detail |
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row, boolean hasFocus)
JLabel
that is used as
a "rubber stamp" for drawing items in the JTree
. The
renderer will consult the tree model for each node's rendering
information.tree
- The associated JTree
instance.value
- The object to draw (assumed to be an
ITreeNode
).isSelected
- true if this item is currently selected in the
tree.hasFocus
- true if this item currently has focus in the tree.expanded
- true if this item is currently expanded in the
tree.row
- The row number for this item in the tree.leaf
- true if this item is a leaf.public void setHighlightBackground(Color bg)
JTree.getSelectionBackground()
is
implemented.bg
- The new background color.public void setHighlightForeground(Color fg)
JTree.getSelectionForeground()
is
implemented.fg
- The new foreground color.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |