Exemplo n.º 1
0
  public void setLocationInBin(int x, int y) throws IOException {

    if (x > bin.getImageWidth() || y > bin.getImageHeight())
      throw new IOException("Tile location not in bin.");

    this.x = x;
    this.y = y;
  }
Exemplo n.º 2
0
 public String toString() {
   return String.format(
       "{%d,%d,%d,%d,%d,%d,%d,%d,%d}",
       bin.getScale(),
       bin.getRow(),
       bin.getCol(),
       bin.getImageWidth(),
       bin.getImageHeight(),
       x,
       y,
       width,
       height);
 }
Exemplo n.º 3
0
 public int getTileHeightInBin() {
   Rectangle binrect = new Rectangle(0, 0, bin.getImageWidth(), bin.getImageHeight());
   Rectangle tilerect = new Rectangle(x, y, getScaledWidth(), getScaledHeight());
   return binrect.intersection(tilerect).height;
 }