/*
   * @see net.refractions.udig.catalog.IGeoResource#resolve(java.lang.Class,
   * org.eclipse.core.runtime.IProgressMonitor)
   */
  public <T> T resolve(Class<T> adaptee, IProgressMonitor monitor) throws IOException {
    if (adaptee == null) return null;

    // if (adaptee.isAssignableFrom(IService.class)) {
    // return adaptee.cast(parent);
    // }
    if (adaptee.isAssignableFrom(IGeoResourceInfo.class)) {
      return adaptee.cast(createInfo(monitor));
    }
    if (adaptee.isAssignableFrom(MapGraphic.class)) {
      return adaptee.cast(getMapGraphic());
    }
    if (adaptee.isAssignableFrom(MapGraphicFactory.class)) {
      return adaptee.cast(MapGraphicFactory.getInstance());
    }
    if (mapgraphic != null && adaptee.isAssignableFrom(mapgraphic.getClass())) {
      return adaptee.cast(createMapGraphic());
    }

    return super.resolve(adaptee, monitor);
  }
 private MapGraphic createMapGraphic() {
   return MapGraphicFactory.getInstance().createMapGraphic(id);
 }