示例#1
0
 /**
  * Returns a clone of this block.
  *
  * @return A clone.
  * @throws CloneNotSupportedException if there is a problem creating the clone.
  */
 @Override
 public Object clone() throws CloneNotSupportedException {
   AbstractBlock clone = (AbstractBlock) super.clone();
   clone.bounds = (Rectangle2D) ShapeUtilities.clone(this.bounds);
   if (this.frame instanceof PublicCloneable) {
     PublicCloneable pc = (PublicCloneable) this.frame;
     clone.frame = (BlockFrame) pc.clone();
   }
   return clone;
 }
示例#2
0
 public Range trimToContentHeight(AbstractBlock abstractBlock) {
   if (this == null) {
     return null;
   }
   double lowerBound = 0.0;
   double upperBound = Double.POSITIVE_INFINITY;
   if (getLowerBound() > 0.0) {
     lowerBound = abstractBlock.trimToContentHeight(getLowerBound());
   }
   if (getUpperBound() < Double.POSITIVE_INFINITY) {
     upperBound = abstractBlock.trimToContentHeight(getUpperBound());
   }
   return new Range(lowerBound, upperBound);
 }