示例#1
0
    /** ok, the importer has now finished, we can tidy up now */
    public final void doFinished() {
      // also have a pass through to set the stepper in any narratives
      // try to set the pointer to the TimeStepper in the narratives, if there are any
      Session newSession = _theApplication.getCurrentSession();
      if (newSession != null) {
        Layers theData = newSession.getData();
        Debrief.GUI.Views.PlainView pv = newSession.getCurrentView();
        if (pv instanceof Debrief.GUI.Views.AnalysisView) {
          int len = theData.size();
          for (int i = 0; i < len; i++) {
            Layer ly = theData.elementAt(i);
            if (ly instanceof Debrief.Wrappers.NarrativeWrapper) {
              @SuppressWarnings("unused")
              Debrief.Wrappers.NarrativeWrapper nw = (Debrief.Wrappers.NarrativeWrapper) ly;
            } // whether this is a narrative
          } // through the layers
        } // whether this is an analysis view
      } // if we managed to create a session

      // put the filename into the MRU
      Debrief.GUI.Frames.Application.addToMru(_theFile.getPath());

      // and restore the application cursor
      _theApplication.restoreCursor();
    }
示例#2
0
  /**
   * pass through the data, and assign any watchables as primary and secondary
   *
   * @param onlyAssignTracks only put TracksWrappers on the tote
   */
  public void autoAssign(final boolean onlyAssignTracks) {

    // check we have some data to search
    if (_theLayers != null) {

      // pass through the data to find the WatchableLists
      for (int l = 0; l < _theLayers.size(); l++) {
        final Layer layer = _theLayers.elementAt(l);

        if (layer instanceof WatchableList) {
          if (_theSecondaries != null) {
            // have we got our full set of secondarires yet?
            if (_theSecondaries.length >= MAX_SECONDARIES) {
              MWC.GUI.Dialogs.DialogFactory.showMessage("Secondary limit reached", MAX_MESSAGE);
              return;
            }
          }

          processWatchableList((WatchableList) layer, onlyAssignTracks);
        } else {
          final Enumeration<Editable> iter = layer.elements();
          while (iter.hasMoreElements()) {
            final Plottable p = (Plottable) iter.nextElement();
            if (p instanceof WatchableList) {

              if (_theSecondaries != null) {
                // have we got our full set of secondarires yet?
                if (_theSecondaries.length >= MAX_SECONDARIES) {
                  MWC.GUI.Dialogs.DialogFactory.showMessage("Secondary limit reached", MAX_MESSAGE);
                  return;
                }
              }

              processWatchableList((WatchableList) p, onlyAssignTracks);
            }
          }
        }
      }
    }
  }