public void draw(Object obj, Component comp, Graphics2D g2, Rectangle rect)
    {
        Color color = (Color) AbstractDisplay.getProperty(obj, "color");
        Color textColor = Color.BLACK;
        if (color != null)
        {
            g2.setPaint(color);
            g2.fill(rect);

            if (color.equals(textColor))
                textColor = Color.WHITE;
        }
        String text = (String) AbstractDisplay.getProperty(obj, "text");
        if (text == null)
        {
            text = "" + obj;
        }
        if (text.length() > MAX_TEXT_LENGTH)
            text = text.substring(0, MAX_TEXT_LENGTH) + "...";
        paintCenteredText(g2, text, rect, 0.8, textColor);
    }