@Override public Rectangle getBounds() { makePoly(); // set bounds bounds = new Rectangle(attackPoly.getBounds()); bounds.setSize(bounds.getSize().width + 1, bounds.getSize().height + 1); // move poly to upper right of image attackPoly.translate(-bounds.getLocation().x, -bounds.getLocation().y); return bounds; }
@Override public Rectangle getBounds() { makePoly(); // set bounds bounds = new Rectangle(movePoly.getBounds()); bounds.setSize(bounds.getSize().width + 1, bounds.getSize().height + 1); // move poly to upper right of image movePoly.translate(-bounds.getLocation().x, -bounds.getLocation().y); return bounds; }
/** * If we have build full arrow already with single attack and have got * counter attack from our target lately - lets change arrow to halved. */ public void rebuildToHalvedPolygon() { attackPoly = new StraightArrowPolygon(a, t, (int) (8 * this.boardView1.scale), (int) (12 * this.boardView1.scale), true); // set bounds bounds = new Rectangle(attackPoly.getBounds()); bounds.setSize(bounds.getSize().width + 1, bounds.getSize().height + 1); // move poly to upper right of image attackPoly.translate(-bounds.getLocation().x, -bounds.getLocation().y); }
bounds.getSize().height + 1); movePoly.translate(-bounds.getLocation().x, -bounds.getLocation().y);
bounds.getSize().height + 1); attackPoly.translate(-bounds.getLocation().x, -bounds.getLocation().y);