Paint p = (Paint)thumbnailColorMap.get(t);
Paint p = (Paint)thumbnailColorMap.get(t.getModel());
    public static PaintMethod getPaintMethod(final HeatMapMode mode,                                             final String attributeName,                                             final String elementName,                                             final Scale scale,                                             final Color coldColor,                                             final Color warmColor)    {        PaintMethod pm = new PaintMethod()        {            private Map thumbnailColorMap = new IdentityHashMap();            private Color alpha = new Color(0,0,0,0);                        public void paint(Graphics2D g, Thumbnail t)            {                Rectangle2D region = t.getBounds().getBounds2D();                if(thumbnailColorMap.containsKey(t.getModel()))                {                    Paint p = (Paint)thumbnailColorMap.get(t);                    if(p != null)                    {                        g.setPaint(p);                        g.fill(region);                    }                }                else                {                    setupMethod(t.getModel()); // TODO: change to t, show variance                    Paint p = (Paint)thumbnailColorMap.get(t.getModel());                    if(p != null)                    {                        g.setPaint(p);                        g.fill(region);                    }                }            }                        /**             * Sets up the paint method so the data doesn't have to be             * reassessed with each paint() call.  That would suck.             * TODO: probably include an update() method if the underlying             * value changes.             */            public void setupMethod(ThumbnailDataModel tdm)            {                AttributeMap attrMap = tdm.getAttributeMap();                List attributes = attrMap.getAttributes(attributeName);                if(attributes == null || attributes.size() == 0)                {                    thumbnailColorMap.put(tdm,null);                    return;                }                Attribute[] attrs = new Attribute[attributes.size()];                attributes.toArray(attrs);                                double val = mode.computeValue(attrs,elementName);                Color color = scale.getColor(val,coldColor,warmColor);                thumbnailColorMap.put(tdm,color);            }        };        return pm;    }