/* (non-Javadoc) * @see org.xamjwg.html.renderer.BoundableRenderable#onMouseDisarmed(java.awt.event.MouseEvent) */ public void onMouseDisarmed(MouseEvent event) { BoundableRenderable ar = this.armedRenderable; if (ar != null) { ar.onMouseDisarmed(event); this.armedRenderable = null; } }
/* (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); } } } }
/* (non-Javadoc) * @see org.xamjwg.html.renderer.BoundableRenderable#getRenderablePoint(int, int) */ public RenderablePoint getRenderablePoint(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)) { RenderablePoint rp = br.getRenderablePoint(x - bounds.x, y - bounds.y); if (rp != null) { return rp; } } } } return null; }
/* (non-Javadoc) * @see org.xamjwg.html.renderer.BoundableRenderable#onMouseReleased(java.awt.event.MouseEvent, int, int) */ public void onMouseReleased(MouseEvent event, int x, int y) { Iterator i = this.blocks.iterator(); boolean found = false; while (i.hasNext()) { Object r = i.next(); if (r instanceof BoundableRenderable) { BoundableRenderable br = (BoundableRenderable) r; Rectangle bounds = br.getBounds(); if (bounds.contains(x, y)) { found = true; br.onMouseReleased(event, x - bounds.x, y - bounds.y); BoundableRenderable oldArmedRenderable = this.armedRenderable; if (oldArmedRenderable != null && br != oldArmedRenderable) { oldArmedRenderable.onMouseDisarmed(event); this.armedRenderable = null; } } } } if (!found) { BoundableRenderable oldArmedRenderable = this.armedRenderable; if (oldArmedRenderable != null) { oldArmedRenderable.onMouseDisarmed(event); this.armedRenderable = null; } } }