// TODO: Move to different class?
  public static void jumpToDiagramShowing(List targets) {

    if (targets == null || targets.size() == 0) {
      return;
    }
    Object first = targets.get(0);
    if (first instanceof ArgoDiagram && targets.size() > 1) {
      setTarget(first);
      setTarget(targets.get(1));
      return;
    }
    if (first instanceof ArgoDiagram && targets.size() == 1) {
      setTarget(first);
      return;
    }

    // TODO: This should get the containing project from the list of
    // targets, not from some global
    Project project = ProjectManager.getManager().getCurrentProject();
    if (project == null) {
      return;
    }

    List<ArgoDiagram> diagrams = project.getDiagramList();
    Object target = TargetManager.getInstance().getTarget();
    if ((target instanceof ArgoDiagram)
        && ((ArgoDiagram) target).countContained(targets) == targets.size()) {
      setTarget(first);
      return;
    }

    ArgoDiagram bestDiagram = null;
    int bestNumContained = 0;
    for (ArgoDiagram d : diagrams) {
      int nc = d.countContained(targets);
      if (nc > bestNumContained) {
        bestNumContained = nc;
        bestDiagram = d;
      }
      if (nc == targets.size()) {
        break;
      }
    }
    if (bestDiagram != null) {
      if (!DiagramUtils.getActiveDiagram().equals(bestDiagram)) {
        setTarget(bestDiagram);
      }
      setTarget(first);
    }
    // making it possible to jump to the modelroots
    if (project.getRoots().contains(first)) {
      setTarget(first);
    }

    // and finally, adjust the scrollbars to show the Fig
    Object f = TargetManager.getInstance().getFigTarget();
    if (f instanceof Fig) {
      Globals.curEditor().scrollToShow((Fig) f);
    }
  }