Ejemplo n.º 1
0
 public void executeClick(Point p, Drawing dwg) {
   if (dwg.getFrontmostContainer(p)
       != null) { // check to make sure there is a shape that contains the point
     dwg.getFrontmostContainer(p).setColor(myColor);
   }
 }
Ejemplo n.º 2
0
 /**
  * On click, if a shape has been clicked, change its color to the Drawing object's current set
  * color.
  */
 public void executeClick(Point p, Drawing dwg) {
   Shape clickedShape = dwg.getFrontmostContainer(p);
   if (clickedShape != null) clickedShape.setColor(dwg.getColor());
 }