/**
* Overridden DefaultTreeCellRenderer method to change the type of drawing.
* @param tree the main tree object
* @param value the value we want to display
* @param isSel if this tree node is selected
* @param isExp if this tree node is expanded
* @param isLeaf if this is a leaf node
* @param index the index of this node in the tree node array
* @param cHasFocus if the focus is on this node
*/
@Override
public Component getTreeCellRendererComponent(JTree tree, Object value,
boolean isSel, boolean isExp, boolean isLeaf, int index, boolean cHasFocus)
{
super.getTreeCellRendererComponent(tree, value, isSel, isExp, isLeaf, index, cHasFocus);
Object o = ((DefaultMutableTreeNode)value).getUserObject();
if (o instanceof Entrant)
{
Entrant e = (Entrant)o;
String display = e.getNumber() + " - " + e.getName() + " - " + e.getCarModel() + " " + Database.d.getEffectiveIndexStr(e.getCar());
setText(display);
}
return this;
}
CarTreeRenderer.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:scorekeeperfrontend
作者:
评论列表
文章目录