GemEntity gemEntity = (GemEntity) ((GemTreeNode) value).getUserObject();
if (browserTreeModel.isVisibleGem(gemEntity)) {
IntellicutInfo intellicutInfo = intellicutManager.getIntellicutInfo(gemEntity);
AutoburnUnifyStatus autoburnStatus = intellicutInfo.getAutoburnUnifyStatus();
if (autoburnStatus == AutoburnUnifyStatus.UNAMBIGUOUS) {
setIcon(BURN_ICON);
setForeground(BURN_COLOR);
} else if (autoburnStatus == AutoburnUnifyStatus.AMBIGUOUS) {
setIcon(AMBIGUOUS_ICON);
setForeground(AMBIGUOUS_COLOR);
} else if (autoburnStatus == AutoburnUnifyStatus.NOT_POSSIBLE) {
setIcon(CANNOT_CONNECT_ICON);
setForeground(CANNOT_CONNECT_COLOR);
} else if (autoburnStatus == AutoburnUnifyStatus.UNAMBIGUOUS_NOT_NECESSARY &&
intellicutInfo.getBurnTypeCloseness() > intellicutInfo.getNoBurnTypeCloseness()) {
setIcon(BURN_ICON);
setForeground(BURN_COLOR);
} else if (autoburnStatus == AutoburnUnifyStatus.AMBIGUOUS_NOT_NECESSARY &&
intellicutInfo.getBurnTypeCloseness() > intellicutInfo.getNoBurnTypeCloseness()) {
setIcon(AMBIGUOUS_ICON);
setForeground(AMBIGUOUS_COLOR);
}
} else {
setIcon(CANNOT_CONNECT_ICON);
setForeground(CANNOT_CONNECT_COLOR);
}
} else {
// This is a folder. Determine if and how it should pulse.
// Assume we can't connect at all to start with.
Color folderColor = CANNOT_CONNECT_COLOR;
Enumeration<TreeNode> subTreeEnum = UnsafeCast.<Enumeration<TreeNode>>unsafeCast(((DefaultMutableTreeNode)value).breadthFirstEnumeration());
while (subTreeEnum.hasMoreElements()) {
DefaultMutableTreeNode childTreeNode = (DefaultMutableTreeNode) subTreeEnum.nextElement();
if (childTreeNode instanceof GemTreeNode) {
GemEntity gemEntity = (GemEntity) childTreeNode.getUserObject();
if (browserTreeModel.isVisibleGem(gemEntity)) {
IntellicutInfo intellicutInfo = intellicutManager.getIntellicutInfo(gemEntity);
AutoburnUnifyStatus autoburnStatus = intellicutInfo.getAutoburnUnifyStatus();
if (autoburnStatus == AutoburnUnifyStatus.NOT_NECESSARY) {
// Connections take precedence. If we find a connection then stop.
folderColor = null;
break;