コード例 #1
0
  private int getSpecialWidth() {
    AllBinaryTiledLayer terrainTiledLayer = geographicMapInterface.getAllBinaryTiledLayer();
    DisplayInfoSingleton displayInfo = DisplayInfoSingleton.getInstance();

    if (terrainTiledLayer.getWidth() > displayInfo.getLastWidth()) {
      return terrainTiledLayer.getWidth() - displayInfo.getLastWidth();
    } else {
      return displayInfo.getLastWidth()
          - terrainTiledLayer.getWidth()
          + terrainTiledLayer.getCellWidth();
    }
  }
コード例 #2
0
  public void scrollMiddleX() throws Exception {
    AllBinaryTiledLayer terrainTiledLayer = geographicMapInterface.getAllBinaryTiledLayer();
    DisplayInfoSingleton displayInfo = DisplayInfoSingleton.getInstance();

    // PreLogUtil.put(diffX + CommonSeps.getInstance().SPACE + CommonSeps.getInstance().SPACE +
    // terrainTiledLayer.getWidth() + CommonSeps.getInstance().SPACE + displayInfo.getLastWidth(),
    // this, "scrollMiddleX");

    this.move(-terrainTiledLayer.getX(), 0);

    if (terrainTiledLayer.getWidth() < displayInfo.getLastWidth()) {
      int diffX = ((displayInfo.getLastWidth() - terrainTiledLayer.getWidth()) >> 1);
      this.move(-diffX, 0);
    } else {
      int diffX = ((terrainTiledLayer.getWidth() - displayInfo.getLastWidth()) >> 1);
      this.move(diffX, 0);
    }
  }