Ejemplo n.º 1
0
 /* (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;
   }
 }
Ejemplo n.º 2
0
 /* (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);
       }
     }
   }
 }
Ejemplo n.º 3
0
 /* (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;
 }
Ejemplo n.º 4
0
 /* (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;
     }
   }
 }