protected void drawHighlightedNodes(Graphics2D g2d, DrawableNode root) {
		nodeStack.clear();
		nodeStack.push(root);
		
		g2d.setColor(highlightColor);
		while(!nodeStack.isEmpty()) {
			DrawableNode n = nodeStack.pop();	
			int x = translateTreeToPixelX(n.getX());
			int y = translateTreeToPixelY(n.getY());
			
			if (n.isSelected()) {
				g2d.setColor(highlightColor);
				g2d.fillRect(x-2, y-2, 5, 5);
				if (n.getParent()!=null) {
					int x1 = translateTreeToPixelX(((DrawableNode)n.getParent()).getX() );
					int y1 = translateTreeToPixelY(((DrawableNode)n.getParent()).getY() );
					BranchPainter branchPainter = n.getBranchPainter();
					if (branchPainter == null)
						branchPainter = defaultBranchPainter;
					//We paint the branches differently depending on the orientation of the tree
					if (tree.getOrientation()==DrawableTree.Direction.RIGHT || tree.getOrientation()==DrawableTree.Direction.LEFT) {
						branchPainter.setOrientation(BranchPainter.Direction.YFIRST);
					}
					else {
						branchPainter.setOrientation(BranchPainter.Direction.XFIRST);
					}
					branchPainter.paintBranch(g2d, x1, y1, x, y, highlightStroke, highlightColor);	
				}
			}
			
			for(Node kid : n.getOffspring()) {
				nodeStack.push( (DrawableNode)kid);
			}	
		}
		
	}