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

    if (terrainTiledLayer.getHeight() > displayInfo.getLastHeight()) {
      return terrainTiledLayer.getHeight() - displayInfo.getLastHeight();
    } else {
      return displayInfo.getLastHeight()
          - terrainTiledLayer.getHeight()
          + terrainTiledLayer.getCellHeight();
    }
  }
コード例 #2
0
  // Graphics.HCENTER & Graphics.TOP
  public void scrollY(int anchor) throws Exception {
    AllBinaryTiledLayer terrainTiledLayer = geographicMapInterface.getAllBinaryTiledLayer();
    DisplayInfoSingleton displayInfo = DisplayInfoSingleton.getInstance();

    if (anchor == Graphics.TOP) {
      LogUtil.put(LogFactory.getInstance("Top", this, "scrollY"));
    } else if (anchor == Graphics.BOTTOM) {
      LogUtil.put(LogFactory.getInstance("Bottom", this, "scrollY"));
      int diffY = (terrainTiledLayer.getHeight() - displayInfo.getLastHeight());
      this.move(0, diffY);
    } else if (anchor == Graphics.VCENTER) {
      LogUtil.put(LogFactory.getInstance("Center", this, "scrollY"));
      // Already sees bottom but I want the map at the Center
      int diffY = (terrainTiledLayer.getHeight() - displayInfo.getLastHeight()) / 2;
      this.move(0, diffY);
    } else {
      throw new Exception("No Such Anchor Supported");
    }
  }