Beispiel #1
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();
  }
Beispiel #2
0
  /**
   * Load a workspace layout from the provided file.
   *
   * @param filename valid file that contains a workspace layout
   */
  public static void loadLayout(String filename) {
    LOGGER.info("Loading layout from file: " + filename);

    try {
      SimpleMarshaller.unmarshallLayout(new File(filename));
    } catch (Exception e) {
      LOGGER.error("Failed to load layout. " + e.getLocalizedMessage());
    }

    // 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));
  }
Beispiel #3
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();
  }