Package org.jamesii.gui.utils

Examples of org.jamesii.gui.utils.SimpleGUIFileExporter


  /**
   * Exports table information to file specified by user.
   */
  protected void export() {
    SimpleGUIFileExporter fileExporter = new SimpleGUIFileExporter() {
      @Override
      public void export(BufferedWriter bufferedWriter) throws IOException {
        List<SimulationTableInformation> simTableInfos =
            simRunTableModel.getSimTableInfos();
        for (SimulationTableInformation simTableInfo : simTableInfos) {
          if (simTableInfo.getSimState() != ComputationRuntimeState.FINISHED) {
            continue;
          }

          // 1: store the simConfig's model parameters
          TaskConfiguration simConfig =
              simTableInfo.getSrti().getComputationTaskConfiguration();
          Map<String, ?> parameters = simConfig.getParameters();
          for (Entry<String, ?> parameter : parameters.entrySet()) {
            bufferedWriter.append(parameter.getKey() + "="
                + parameter.getValue() + sepSequence);
          }

          // 2: store some of the simConfig's simulation parameters
          bufferedWriter.append(simConfig.getSimStartTime() + sepSequence);
          bufferedWriter.append(simConfig.getSimStopFactory() + sepSequence);

          // 3: store the run information
          RunInformation runInfo = simTableInfo.getRunInfo();
          bufferedWriter.append(runInfo.getTotalRuntime() + sepSequence);
          bufferedWriter.append(runInfo.getModelCreationTime() + sepSequence);
          bufferedWriter.append(runInfo.getObserverConfigurationTime()
              + sepSequence);
          bufferedWriter.append(runInfo.getComputationTaskCreationTime()
              + sepSequence);
          bufferedWriter.append(runInfo.getComputationTaskRunTime()
              + sepSequence);
          bufferedWriter.append('\n');
        }
      }
    };
    fileExporter.export(getContent());
  }
View Full Code Here

TOP

Related Classes of org.jamesii.gui.utils.SimpleGUIFileExporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.