Esempio n. 1
0
  /**
   * Create the given ViewManager
   *
   * @param viewDescriptor Identifies the VM
   * @param properties Property string to pass
   * @return The new one
   */
  public ViewManager createViewManager(ViewDescriptor viewDescriptor, String properties) {
    synchronized (viewManagers) {
      try {
        ViewManager viewManager = null;
        if (viewDescriptor == null) {
          viewDescriptor = new ViewDescriptor();
        }
        if (viewDescriptor.getClassNames().size() > 0) {
          Class viewManagerClass = Misc.findClass((String) viewDescriptor.getClassNames().get(0));
          Constructor ctor =
              Misc.findConstructor(
                  viewManagerClass,
                  new Class[] {IntegratedDataViewer.class, ViewDescriptor.class, String.class});

          if (ctor == null) {
            throw new IllegalArgumentException(
                "cannot create ViewManager:" + viewManagerClass.getName());
          }

          viewManager =
              (ViewManager) ctor.newInstance(new Object[] {getIdv(), viewDescriptor, properties});
        } else {
          viewManager = new MapViewManager(getIdv(), viewDescriptor, properties);
        }

        addViewManager(viewManager);
        return viewManager;
      } catch (Throwable e) {
        logException("In getViewManager", e);
        return null;
      }
    }
  }
Esempio n. 2
0
 /**
  * Add the new view manager into the list if we don't have one with the {@link ViewDescriptor} of
  * the new view manager already.
  *
  * @param newViewManager The new view manager
  */
 @Override
 public void addViewManager(ViewManager newViewManager) {
   super.addViewManager(newViewManager);
   focusLayerControlsOn(newViewManager, false);
 }
Esempio n. 3
0
 /**
  * Add the view managers in the list
  *
  * @param newVms New view managers
  */
 public void addViewManagers(List newVms) {
   for (int i = 0; i < newVms.size(); i++) {
     ViewManager vm = (ViewManager) newVms.get(i);
     addViewManager(vm);
   }
 }