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; }
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); }
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; }