Beispiel #1
0
  public final GUIHandler.ComponentDetails exportThis(final Debrief.GUI.Frames.Session session) {
    // get the stepper
    final Debrief.GUI.Views.PlainView pv = session.getCurrentView();
    if (pv instanceof Debrief.GUI.Views.AnalysisView) {
      final Debrief.GUI.Tote.StepControl stepper =
          ((Debrief.GUI.Views.AnalysisView) pv).getTote().getStepper();

      // collate the details for this component
      final GUIHandler.ComponentDetails details = new GUIHandler.ComponentDetails();

      final MWC.GUI.StepperListener theStepper = stepper.getCurrentPainter();

      // is this the snail painter?
      if (theStepper instanceof SnailPainter) {
        final SnailPainter sp = (SnailPainter) theStepper;
        details.addProperty("VectorStretch", MWCXMLReader.writeThis(sp.getVectorStretch()));
      }

      details.addProperty("Cursor", stepper.getCurrentPainter().toString());

      //      details.addProperty("StepLarge", MWCXMLReader.writeThis(stepper.getStepLarge()));
      //      details.addProperty("StepSmall", MWCXMLReader.writeThis(stepper.getStepSmall()));

      // ok, we're switching to exporting the step size in microseconds
      // if we ever get the plain "StepLarge" parameter - we will assume it is millis, else
      // we will always receive the units

      details.addProperty("StepLargeMicros", MWCXMLReader.writeThis(stepper.getStepLarge()));
      details.addProperty("StepSmallMicros", MWCXMLReader.writeThis(stepper.getStepSmall()));

      details.addProperty("AutoStep", MWCXMLReader.writeThis(stepper.getAutoStep()));
      details.addProperty("DateFormat", stepper.getDateFormat());
      // the current DTG
      final HiResDate cTime = stepper.getCurrentTime();
      if (cTime != null) details.addProperty("CurrentTime", MWCXMLReader.writeThis(cTime));
      // the T-zero, if set
      if (stepper.getTimeZero() != null)
        details.addProperty("TimeZero", MWCXMLReader.writeThis(stepper.getTimeZero()));
      details.addProperty("Highlighter", stepper.getCurrentHighlighter().getName());
      // what's the time?
      final HiResDate theStartTime = stepper.getToolboxStartTime();
      if (theStartTime != null)
        details.addProperty(
            "Toolbox_Start_Time", DebriefFormatDateTime.toStringHiRes(theStartTime));
      final HiResDate theEndTime = stepper.getToolboxEndTime();
      if (theEndTime != null)
        details.addProperty("Toolbox_End_Time", DebriefFormatDateTime.toStringHiRes(theEndTime));

      return details;
    } else return null;
  }