public void paintIcon(Graphics g, Point p, Dimension r, int iconIndex) {
        int x, y;
        int h = (int) r.getHeight();
        int h2 = h / 2;
        int h10 = h / 10;
        x = (int) p.getX();
        y = (int) p.getY();

        switch (iconIndex) {
            case OVAL:
                g.drawOval(x, y, h, h);
                break;

            case AGENT:
                g.drawRect(x, y, h, h);
                g.drawLine(x, y + h2, x + h, y + h2);
                break;

            case APPLICATION:
                g.drawLine(x + h2, y, x + h, y + h2);
                g.drawLine(x + h, y + h2, x + h2, y + h);
                g.drawLine(x + h2, y + h, x, y + h2);
                g.drawLine(x, y + h2, x + h2, y);
                break;

            case TRACE:
                g.drawRect(x, y, h - 1, h - 1);
                g.drawLine(x + 1, y + h, x + h, y + h);
                g.drawLine(x + h, y + h, x + h, y + 1);
                g.drawLine(x + h10, y + h10, x + h10, (y + h) - h10);
                break;

            case TIMER:
                g.drawRect(x, y, h, h);
                g.drawString("0:00", x + h10, y + h10);
                break;

            case UTILS:
                g.drawRoundRect(x, y, h, h, h10, h10);
                break;

            case LINK:
                g.drawLine(x, y + h, x + h, y);
                break;

            case ATTACH:
                g.drawLine(x, y + h, x + h, y);
                g.drawLine(x + h, y, (x + h) - h10, y);
                g.drawLine(x + h, y, x + h, y + h10);
                g.drawOval(x + h10, (y - h10) + h, h10, h10);
                break;

            case CONNECT:
                g.drawLine(x, y + h, x + h, y);
                g.drawLine(x + h, y, (x + h) - h10, y);
                g.drawLine(x + h, y, x + h, y + h10);
                break;

            default:
                break;
        }
    }