コード例 #1
0
ファイル: AbstractBlock.java プロジェクト: bruno-sales/PCS
 /**
  * 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);
 }