private void onMouseClick(MouseEvent event) { Point point = event.getPoint(); BoundableRenderable r = this.rblock.getRenderable(point); if (r != null) { Rectangle bounds = r.getBounds(); r.onMouseClick(event, point.x - bounds.x, point.y - bounds.y); } }
/* (non-Javadoc) * @see org.xamjwg.html.renderer.BoundableRenderable#onMouseClick(java.awt.event.MouseEvent, int, int) */ public void onMouseClick(MouseEvent event, int x, int y) { Iterator i = this.blocks.iterator(); while (i.hasNext()) { Object r = i.next(); if (r instanceof BoundableRenderable) { BoundableRenderable br = (BoundableRenderable) r; Rectangle bounds = br.getBounds(); if (bounds.contains(x, y)) { br.onMouseClick(event, x - bounds.x, y - bounds.y); } } } }