synchronized (lock) { if (graphics.get(f) != null) throw new IllegalArgumentException("Error: "+graphic+" is already registered for frame "+f);
ShapeGraphic sg; if ((sg=(ShapeGraphic)graphics.get(f)) != null) { if (sg != graphic) throw new IllegalArgumentException("Error: "+graphic+" is already registered for frame "+f); }
    public void registerGraphic(org.cougaar.core.qos.frame.Frame f, ShapeGraphic graphic) {        if (f == null || graphic == null)            return;        synchronized (lock) {            if (graphics.get(f) != null)               throw new IllegalArgumentException("Error: "+graphic+" is already registered for frame "+f);            //if (graphics.get(f) == null) {                graphics.put(f, graphic);            //}        }    }