| Method from com.lowagie.text.Rectangle Detail: |
public void cloneNonPositionParameters(Rectangle rect) {
this.rotation = rect.rotation;
this.border = rect.border;
this.borderWidth = rect.borderWidth;
this.borderColor = rect.borderColor;
this.backgroundColor = rect.backgroundColor;
this.useVariableBorders = rect.useVariableBorders;
this.borderWidthLeft = rect.borderWidthLeft;
this.borderWidthRight = rect.borderWidthRight;
this.borderWidthTop = rect.borderWidthTop;
this.borderWidthBottom = rect.borderWidthBottom;
this.borderColorLeft = rect.borderColorLeft;
this.borderColorRight = rect.borderColorRight;
this.borderColorTop = rect.borderColorTop;
this.borderColorBottom = rect.borderColorBottom;
}
Copies all of the parameters from a Rectangle object
except the position. |
public void disableBorderSide(int side) {
if (border == UNDEFINED) {
border = 0;
}
border &= ~side;
}
Disables the border on the specified side. |
public void enableBorderSide(int side) {
if (border == UNDEFINED) {
border = 0;
}
border |= side;
}
Enables the border on the specified side. |
public Color getBackgroundColor() {
return backgroundColor;
}
Gets the backgroundcolor. |
public int getBorder() {
return border;
}
Returns the exact type of the border. |
public Color getBorderColor() {
return borderColor;
}
Gets the color of the border. |
public Color getBorderColorBottom() {
if (borderColorBottom == null) return borderColor;
return borderColorBottom;
}
Gets the color of a border. |
public Color getBorderColorLeft() {
if (borderColorLeft == null) return borderColor;
return borderColorLeft;
}
Gets the color of a border. |
public Color getBorderColorRight() {
if (borderColorRight == null) return borderColor;
return borderColorRight;
}
Gets the color of a border. |
public Color getBorderColorTop() {
if (borderColorTop == null) return borderColor;
return borderColorTop;
}
Gets the color of a border. |
public float getBorderWidth() {
return borderWidth;
}
|
public float getBorderWidthBottom() {
return getVariableBorderWidth(borderWidthBottom, BOTTOM);
}
Gets the width of a border. |
public float getBorderWidthLeft() {
return getVariableBorderWidth(borderWidthLeft, LEFT);
}
Gets the width of a border. |
public float getBorderWidthRight() {
return getVariableBorderWidth(borderWidthRight, RIGHT);
}
Gets the width of a border. |
public float getBorderWidthTop() {
return getVariableBorderWidth(borderWidthTop, TOP);
}
Gets the width of a border. |
public float getBottom() {
return lly;
}
Returns the lower left y-coordinate. |
public float getBottom(float margin) {
return lly + margin;
}
Returns the lower left y-coordinate, considering a given margin. |
public ArrayList getChunks() {
return new ArrayList();
}
Gets all the chunks in this element. |
public float getGrayFill() {
if (backgroundColor instanceof GrayColor)
return ((GrayColor)backgroundColor).getGray();
else
return 0;
}
|
public float getHeight() {
return ury - lly;
}
Returns the height of the rectangle. |
public float getLeft() {
return llx;
}
Returns the lower left x-coordinate. |
public float getLeft(float margin) {
return llx + margin;
}
Returns the lower left x-coordinate, considering a given margin. |
public float getRight() {
return urx;
}
Returns the upper right x-coordinate. |
public float getRight(float margin) {
return urx - margin;
}
Returns the upper right x-coordinate, considering a given margin. |
public int getRotation() {
return rotation;
}
Gets the rotation of the rectangle |
public float getTop() {
return ury;
}
Returns the upper right y-coordinate. |
public float getTop(float margin) {
return ury - margin;
}
Returns the upper right y-coordinate, considering a given margin. |
public float getWidth() {
return urx - llx;
}
Returns the width of the rectangle. |
public boolean hasBorder(int type) {
return border != UNDEFINED && (border & type) == type;
}
Indicates if the table has a some type of border. |
public boolean hasBorders() {
return (border > 0)
&& ((borderWidth > 0) || (borderWidthLeft > 0)
|| (borderWidthRight > 0) || (borderWidthTop > 0) || (borderWidthBottom > 0));
}
Indicates if the table has borders. |
public boolean isContent() {
return true;
}
|
public boolean isNestable() {
return false;
}
|
public boolean isUseVariableBorders() {
return useVariableBorders;
}
Indicates whether variable width borders are being used. Returns true if
setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, or
setBorderWidthBottom has been called. |
public void normalize() {
if (llx > urx) {
float a = llx;
llx = urx;
urx = a;
}
if (lly > ury) {
float a = lly;
lly = ury;
ury = a;
}
}
Switches lowerleft with upperright |
public boolean process(ElementListener listener) {
try {
return listener.add(this);
} catch (DocumentException de) {
return false;
}
}
Processes the element by adding it (or the different parts) to an
ElementListener. |
public Rectangle rectangle(float top,
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. |
public Rectangle rotate() {
Rectangle rect = new Rectangle(lly, llx, ury, urx);
rect.rotation = rotation + 90;
rect.rotation %= 360;
return rect;
}
Swaps the values of urx and ury and of lly and llx in order to rotate the
rectangle. |
public void setBackgroundColor(Color value) {
backgroundColor = value;
}
Sets the backgroundcolor of the rectangle. |
public void setBorder(int value) {
border = value;
}
Enables/Disables the border on the specified sides. The border is
specified as an integer bitwise combination of the constants:
LEFT, RIGHT, TOP, BOTTOM. |
public void setBorderColor(Color value) {
borderColor = value;
}
Sets the color of the border. |
public void setBorderColorBottom(Color value) {
borderColorBottom = value;
}
Sets the value of the border color |
public void setBorderColorLeft(Color value) {
borderColorLeft = value;
}
Sets the value of the border color |
public void setBorderColorRight(Color value) {
borderColorRight = value;
}
Sets the value of the border color |
public void setBorderColorTop(Color value) {
borderColorTop = value;
}
Sets the value of the border color |
public void setBorderWidth(float value) {
borderWidth = value;
}
Sets the borderwidth of the table. |
public void setBorderWidthBottom(float borderWidthBottom) {
this.borderWidthBottom = borderWidthBottom;
updateBorderBasedOnWidth(borderWidthBottom, BOTTOM);
}
Sets the width of a border |
public void setBorderWidthLeft(float borderWidthLeft) {
this.borderWidthLeft = borderWidthLeft;
updateBorderBasedOnWidth(borderWidthLeft, LEFT);
}
Sets the width of a border |
public void setBorderWidthRight(float borderWidthRight) {
this.borderWidthRight = borderWidthRight;
updateBorderBasedOnWidth(borderWidthRight, RIGHT);
}
Sets the width of a border |
public void setBorderWidthTop(float borderWidthTop) {
this.borderWidthTop = borderWidthTop;
updateBorderBasedOnWidth(borderWidthTop, TOP);
}
Sets the width of a border |
public void setBottom(float value) {
lly = value;
}
Sets the lower left y-coordinate. |
public void setGrayFill(float value) {
backgroundColor = new GrayColor(value);
}
Sets the grayscale of the rectangle. |
public void setLeft(float value) {
llx = value;
}
Sets the lower left x-coordinate. |
public void setRight(float value) {
urx = value;
}
Sets the upper right x-coordinate. |
public void setTop(float value) {
ury = value;
}
Sets the upper right y-coordinate. |
public void setUseVariableBorders(boolean useVariableBorders) {
this.useVariableBorders = useVariableBorders;
}
Sets a parameter indicating if the rectangle has variable borders |
public void softCloneNonPositionParameters(Rectangle rect) {
if (rect.rotation != 0)
this.rotation = rect.rotation;
if (rect.border != UNDEFINED)
this.border = rect.border;
if (rect.borderWidth != UNDEFINED)
this.borderWidth = rect.borderWidth;
if (rect.borderColor != null)
this.borderColor = rect.borderColor;
if (rect.backgroundColor != null)
this.backgroundColor = rect.backgroundColor;
if (useVariableBorders)
this.useVariableBorders = rect.useVariableBorders;
if (rect.borderWidthLeft != UNDEFINED)
this.borderWidthLeft = rect.borderWidthLeft;
if (rect.borderWidthRight != UNDEFINED)
this.borderWidthRight = rect.borderWidthRight;
if (rect.borderWidthTop != UNDEFINED)
this.borderWidthTop = rect.borderWidthTop;
if (rect.borderWidthBottom != UNDEFINED)
this.borderWidthBottom = rect.borderWidthBottom;
if (rect.borderColorLeft != null)
this.borderColorLeft = rect.borderColorLeft;
if (rect.borderColorRight != null)
this.borderColorRight = rect.borderColorRight;
if (rect.borderColorTop != null)
this.borderColorTop = rect.borderColorTop;
if (rect.borderColorBottom != null)
this.borderColorBottom = rect.borderColorBottom;
}
Copies all of the parameters from a Rectangle object
except the position. |
public String toString() {
StringBuffer buf = new StringBuffer("Rectangle: ");
buf.append(getWidth());
buf.append('x");
buf.append(getHeight());
buf.append(" (rot: ");
buf.append(rotation);
buf.append(" degrees)");
return buf.toString();
}
|
public int type() {
return Element.RECTANGLE;
}
Gets the type of the text element. |