Java Code Examples for com.lowagie.text.Rectangle#setRight()

The following examples show how to use com.lowagie.text.Rectangle#setRight() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PdfContext.java    From geomajas-project-server with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Move this rectangle to the specified bottom-left point.
 *
 * @param rect rectangle to move
 * @param x new x origin
 * @param y new y origin
 */
public void moveRectangleTo(Rectangle rect, float x, float y) {
	float width = rect.getWidth();
	float height = rect.getHeight();
	rect.setLeft(x);
	rect.setBottom(y);
	rect.setRight(rect.getLeft() + width);
	rect.setTop(rect.getBottom() + height);
}
 
Example 2
Source File: PdfContext.java    From geomajas-project-server with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Translate this rectangle over the specified following distances.
 *
 * @param rect rectangle to move
 * @param dx delta x
 * @param dy delta y
 */
public void translateRectangle(Rectangle rect, float dx, float dy) {
	float width = rect.getWidth();
	float height = rect.getHeight();
	rect.setLeft(rect.getLeft() + dx);
	rect.setBottom(rect.getBottom() + dy);
	rect.setRight(rect.getLeft() + dx + width);
	rect.setTop(rect.getBottom() + dy + height);
}
 
Example 3
Source File: BarcodeEANSUPP.java    From gcs with Mozilla Public License 2.0 4 votes vote down vote up
/** Gets the maximum area that the barcode and the text, if
 * any, will occupy. The lower left corner is always (0, 0).
 * @return the size the barcode occupies.
 */
public Rectangle getBarcodeSize() {
    Rectangle rect = ean.getBarcodeSize();
    rect.setRight(rect.getWidth() + supp.getBarcodeSize().getWidth() + n);
    return rect;
}
 
Example 4
Source File: BarcodeEANSUPP.java    From itext2 with GNU Lesser General Public License v3.0 4 votes vote down vote up
/** Gets the maximum area that the barcode and the text, if
 * any, will occupy. The lower left corner is always (0, 0).
 * @return the size the barcode occupies.
 */
public Rectangle getBarcodeSize() {
    Rectangle rect = ean.getBarcodeSize();
    rect.setRight(rect.getWidth() + supp.getBarcodeSize().getWidth() + n);
    return rect;
}