Refine search
@Inject @Override public Area getClickbox() { Area clickbox = new Area(); Area clickboxA = Perspective.getClickbox(client, getModelA(), getOrientationA(), getLocalLocation()); Area clickboxB = Perspective.getClickbox(client, getModelB(), getOrientationB(), getLocalLocation()); if (clickboxA == null && clickboxB == null) { return null; } if (clickboxA != null) { clickbox.add(clickboxA); } if (clickboxB != null) { clickbox.add(clickboxB); } return clickbox; } }
/** * Modify the current clipping path by intersecting it with the given path. * @param area area to intersect with the clipping path */ public void intersectClippingPath(Area area) { // lazy cloning of clipping path for performance if (!isClippingPathDirty) { // deep copy (can't use clone() as it performs only a shallow copy) Area cloned = new Area(); cloned.add(clippingPath); clippingPath = cloned; isClippingPathDirty = true; } // intersection as usual clippingPath.intersect(area); }
if (toolTipsEnabled) { rect.setRect(xOffset - lineWidth / 2, highOffset, lineWidth, lowOffset - highOffset); toolTipArea = new Area(rect); toolTipArea.add(new Area(rect)); if (toolTipsEnabled) { rect.setRect(xStart, openOffset - lineWidth / 2, xOffset - xStart, lineWidth); toolTipArea.add(new Area(rect)); rect.setRect(xOffset, closeOffset - lineWidth / 2, xEnd - xOffset, lineWidth); toolTipArea.add(new Area(rect));
private Area buildPrimitive() { Rectangle2D.Double body = new Rectangle2D.Double(6, 0, 30, 12); Ellipse2D.Double head = new Ellipse2D.Double(0, 0, 12, 12); Ellipse2D.Double tail = new Ellipse2D.Double(30, 0, 12, 12); Area tick = new Area(body); tick.add(new Area(head)); tick.add(new Area(tail)); return tick; }
@SuppressWarnings("unused") private Area buildPrimitive() { Rectangle2D.Double body = new Rectangle2D.Double(6, 0, 30, 12); Ellipse2D.Double head = new Ellipse2D.Double(0, 0, 12, 12); Ellipse2D.Double tail = new Ellipse2D.Double(30, 0, 12, 12); Area tick = new Area(body); tick.add(new Area(head)); tick.add(new Area(tail)); return tick; }
private Area getLotDrawArea(Rectangle rect) { Area a = new Area(new Rectangle2D.Double(rect.x, rect.y, rect.width - 1, rect.height - SPACE_LOT_VOYAGE_HEIGHT - 1)); a.add(new Area(new Rectangle2D.Double(rect.x + SPACE_LOT_VOYAGE_WIDTH, rect.y + rect.height - SPACE_LOT_VOYAGE_HEIGHT - 1, rect.width - SPACE_LOT_VOYAGE_WIDTH * 2 - 1, SPACE_LOT_VOYAGE_HEIGHT))); a.add(new Area(new Ellipse2D.Double(rect.x, rect.y + rect.height - SPACE_LOT_VOYAGE_HEIGHT * 2 - 1, SPACE_LOT_VOYAGE_WIDTH * 2, SPACE_LOT_VOYAGE_HEIGHT * 2))); a.add(new Area(new Ellipse2D.Double(rect.x + rect.width - SPACE_LOT_VOYAGE_WIDTH * 2 - 1, rect.y + rect.height - SPACE_LOT_VOYAGE_HEIGHT * 2 - 1, SPACE_LOT_VOYAGE_WIDTH * 2, SPACE_LOT_VOYAGE_HEIGHT * 2))); return a; }
int w = ((int) dim.getWidth() / 2) - (bi.getWidth() / 2); int h = ((int) dim.getHeight() / 2) - (bi.getHeight() / 2); Rectangle oldArea = new Rectangle(w, h, bi.getWidth(), bi.getHeight()); bi = bi2; w = ((int) dim.getWidth() / 2) - (bi.getWidth() / 2); h = ((int) dim.getHeight() / 2) - (bi.getHeight() / 2); Rectangle newArea = new Rectangle(w, h, bi.getWidth(), bi.getHeight()); Area area = new Area(); area.add(oldArea); area.add(newArea); Rectangle updateArea = area.getBounds(); paintImmediately(updateArea);