예제 #1
0
 public boolean contains(Shape target) {
   for (Shape o : elementData) {
     if (o != null && o.equals(target)) {
       return true;
     }
   }
   return false;
 }
 @Override
 public void setShape(Shape shape) {
   final Dimension oldSize = getSize();
   final Shape currentShape = getShape();
   if (shape != null && !shape.equals(currentShape)) {
     super.setShape(shape);
     updateShape(oldSize.width, oldSize.height);
   }
 }
예제 #3
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj == null) {
     return false;
   }
   if (super.equals(obj) == false) {
     return false;
   }
   if ((obj instanceof PhotoOverlay) == false) {
     return false;
   }
   PhotoOverlay other = ((PhotoOverlay) obj);
   if (rotation != other.rotation) {
     return false;
   }
   if (viewVolume == null) {
     if (other.viewVolume != null) {
       return false;
     }
   } else {
     if (viewVolume.equals(other.viewVolume) == false) {
       return false;
     }
   }
   if (imagePyramid == null) {
     if (other.imagePyramid != null) {
       return false;
     }
   } else {
     if (imagePyramid.equals(other.imagePyramid) == false) {
       return false;
     }
   }
   if (point == null) {
     if (other.point != null) {
       return false;
     }
   } else {
     if (point.equals(other.point) == false) {
       return false;
     }
   }
   if (shape == null) {
     if (other.shape != null) {
       return false;
     }
   } else {
     if (shape.equals(other.shape) == false) {
       return false;
     }
   }
   if (photoOverlaySimpleExtension == null) {
     if (other.photoOverlaySimpleExtension != null) {
       return false;
     }
   } else {
     if (photoOverlaySimpleExtension.equals(other.photoOverlaySimpleExtension) == false) {
       return false;
     }
   }
   if (photoOverlayObjectExtension == null) {
     if (other.photoOverlayObjectExtension != null) {
       return false;
     }
   } else {
     if (photoOverlayObjectExtension.equals(other.photoOverlayObjectExtension) == false) {
       return false;
     }
   }
   return true;
 }