📄 elementtags.java
字号:
/** attribute of the cell tag */
public static final String HEADER = "header";
/** attribute of the cell tag */
public static final String NOWRAP = "nowrap";
/** attribute of the table/cell tag */
public static final String BORDERWIDTH = "borderwidth";
/** attribute of the table/cell tag */
public static final String TOP = "top";
/** attribute of the table/cell tag */
public static final String BOTTOM = "bottom";
/** attribute of the table/cell tag */
public static final String WIDTH = "width";
/** attribute of the table/cell tag */
public static final String BORDERCOLOR = "bordercolor";
/** attribute of the table/cell tag */
public static final String BACKGROUNDCOLOR = "backgroundcolor";
/** attribute of the table/cell tag */
public static final String BGRED = "bgred";
/** attribute of the table/cell tag */
public static final String BGGREEN = "bggreen";
/** attribute of the table/cell tag */
public static final String BGBLUE = "bgblue";
/** attribute of the table/cell tag */
public static final String GRAYFILL = "grayfill";
// Misc
/** the image tag */
public static final String IMAGE = "image";
/** attribute of the image and annotation tag */
public static final String URL = "url";
/** attribute of the image tag */
public static final String UNDERLYING = "underlying";
/** attribute of the image tag */
public static final String TEXTWRAP = "textwrap";
/** attribute of the image tag */
public static final String ALT = "alt";
/** attribute of the image tag */
public static final String ABSOLUTEX = "absolutex";
/** attribute of the image tag */
public static final String ABSOLUTEY = "absolutey";
/** attribute of the image tag */
public static final String PLAINWIDTH = "plainwidth";
/** attribute of the image tag */
public static final String PLAINHEIGHT = "plainheight";
/** attribute of the image tag */
public static final String SCALEDWIDTH = "scaledwidth";
/** attribute of the image tag */
public static final String SCALEDHEIGHT = "scaledheight";
/** attribute of the image tag */
public static final String ROTATION = "rotation";
/** the newpage tag */
public static final String NEWPAGE = "newpage";
/** the newpage tag */
public static final String NEWLINE = "newline";
/** the annotation tag */
public static final String ANNOTATION = "annotation";
/** attribute of the annotation tag */
public static final String FILE = "file";
/** attribute of the annotation tag */
public static final String DESTINATION = "destination";
/** attribute of the annotation tag */
public static final String PAGE = "page";
/** attribute of the annotation tag */
public static final String NAMED = "named";
/** attribute of the annotation tag */
public static final String APPLICATION = "application";
/** attribute of the annotation tag */
public static final String PARAMETERS = "parameters";
/** attribute of the annotation tag */
public static final String OPERATION = "operation";
/** attribute of the annotation tag */
public static final String DEFAULTDIR = "defaultdir";
/** attribute of the annotation tag */
public static final String LLX = "llx";
/** attribute of the annotation tag */
public static final String LLY = "lly";
/** attribute of the annotation tag */
public static final String URX = "urx";
/** attribute of the annotation tag */
public static final String URY = "ury";
/** attribute of the annotation tag */
public static final String CONTENT = "content";
// alignment attribute values
/** the possible value of an alignment attribute */
public static final String ALIGN_LEFT = "Left";
/** the possible value of an alignment attribute */
public static final String ALIGN_CENTER = "Center";
/** the possible value of an alignment attribute */
public static final String ALIGN_RIGHT = "Right";
/** the possible value of an alignment attribute */
public static final String ALIGN_JUSTIFIED = "Justify";
/** the possible value of an alignment attribute */
public static final String ALIGN_JUSTIFIED_ALL = "JustifyAll";
/** the possible value of an alignment attribute */
public static final String ALIGN_TOP = "Top";
/** the possible value of an alignment attribute */
public static final String ALIGN_MIDDLE = "Middle";
/** the possible value of an alignment attribute */
public static final String ALIGN_BOTTOM = "Bottom";
/** the possible value of an alignment attribute */
public static final String ALIGN_BASELINE = "Baseline";
/** the possible value of an alignment attribute */
public static final String DEFAULT = "Default";
/** the possible value of an alignment attribute */
public static final String UNKNOWN = "unknown";
/** the possible value of an alignment attribute */
public static final String FONT = "font";
/** the possible value of an alignment attribute */
public static final String SIZE = "size";
/** the possible value of an alignment attribute */
public static final String STYLE = "fontstyle";
/** the possible value of a tag */
public static final String HORIZONTALRULE = "horizontalrule";
/** the possible value of a tag */
public static final String PAGE_SIZE = "pagesize";
/** the possible value of a tag */
public static final String ORIENTATION = "orientation";
/** a possible list attribute */
public static final String ALIGN_INDENTATION_ITEMS = "alignindent";
/** a possible list attribute */
public static final String AUTO_INDENT_ITEMS = "autoindent";
/** a possible list attribute */
public static final String LOWERCASE = "lowercase";
// methods
/**
* Translates the alignment value to a String value.
*
* @param alignment the alignment value
* @return the translated value
*/
public static String getAlignment(int alignment) {
switch(alignment) {
case Element.ALIGN_LEFT:
return ALIGN_LEFT;
case Element.ALIGN_CENTER:
return ALIGN_CENTER;
case Element.ALIGN_RIGHT:
return ALIGN_RIGHT;
case Element.ALIGN_JUSTIFIED:
case Element.ALIGN_JUSTIFIED_ALL:
return ALIGN_JUSTIFIED;
case Element.ALIGN_TOP:
return ALIGN_TOP;
case Element.ALIGN_MIDDLE:
return ALIGN_MIDDLE;
case Element.ALIGN_BOTTOM:
return ALIGN_BOTTOM;
case Element.ALIGN_BASELINE:
return ALIGN_BASELINE;
default:
return DEFAULT;
}
}
/**
* Translates a String value to an alignment value.
* (written by Norman Richards, integrated into iText by Bruno)
* @param alignment a String (one of the ALIGN_ constants of this class)
* @return an alignment value (one of the ALIGN_ constants of the Element interface)
*/
public static int alignmentValue(String alignment) {
if (alignment == null) return Element.ALIGN_UNDEFINED;
if (ALIGN_CENTER.equalsIgnoreCase(alignment)) {
return Element.ALIGN_CENTER;
}
if (ALIGN_LEFT.equalsIgnoreCase(alignment)) {
return Element.ALIGN_LEFT;
}
if (ALIGN_RIGHT.equalsIgnoreCase(alignment)) {
return Element.ALIGN_RIGHT;
}
if (ALIGN_JUSTIFIED.equalsIgnoreCase(alignment)) {
return Element.ALIGN_JUSTIFIED;
}
if (ALIGN_JUSTIFIED_ALL.equalsIgnoreCase(alignment)) {
return Element.ALIGN_JUSTIFIED_ALL;
}
if (ALIGN_TOP.equalsIgnoreCase(alignment)) {
return Element.ALIGN_TOP;
}
if (ALIGN_MIDDLE.equalsIgnoreCase(alignment)) {
return Element.ALIGN_MIDDLE;
}
if (ALIGN_BOTTOM.equalsIgnoreCase(alignment)) {
return Element.ALIGN_BOTTOM;
}
if (ALIGN_BASELINE.equalsIgnoreCase(alignment)) {
return Element.ALIGN_BASELINE;
}
return Element.ALIGN_UNDEFINED;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -