示例#1
0
 /**
  * Returns a constraint for the content of this block that will result in the bounds of the block
  * matching the specified constraint.
  *
  * @param c the outer constraint (<code>null</code> not permitted).
  * @return The content constraint.
  */
 protected RectangleConstraint toContentConstraint(RectangleConstraint c) {
   ParamChecks.nullNotPermitted(c, "c");
   if (c.equals(RectangleConstraint.NONE)) {
     return c;
   }
   double w = c.getWidth();
   Range wr = c.getWidthRange();
   double h = c.getHeight();
   Range hr = c.getHeightRange();
   double ww = trimToContentWidth(w);
   double hh = trimToContentHeight(h);
   Range wwr = trimToContentWidth(wr);
   Range hhr = trimToContentHeight(hr);
   return new RectangleConstraint(
       ww, wwr, c.getWidthConstraintType(), hh, hhr, c.getHeightConstraintType());
 }