@Override
	public Component getTreeCellRendererComponent(JTree tree, Object value,
			boolean sel, boolean expanded, boolean leaf, int row,
			boolean hasFocus) {

		super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
		
		SiteNode node = null;
		Target target = null;
		if (value instanceof SiteNode) {
			node = (SiteNode) value;
			if (node.getUserObject() instanceof Target) {
				target = (Target) node.getUserObject();
			}
		}
		
		if (node != null) {
			if (node.isRoot()) {
				setIcon(DisplayUtils.getScaledIcon(ROOT_ICON));
			} else if (target != null) {
				if (target.getContext() != null) {
					if (target.getContext().isInScope()) {
						setIcon(DisplayUtils.getScaledIcon(CONTEXT_IN_SCOPE_ICON));
					} else {
						setIcon(DisplayUtils.getScaledIcon(CONTEXT_ICON));
					}
				} else if (target.isInScopeOnly()) {
					setIcon(DisplayUtils.getScaledIcon(ALL_IN_SCOPE_ICON));
				}
			}
		}

		return this;
	}
@ Override public Component getTreeCellRendererComponent ( JTree tree , Object value , boolean sel , boolean expanded , boolean leaf , int row , boolean hasFocus ) { super . getTreeCellRendererComponent ( tree , value , sel , expanded , leaf , row , hasFocus ) ; SiteNode node = null ; Target target = null ; if ( value instanceof SiteNode ) { node = ( SiteNode ) value ; if ( node . getUserObject ( ) instanceof Target ) { target = ( Target ) node . getUserObject ( ) ; } } if ( node != null ) { if ( node . isRoot ( ) ) { setIcon ( DisplayUtils . getScaledIcon ( ROOT_ICON ) ) ; } else if ( target != null ) { if ( target . getContext ( ) != null ) { if ( target . getContext ( ) . isInScope ( ) ) { setIcon ( DisplayUtils . getScaledIcon ( CONTEXT_IN_SCOPE_ICON ) ) ; } else { setIcon ( DisplayUtils . getScaledIcon ( CONTEXT_ICON ) ) ; } } else if ( target . isInScopeOnly ( ) ) { setIcon ( DisplayUtils . getScaledIcon ( ALL_IN_SCOPE_ICON ) ) ; } } } return this ; }
Sets custom tree node logos.