The RtfBorder handle one row or cell border.
INTERNAL USE ONLY
| Field Summary |
|---|
| protected static final byte[] | ROW_BORDER_LEFT | Constant for the left row border |
| protected static final byte[] | ROW_BORDER_TOP | Constant for the top row border |
| protected static final byte[] | ROW_BORDER_RIGHT | Constant for the right row border |
| protected static final byte[] | ROW_BORDER_BOTTOM | Constant for the bottom row border |
| protected static final byte[] | ROW_BORDER_HORIZONTAL | Constant for the horizontal line |
| protected static final byte[] | ROW_BORDER_VERTICAL | Constant for the vertical line |
| protected static final byte[] | CELL_BORDER_LEFT | Constant for the left cell border |
| protected static final byte[] | CELL_BORDER_TOP | Constant for the top cell border |
| protected static final byte[] | CELL_BORDER_RIGHT | Constant for the right cell border |
| protected static final byte[] | CELL_BORDER_BOTTOM | Constant for the bottom cell border |
| protected static final byte[] | BORDER_WIDTH | Constant for the border width |
| protected static final byte[] | BORDER_COLOR_NUMBER | Constant for the border color number |
| protected static final byte[] | BORDER_STYLE_SINGLE | Constant for the single border style |
| protected static final byte[] | BORDER_STYLE_DOUBLE_THICK | Constant for the double thick border style |
| protected static final byte[] | BORDER_STYLE_SHADOWED | Constant for the shadowed border style |
| protected static final byte[] | BORDER_STYLE_DOTTED | Constant for the dotted border style |
| protected static final byte[] | BORDER_STYLE_DASHED | Constant for the dashed border style |
| protected static final byte[] | BORDER_STYLE_HAIRLINE | Constant for the hairline border style |
| protected static final byte[] | BORDER_STYLE_DOUBLE | Constant for the double border style |
| protected static final byte[] | BORDER_STYLE_DOT_DASH | Constant for the dot dash border style |
| protected static final byte[] | BORDER_STYLE_DOT_DOT_DASH | Constant for the dot dot dash border style |
| protected static final byte[] | BORDER_STYLE_TRIPLE | Constant for the triple border style |
| protected static final byte[] | BORDER_STYLE_THICK_THIN | Constant for the thick thin border style |
| protected static final byte[] | BORDER_STYLE_THIN_THICK | Constant for the thin thick border style |
| protected static final byte[] | BORDER_STYLE_THIN_THICK_THIN | Constant for the thin thick thin border style |
| protected static final byte[] | BORDER_STYLE_THICK_THIN_MED | Constant for the thick thin medium border style |
| protected static final byte[] | BORDER_STYLE_THIN_THICK_MED | Constant for the thin thick medium border style |
| protected static final byte[] | BORDER_STYLE_THIN_THICK_THIN_MED | Constant for the thin thick thin medium border style |
| protected static final byte[] | BORDER_STYLE_THICK_THIN_LARGE | Constant for the thick thin large border style |
| protected static final byte[] | BORDER_STYLE_THIN_THICK_LARGE | Constant for the thin thick large border style |
| protected static final byte[] | BORDER_STYLE_THIN_THICK_THIN_LARGE | Constant for the thin thick thin large border style |
| protected static final byte[] | BORDER_STYLE_WAVY | Constant for the wavy border style |
| protected static final byte[] | BORDER_STYLE_DOUBLE_WAVY | Constant for the double wavy border style |
| protected static final byte[] | BORDER_STYLE_STRIPED | Constant for the striped border style |
| protected static final byte[] | BORDER_STYLE_EMBOSS | Constant for the embossed border style |
| protected static final byte[] | BORDER_STYLE_ENGRAVE | Constant for the engraved border style |
| protected static final int | ROW_BORDER | Constant for a row border |
| protected static final int | CELL_BORDER | Constant for a cell border |
| protected static final int | NO_BORDER | This border is no border :-) |
| protected static final int | LEFT_BORDER | Constant for a left border |
| protected static final int | TOP_BORDER | Constant for a top border |
| protected static final int | RIGHT_BORDER | Constant for a right border |
| protected static final int | BOTTOM_BORDER | Constant for a bottom border |
| protected static final int | BOX_BORDER | Constant for a box (left, top, right, bottom) border |
| protected static final int | VERTICAL_BORDER | Constant for a vertical line |
| protected static final int | HORIZONTAL_BORDER | Constant for a horizontal line |
| public static final int | BORDER_NONE | Constant for a border with no border |
| public static final int | BORDER_SINGLE | Constant for a single border |
| public static final int | BORDER_DOUBLE_THICK | Constant for a double thick border |
| public static final int | BORDER_SHADOWED | Constant for a shadowed border |
| public static final int | BORDER_DOTTED | Constant for a dotted border |
| public static final int | BORDER_DASHED | Constant for a dashed border |
| public static final int | BORDER_HAIRLINE | Constant for a hairline border |
| public static final int | BORDER_DOUBLE | Constant for a double border |
| public static final int | BORDER_DOT_DASH | Constant for a dot dash border |
| public static final int | BORDER_DOT_DOT_DASH | Constant for a dot dot dash border |
| public static final int | BORDER_TRIPLE | Constant for a triple border |
| public static final int | BORDER_THICK_THIN | Constant for a thick thin border |
| public static final int | BORDER_THIN_THICK | Constant for a thin thick border |
| public static final int | BORDER_THIN_THICK_THIN | Constant for a thin thick thin border |
| public static final int | BORDER_THICK_THIN_MED | Constant for a thick thin medium border |
| public static final int | BORDER_THIN_THICK_MED | Constant for a thin thick medium border |
| public static final int | BORDER_THIN_THICK_THIN_MED | Constant for a thin thick thin medium border |
| public static final int | BORDER_THICK_THIN_LARGE | Constant for a thick thin large border |
| public static final int | BORDER_THIN_THICK_LARGE | Constant for a thin thick large border |
| public static final int | BORDER_THIN_THICK_THIN_LARGE | Constant for a thin thick thin large border |
| public static final int | BORDER_WAVY | Constant for a wavy border |
| public static final int | BORDER_DOUBLE_WAVY | Constant for a double wavy border |
| public static final int | BORDER_STRIPED | Constant for a striped border |
| public static final int | BORDER_EMBOSS | Constant for an embossed border |
| public static final int | BORDER_ENGRAVE | Constant for an engraved border |
| Constructor: |
protected RtfBorder(RtfDocument doc,
int borderType,
RtfBorder border) {
super(doc);
this.borderType = borderType;
this.borderPosition = border.getBorderPosition();
this.borderStyle = border.getBorderStyle();
this.borderWidth = border.getBorderWidth();
this.borderColor = new RtfColor(this.document, border.getBorderColor());
}
Makes a copy of the given RtfBorder Parameters:
doc - The RtfDocument this RtfBorder belongs to
borderType - The border type of this RtfBorder
border - The RtfBorder to copy
|
protected RtfBorder(RtfDocument doc,
int borderType,
int borderPosition,
int borderStyle,
float borderWidth,
Color borderColor) {
super(doc);
this.borderType = borderType;
this.borderPosition = borderPosition;
this.borderStyle = borderStyle;
this.borderWidth = (int) Math.min((borderWidth * TWIPS_FACTOR), 75);
if(this.borderWidth == 0) {
this.borderStyle = BORDER_NONE;
}
if(borderColor == null) {
this.borderColor = new RtfColor(this.document, new Color(0, 0, 0));
} else {
this.borderColor = new RtfColor(this.document, borderColor);
}
}
Parameters:
doc - The RtfDocument this RtfBorder belongs to
borderType - The type of border this RtfBorder is
borderPosition - The position of this RtfBorder
borderStyle - The style of this RtfBorder
borderWidth - The width of this RtfBorder
borderColor - The color of this RtfBorder
|
| Method from com.lowagie.text.rtf.table.RtfBorder Detail: |
protected RtfColor getBorderColor() {
return borderColor;
}
Gets the color of this RtfBorder |
protected int getBorderPosition() {
return borderPosition;
}
Gets the position of this RtfBorder |
protected int getBorderStyle() {
return borderStyle;
}
Gets the style of this RtfBorder |
protected int getBorderType() {
return borderType;
}
Gets the type of this RtfBorder |
protected int getBorderWidth() {
return borderWidth;
}
Gets the width of this RtfBorder |
public void writeContent(OutputStream result) throws IOException {
if(this.borderStyle == BORDER_NONE || this.borderPosition == NO_BORDER || this.borderWidth == 0) {
return;
}
if(this.borderType == ROW_BORDER) {
switch(this.borderPosition) {
case LEFT_BORDER:
result.write(ROW_BORDER_LEFT);
break;
case TOP_BORDER:
result.write(ROW_BORDER_TOP);
break;
case RIGHT_BORDER:
result.write(ROW_BORDER_RIGHT);
break;
case BOTTOM_BORDER:
result.write(ROW_BORDER_BOTTOM);
break;
case HORIZONTAL_BORDER:
result.write(ROW_BORDER_HORIZONTAL);
break;
case VERTICAL_BORDER:
result.write(ROW_BORDER_VERTICAL);
break;
default:
return;
}
result.write(writeBorderStyle());
result.write(BORDER_WIDTH);
result.write(intToByteArray(this.borderWidth));
result.write(BORDER_COLOR_NUMBER);
result.write(intToByteArray(this.borderColor.getColorNumber()));
this.document.outputDebugLinebreak(result);
} else if(this.borderType == CELL_BORDER) {
switch(this.borderPosition) {
case LEFT_BORDER:
result.write(CELL_BORDER_LEFT);
break;
case TOP_BORDER:
result.write(CELL_BORDER_TOP);
break;
case RIGHT_BORDER:
result.write(CELL_BORDER_RIGHT);
break;
case BOTTOM_BORDER:
result.write(CELL_BORDER_BOTTOM);
break;
default:
return;
}
result.write(writeBorderStyle());
result.write(BORDER_WIDTH);
result.write(intToByteArray(this.borderWidth));
result.write(BORDER_COLOR_NUMBER);
result.write(intToByteArray(this.borderColor.getColorNumber()));
this.document.outputDebugLinebreak(result);
}
}
Writes the RtfBorder settings |