コード例 #1
0
ファイル: Console.java プロジェクト: xanax/scratch
 void restoreFromCheckpoint(File checkpoint) {
   try {
     state = Checkpoint.restoreFromCheckpoint(checkpoint.getCanonicalPath());
     parameters = state.parameters;
     paramPanel.loadParameters();
     conPanel.loadParameters();
     paused = true;
     setStep(false);
     spawnPlayThread(true);
     stopButton.setEnabled(true);
   } catch (OptionalDataException e) {
     Output.initialError(
         "A ClassNotFoundException was generated upon"
             + "starting up from a checkpoint."
             + "\nHere it is:\n"
             + e);
   } catch (ClassNotFoundException e) {
     Output.initialError(
         "A ClassNotFoundException was generated upon"
             + "starting up from a checkpoint."
             + "\nHere it is:\n"
             + e);
   } catch (IOException e) {
     Output.initialError(
         "An IO Exception was generated upon"
             + "starting up, probably in setting up a log"
             + "\nHere it is:\n"
             + e);
   }
 }
コード例 #2
0
ファイル: Console.java プロジェクト: xanax/scratch
  /** @param f */
  void loadParameters(File f) {
    try {
      parameters = new ParameterDatabase(f, clArgs);
    } catch (FileNotFoundException ex) {
      Output.initialError(
          "A File Not Found Exception was generated upon "
              + "reading the parameter file \""
              + f.getPath()
              + "\".\nHere it is:\n"
              + ex);
    } catch (IOException ex) {
      Output.initialError(
          "An IO Exception was generated upon reading the "
              + "parameter file \""
              + f.getPath()
              + "\".\nHere it is:\n"
              + ex);
    }

    if (parameters == null) {
      Output.initialError("No parameter file was loaded");
    } else {
      paramPanel.loadParameters();
      conPanel.loadParameters();
    }
  }