if(attributes == null) { thumbnailColorMap.put(tdm,alpha); return; }
    public static PaintMethod getOverlayMethod(final ColorPairModel colorModel)    {        PaintMethod pm = new AbstractPaintMethod()        {            // TODO figure out to do when image reclassified            private Map thumbnailColorMap = new IdentityHashMap();            private Color alpha = new Color(0,0,0,0);                        public void paint(PPaintContext context, Thumbnail t)            {                Graphics2D g = context.getGraphics();                Rectangle2D bounds = t.getBounds().getBounds2D();                if(thumbnailColorMap.containsKey(t))                {                    Paint p = (Paint)thumbnailColorMap.get(t.getModel());                    g.setPaint(p);                    g.fill(bounds);                }                else                {                    setupMethod(t.getModel(),colorModel);                    Paint p = (Paint)thumbnailColorMap.get(t.getModel());                    if(p != null) {                        g.setPaint(p);                        g.fill(bounds);                    }                }            }                        private void setupMethod(ThumbnailDataModel tdm,                                     ColorPairModel cpm)            {                AttributeMap attrMap = tdm.getAttributeMap();                List attributes = attrMap.getAttributes("Classification");                for(Iterator iter = attributes.iterator(); iter.hasNext();)                {                    Classification c = (Classification)iter.next();                    Category cat = c.getCategory();                    if(cpm.getColor(cat) != null)                    {                        Color col = cpm.getColor(cat);                        Color newColor = new Color(col.getRed(),col.getGreen(),                                                   col.getBlue(),128);                        thumbnailColorMap.put(tdm,newColor);                        return;                    }                }                thumbnailColorMap.put(tdm,alpha);            }        };        return pm;    }