📄 pdfpcell.java
字号:
/**
* Sets the padding of the contents in the cell (space between content and border).
* @param padding
*/
public void setPadding(float padding) {
paddingBottom = padding;
paddingTop = padding;
paddingLeft = padding;
paddingRight = padding;
}
/**
* If true, then effective padding will include border widths
* @return true if effective padding includes border widths
*/
public boolean isUseBorderPadding() {
return useBorderPadding;
}
/**
* Adjusts effective padding to include border widths.
* @param use adjust effective padding if true
*/
public void setUseBorderPadding(boolean use) {
useBorderPadding = use;
}
/**
* Sets the leading fixed and variable. The resultant leading will be
* fixedLeading+multipliedLeading*maxFontSize where maxFontSize is the
* size of the bigest font in the line.
* @param fixedLeading the fixed leading
* @param multipliedLeading the variable leading
*/
public void setLeading(float fixedLeading, float multipliedLeading) {
column.setLeading(fixedLeading, multipliedLeading);
}
/**
* Gets the fixed leading
* @return the leading
*/
public float getLeading() {
return column.getLeading();
}
/**
* Gets the variable leading
* @return the leading
*/
public float getMultipliedLeading() {
return column.getMultipliedLeading();
}
/**
* Sets the first paragraph line indent.
* @param indent the indent
*/
public void setIndent(float indent) {
column.setIndent(indent);
}
/**
* Gets the first paragraph line indent.
* @return the indent
*/
public float getIndent() {
return column.getIndent();
}
/**
* Gets the extra space between paragraphs.
* @return the extra space between paragraphs
*/
public float getExtraParagraphSpace() {
return column.getExtraParagraphSpace();
}
/**
* Sets the extra space between paragraphs.
* @param extraParagraphSpace the extra space between paragraphs
*/
public void setExtraParagraphSpace(float extraParagraphSpace) {
column.setExtraParagraphSpace(extraParagraphSpace);
}
/**
* Getter for property fixedHeight.
* @return Value of property fixedHeight.
*/
public float getFixedHeight() {
return fixedHeight;
}
/**
* Setter for property fixedHeight.
* @param fixedHeight New value of property fixedHeight.
*/
public void setFixedHeight(float fixedHeight) {
this.fixedHeight = fixedHeight;
minimumHeight = 0;
}
/**
* Getter for property noWrap.
* @return Value of property noWrap.
*/
public boolean isNoWrap() {
return noWrap;
}
/**
* Setter for property noWrap.
* @param noWrap New value of property noWrap.
*/
public void setNoWrap(boolean noWrap) {
this.noWrap = noWrap;
}
/**
* Getter for property table.
* @return Value of property table.
*/
PdfPTable getTable() {
return table;
}
void setTable(PdfPTable table) {
this.table = table;
column.setText(null);
image = null;
if (table != null) {
table.setExtendLastRow(verticalAlignment == Element.ALIGN_TOP);
column.addElement(table);
table.setWidthPercentage(100);
}
}
/** Getter for property minimumHeight.
* @return Value of property minimumHeight.
*/
public float getMinimumHeight() {
return minimumHeight;
}
/** Setter for property minimumHeight.
* @param minimumHeight New value of property minimumHeight.
*/
public void setMinimumHeight(float minimumHeight) {
this.minimumHeight = minimumHeight;
fixedHeight = 0;
}
/** Getter for property colspan.
* @return Value of property colspan.
*/
public int getColspan() {
return colspan;
}
/** Setter for property colspan.
* @param colspan New value of property colspan.
*/
public void setColspan(int colspan) {
this.colspan = colspan;
}
/**
* Sets the following paragraph lines indent.
* @param indent the indent
*/
public void setFollowingIndent(float indent) {
column.setFollowingIndent(indent);
}
/**
* Gets the following paragraph lines indent.
* @return the indent
*/
public float getFollowingIndent() {
return column.getFollowingIndent();
}
/**
* Sets the right paragraph lines indent.
* @param indent the indent
*/
public void setRightIndent(float indent) {
column.setRightIndent(indent);
}
/**
* Gets the right paragraph lines indent.
* @return the indent
*/
public float getRightIndent() {
return column.getRightIndent();
}
/** Gets the space/character extra spacing ratio for
* fully justified text.
* @return the space/character extra spacing ratio
*/
public float getSpaceCharRatio() {
return column.getSpaceCharRatio();
}
/** Sets the ratio between the extra word spacing and the extra character spacing
* when the text is fully justified.
* Extra word spacing will grow <CODE>spaceCharRatio</CODE> times more than extra character spacing.
* If the ratio is <CODE>PdfWriter.NO_SPACE_CHAR_RATIO</CODE> then the extra character spacing
* will be zero.
* @param spaceCharRatio the ratio between the extra word spacing and the extra character spacing
*/
public void setSpaceCharRatio(float spaceCharRatio) {
column.setSpaceCharRatio(spaceCharRatio);
}
/**
* Sets the run direction of the text content in the cell (PdfWriter.RUN_DIRECTION_DEFAULT, PdfWriter.RUN_DIRECTION_NO_BIDI, PdfWriter.RUN_DIRECTION_LTR or PdfWriter.RUN_DIRECTION_RTL).
* @param runDirection
*/
public void setRunDirection(int runDirection) {
column.setRunDirection(runDirection);
}
/**
* Gets the run direction of the text content in the cell
* @return One of the following values: PdfWriter.RUN_DIRECTION_DEFAULT, PdfWriter.RUN_DIRECTION_NO_BIDI, PdfWriter.RUN_DIRECTION_LTR or PdfWriter.RUN_DIRECTION_RTL.
*/
public int getRunDirection() {
return column.getRunDirection();
}
/** Getter for property image.
* @return Value of property image.
*
*/
public Image getImage() {
return this.image;
}
/** Setter for property image.
* @param image New value of property image.
*
*/
public void setImage(Image image) {
column.setText(null);
table = null;
this.image = image;
}
/** Gets the cell event for this cell.
* @return the cell event
*
*/
public PdfPCellEvent getCellEvent() {
return this.cellEvent;
}
/** Sets the cell event for this cell.
* @param event the cell event
*
*/
public void setCellEvent(PdfPCellEvent event) {
if (event == null) this.cellEvent = null;
else if (this.cellEvent == null) this.cellEvent = event;
else if (this.cellEvent instanceof PdfPCellEventForwarder) ((PdfPCellEventForwarder)this.cellEvent).addCellEvent(event);
else {
PdfPCellEventForwarder forward = new PdfPCellEventForwarder();
forward.addCellEvent(this.cellEvent);
forward.addCellEvent(event);
this.cellEvent = forward;
}
}
/** Gets the arabic shaping options.
* @return the arabic shaping options
*/
public int getArabicOptions() {
return column.getArabicOptions();
}
/** Sets the arabic shaping options. The option can be AR_NOVOWEL,
* AR_COMPOSEDTASHKEEL and AR_LIG.
* @param arabicOptions the arabic shaping options
*/
public void setArabicOptions(int arabicOptions) {
column.setArabicOptions(arabicOptions);
}
/** Gets state of first line height based on max ascender
* @return true if an ascender is to be used.
*/
public boolean isUseAscender() {
return column.isUseAscender();
}
/** Enables/ Disables adjustment of first line height based on max ascender.
*
* @param use adjust height if true
*/
public void setUseAscender(boolean use) {
column.setUseAscender(use);
}
/** Getter for property useDescender.
* @return Value of property useDescender.
*
*/
public boolean isUseDescender() {
return this.useDescender;
}
/** Setter for property useDescender.
* @param useDescender New value of property useDescender.
*
*/
public void setUseDescender(boolean useDescender) {
this.useDescender = useDescender;
}
/**
* Gets the ColumnText with the content of the cell.
* @return a columntext object
*/
public ColumnText getColumn() {
return column;
}
/**
* Sets the columntext in the cell.
* @param column
*/
public void setColumn(ColumnText column) {
this.column = column;
}
/**
* The rotation of the cell. Possible values are
* 0, 90, 180 and 270.
*/
private int rotation;
/**
* Gets the rotation of the cell.
* @return the rotation of the cell.
*/
public int getRotation() {
return this.rotation;
}
/**
* Sets the rotation of the cell. Possible values are
* 0, 90, 180 and 270.
* @param rotation the rotation of the cell
*/
public void setRotation(int rotation) {
rotation %= 360;
if (rotation < 0)
rotation += 360;
if ((rotation % 90) != 0)
throw new IllegalArgumentException("Rotation must be a multiple of 90.");
this.rotation = rotation;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -