コード例 #1
0
ファイル: Application.java プロジェクト: dpyryesk/ePad
  /** 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();
  }
コード例 #2
0
ファイル: Application.java プロジェクト: dpyryesk/ePad
  /**
   * 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();
  }
コード例 #3
0
ファイル: Application.java プロジェクト: dpyryesk/ePad
  /**
   * Perform the initial setup: set size, initialise TouchClient, load GUI and layout, initialise
   * PromptManager and TTSManager.
   */
  @Override
  public void setup() {
    size(Settings.width, Settings.height, P3D);
    frameRate(Settings.targetFPS);
    LOGGER.info(
        "Application started with parameters: width="
            + Settings.width
            + ", height="
            + Settings.height
            + ", fps="
            + Settings.targetFPS);

    instance = this;

    font = createDefaultFont(20);

    // Figure out the touch source
    TouchSource source;
    String sourceString = Settings.touchSourse.toUpperCase();
    if ("TUIO_DEVICE".equals(sourceString)) source = TouchSource.TUIO_DEVICE;
    else if ("MOUSE".equals(sourceString)) source = TouchSource.MOUSE;
    else if ("WM_TOUCH".equals(sourceString)) source = TouchSource.WM_TOUCH;
    else if ("ANDROID".equals(sourceString)) source = TouchSource.ANDROID;
    else if ("SMART".equals(sourceString)) source = TouchSource.SMART;
    else source = TouchSource.MOUSE;

    TouchClient.init(this, source);
    TouchClient.setWarnUnimplemented(false);
    // TouchClient.setTouchDraw(TouchDraw.SMOOTH, 0);
    TouchClient.setDrawTouchPoints(TouchDraw.SMOOTH, 0);

    loadGUI();
    loadLayout(Settings.dataFolder + Settings.defaultLayoutFile);

    PromptManager.init(this);
    TTSManager.init();
    setActionPerformed();
    state = ApplicationState.IDLE;
    SplashScreen.remove();
  }