/** * Helper function updating the border flag for a side * based on the specified width. * A width of 0 will disable the border on that side. * Any other width enables it. * * @param width width of border * @param side border side constant */ private void updateBorderBasedOnWidth(final float width, final int side) { useVariableBorders = true; if (width > 0) enableBorderSide(side); else disableBorderSide(side); }
/** * Helper function updating the border flag for a side * based on the specified width. * A width of 0 will disable the border on that side. * Any other width enables it. * * @param width width of border * @param side border side constant */ private void updateBorderBasedOnWidth(final float width, final int side) { useVariableBorders = true; if (width > 0) enableBorderSide(side); else disableBorderSide(side); }
/** * Gets a Rectangle that is altered to fit on the page. * * @param top the top position * @param bottom the bottom position * @return a <CODE>Rectangle</CODE> */ public Rectangle rectangle(final float top, final float bottom) { Rectangle tmp = new Rectangle(this); if (getTop() > top) { tmp.setTop(top); tmp.disableBorderSide(TOP); } if (getBottom() < bottom) { tmp.setBottom(bottom); tmp.disableBorderSide(BOTTOM); } return tmp; }
/** * Gets a Rectangle that is altered to fit on the page. * * @param top the top position * @param bottom the bottom position * @return a <CODE>Rectangle</CODE> */ public Rectangle rectangle(final float top, final float bottom) { Rectangle tmp = new Rectangle(this); if (getTop() > top) { tmp.setTop(top); tmp.disableBorderSide(TOP); } if (getBottom() < bottom) { tmp.setBottom(bottom); tmp.disableBorderSide(BOTTOM); } return tmp; }