Exemple #1
0
 /**
  * This method should be called each time user touched the screen. It tracks saves the time of the
  * last action, which helps to determine how long the application has been inactive.
  */
 public static void setActionPerformed() {
   if (state == ApplicationState.IDLE) {
     state = ApplicationState.RUNNING;
     PromptManager.reset();
   }
   lastActionTime = System.currentTimeMillis();
 }
Exemple #2
0
  /** Resume the application. */
  public static void resumeApplication() {
    if (state == ApplicationState.PAUSED) {
      PromptManager.resume();
    } else if (state == ApplicationState.IDLE) {
      LOGGER.info("Application was resumed from idle state");
      PromptManager.reset();
    }

    state = ApplicationState.RUNNING;
  }
Exemple #3
0
  /** Reset the workspace to defaults: clear the workspace and then load the default layout. */
  public static void resetToDefaults() {
    LOGGER.info("Reset workspace and load defaults.");
    clearWorkspace();
    loadLayout(Settings.dataFolder + Settings.defaultLayoutFile);
    // Put drawers on top
    if (leftDrawer != null) TouchClient.putZoneOnTop(leftDrawer);
    if (rightDrawer != null) TouchClient.putZoneOnTop(rightDrawer);
    if (topDrawer != null) {
      TouchClient.putZoneOnTop(topDrawer);
    }

    setSelectedBrush(getAllBrushes().get(0));
    setSelectedPaint(getAllPaints().get(0));
    setActionPerformed();

    PromptManager.reset();
    idleApplication();
  }
Exemple #4
0
  /**
   * Load a save file, including the layout and painting.
   *
   * @param save SaveFile object to load data from
   */
  public static void loadSave(SaveFile save) {
    LOGGER.info("Loading a save file " + save.filename);

    clearWorkspace();
    loadLayout(save.layoutPath);
    canvas.clearAndLoad(save.drawingPath);

    // Put drawers on top
    if (leftDrawer != null) TouchClient.putZoneOnTop(leftDrawer);
    if (rightDrawer != null) TouchClient.putZoneOnTop(rightDrawer);
    if (topDrawer != null) {
      TouchClient.putZoneOnTop(topDrawer);
    }

    setSelectedBrush(getAllBrushes().get(0));
    setSelectedPaint(getAllPaints().get(0));

    PromptManager.reset();
  }