public class TextElement extends AbstractElement<TextElement>
| Constructor and Description |
|---|
TextElement(String text,
Font font,
int x,
int y) |
TextElement(String text,
int fontSize,
int x,
int y) |
TextElement(String text,
String fontName,
int fontSize,
int x,
int y) |
| Modifier and Type | Method and Description |
|---|---|
Color |
getColor() |
Font |
getFont() |
int |
getLineHeight() |
int |
getMaxLineCount() |
int |
getMaxLineWidth() |
Integer |
getRotate() |
String |
getText() |
boolean |
isAutoBreakLine() |
boolean |
isStrikeThrough() |
TextElement |
setAutoBreakLine(boolean autoBreakLine) |
TextElement |
setAutoBreakLine(int maxLineWidth,
int maxLineCount,
int lineHeight)
设置自动换行
|
TextElement |
setColor(Color color) |
TextElement |
setColor(int r,
int g,
int b) |
TextElement |
setFont(Font font) |
TextElement |
setLineHeight(int lineHeight) |
TextElement |
setMaxLineCount(int maxLineCount) |
TextElement |
setMaxLineWidth(int maxLineWidth) |
TextElement |
setRotate(Integer rotate) |
TextElement |
setStrikeThrough(boolean strikeThrough) |
TextElement |
setText(String text) |
public TextElement(String text, Font font, int x, int y)
text - 文本内容font - Font对象x - x坐标y - y坐标public TextElement(String text, int fontSize, int x, int y)
text - 文本内容fontSize - 字号x - x坐标y - y坐标public TextElement setAutoBreakLine(int maxLineWidth, int maxLineCount, int lineHeight)
maxLineWidth - 最大宽度(超出则换行)maxLineCount - 最大行数(超出则丢弃)lineHeight - 行高public String getText()
public TextElement setText(String text)
public Font getFont()
public TextElement setFont(Font font)
public Color getColor()
public TextElement setColor(Color color)
public TextElement setColor(int r, int g, int b)
public boolean isStrikeThrough()
public TextElement setStrikeThrough(boolean strikeThrough)
public boolean isAutoBreakLine()
public TextElement setAutoBreakLine(boolean autoBreakLine)
public int getMaxLineWidth()
public TextElement setMaxLineWidth(int maxLineWidth)
public int getMaxLineCount()
public TextElement setMaxLineCount(int maxLineCount)
public int getLineHeight()
public TextElement setLineHeight(int lineHeight)
public Integer getRotate()
public TextElement setRotate(Integer rotate)
Copyright © 2022. All rights reserved.