/** * 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; }
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); }