本文整理匯總了Java中com.lowagie.text.Element.ALIGN_JUSTIFIED屬性的典型用法代碼示例。如果您正苦於以下問題:Java Element.ALIGN_JUSTIFIED屬性的具體用法?Java Element.ALIGN_JUSTIFIED怎麽用?Java Element.ALIGN_JUSTIFIED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.lowagie.text.Element
的用法示例。
在下文中一共展示了Element.ALIGN_JUSTIFIED屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getAlignment
/**
* Translates the alignment value.
*
* @param alignment the alignment value
* @return the translated value
*/
public static String getAlignment(int alignment) {
switch(alignment) {
case Element.ALIGN_LEFT:
return HtmlTags.ALIGN_LEFT;
case Element.ALIGN_CENTER:
return HtmlTags.ALIGN_CENTER;
case Element.ALIGN_RIGHT:
return HtmlTags.ALIGN_RIGHT;
case Element.ALIGN_JUSTIFIED:
case Element.ALIGN_JUSTIFIED_ALL:
return HtmlTags.ALIGN_JUSTIFIED;
case Element.ALIGN_TOP:
return HtmlTags.ALIGN_TOP;
case Element.ALIGN_MIDDLE:
return HtmlTags.ALIGN_MIDDLE;
case Element.ALIGN_BOTTOM:
return HtmlTags.ALIGN_BOTTOM;
case Element.ALIGN_BASELINE:
return HtmlTags.ALIGN_BASELINE;
default:
return "";
}
}
示例2: resetAlignment
/**
* Resets the alignment of this line.
* <P>
* The alignment of the last line of for instance a <CODE>Paragraph</CODE>
* that has to be justified, has to be reset to <VAR>ALIGN_LEFT</VAR>.
*/
public void resetAlignment() {
if (alignment == Element.ALIGN_JUSTIFIED) {
alignment = Element.ALIGN_LEFT;
}
}
示例3: writeListBeginning
/**
* Writes the initialization part of the RtfList
*
* @param result The <code>OutputStream</code> to write to
* @throws IOException On i/o errors.
*/
public void writeListBeginning(final OutputStream result) throws IOException {
result.write(RtfParagraph.PARAGRAPH_DEFAULTS);
if(this.inTable) {
result.write(RtfParagraph.IN_TABLE);
}
switch (this.alignment) {
case Element.ALIGN_LEFT:
result.write(RtfParagraphStyle.ALIGN_LEFT);
break;
case Element.ALIGN_RIGHT:
result.write(RtfParagraphStyle.ALIGN_RIGHT);
break;
case Element.ALIGN_CENTER:
result.write(RtfParagraphStyle.ALIGN_CENTER);
break;
case Element.ALIGN_JUSTIFIED:
case Element.ALIGN_JUSTIFIED_ALL:
result.write(RtfParagraphStyle.ALIGN_JUSTIFY);
break;
}
writeIndentation(result);
result.write(RtfFont.FONT_SIZE);
result.write(intToByteArray(fontNumber.getFontSize() * 2));
if(this.symbolIndent > 0) {
result.write(LIST_LEVEL_SYMBOL_INDENT);
result.write(intToByteArray(this.leftIndent));
}
}
示例4: writeParagraphSettings
/**
* Writes the settings of this RtfParagraphStyle.
*
* @param result The <code>OutputStream</code> to write to.
* @throws IOException On i/o errors.
*/
private void writeParagraphSettings(final OutputStream result) throws IOException {
if(this.keepTogether) {
result.write(RtfParagraphStyle.KEEP_TOGETHER);
}
if(this.keepTogetherWithNext) {
result.write(RtfParagraphStyle.KEEP_TOGETHER_WITH_NEXT);
}
switch (alignment) {
case Element.ALIGN_LEFT:
result.write(RtfParagraphStyle.ALIGN_LEFT);
break;
case Element.ALIGN_RIGHT:
result.write(RtfParagraphStyle.ALIGN_RIGHT);
break;
case Element.ALIGN_CENTER:
result.write(RtfParagraphStyle.ALIGN_CENTER);
break;
case Element.ALIGN_JUSTIFIED:
case Element.ALIGN_JUSTIFIED_ALL:
result.write(RtfParagraphStyle.ALIGN_JUSTIFY);
break;
}
result.write(FIRST_LINE_INDENT);
result.write(intToByteArray(this.firstLineIndent));
result.write(RtfParagraphStyle.INDENT_LEFT);
result.write(intToByteArray(indentLeft));
result.write(RtfParagraphStyle.INDENT_RIGHT);
result.write(intToByteArray(indentRight));
if(this.spacingBefore > 0) {
result.write(RtfParagraphStyle.SPACING_BEFORE);
result.write(intToByteArray(this.spacingBefore));
}
if(this.spacingAfter > 0) {
result.write(RtfParagraphStyle.SPACING_AFTER);
result.write(intToByteArray(this.spacingAfter));
}
if(this.lineLeading > 0) {
result.write(RtfParagraph.LINE_SPACING);
result.write(intToByteArray(this.lineLeading));
}
}
示例5: writeRowDefinition
/**
* Writes the row definition/settings.
*
* @param result The <code>OutputStream</code> to write the definitions to.
*/
private void writeRowDefinition(final OutputStream result) throws IOException {
result.write(ROW_BEGIN);
this.document.outputDebugLinebreak(result);
result.write(ROW_WIDTH_STYLE);
result.write(ROW_WIDTH);
result.write(intToByteArray(this.width));
if(this.parentTable.getCellsFitToPage()) {
result.write(ROW_KEEP_TOGETHER);
}
if(this.rowNumber <= this.parentTable.getHeaderRows()) {
result.write(ROW_HEADER_ROW);
}
switch (this.parentTable.getAlignment()) {
case Element.ALIGN_LEFT:
result.write(ROW_ALIGN_LEFT);
break;
case Element.ALIGN_RIGHT:
result.write(ROW_ALIGN_RIGHT);
break;
case Element.ALIGN_CENTER:
result.write(ROW_ALIGN_CENTER);
break;
case Element.ALIGN_JUSTIFIED:
case Element.ALIGN_JUSTIFIED_ALL:
result.write(ROW_ALIGN_JUSTIFIED);
break;
}
result.write(ROW_GRAPH);
RtfBorderGroup borders =this.parentTable.getBorders();
if(borders != null) {
borders.writeContent(result);
}
if(this.parentTable.getCellSpacing() > 0) {
result.write(ROW_CELL_SPACING_LEFT);
result.write(intToByteArray((int) (this.parentTable.getCellSpacing() / 2)));
result.write(ROW_CELL_SPACING_LEFT_STYLE);
result.write(ROW_CELL_SPACING_TOP);
result.write(intToByteArray((int) (this.parentTable.getCellSpacing() / 2)));
result.write(ROW_CELL_SPACING_TOP_STYLE);
result.write(ROW_CELL_SPACING_RIGHT);
result.write(intToByteArray((int) (this.parentTable.getCellSpacing() / 2)));
result.write(ROW_CELL_SPACING_RIGHT_STYLE);
result.write(ROW_CELL_SPACING_BOTTOM);
result.write(intToByteArray((int) (this.parentTable.getCellSpacing() / 2)));
result.write(ROW_CELL_SPACING_BOTTOM_STYLE);
}
result.write(ROW_CELL_PADDING_LEFT);
result.write(intToByteArray((int) (this.parentTable.getCellPadding() / 2)));
result.write(ROW_CELL_PADDING_RIGHT);
result.write(intToByteArray((int) (this.parentTable.getCellPadding() / 2)));
result.write(ROW_CELL_PADDING_LEFT_STYLE);
result.write(ROW_CELL_PADDING_RIGHT_STYLE);
this.document.outputDebugLinebreak(result);
for(int i = 0; i < this.cells.size(); i++) {
RtfCell rtfCell = (RtfCell) this.cells.get(i);
rtfCell.writeDefinition(result);
}
}
示例6: hasToBeJustified
/**
* Checks if this line has to be justified.
*
* @return <CODE>true</CODE> if the alignment equals <VAR>ALIGN_JUSTIFIED</VAR> and there is some width left.
*/
public boolean hasToBeJustified() {
return ((alignment == Element.ALIGN_JUSTIFIED || alignment == Element.ALIGN_JUSTIFIED_ALL) && width != 0);
}