Class TextElement


public class TextElement extends AbstractElement<TextElement>
文本元素
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • TextElement

      public TextElement(String text, Font font, int x, int y)
      Parameters:
      text - 文本内容
      font - Font对象
      x - x坐标
      y - y坐标
    • TextElement

      public TextElement(String text, int fontSize, int x, int y)
      Parameters:
      text - 文本内容
      fontSize - 字号
      x - x坐标
      y - y坐标
    • TextElement

      public TextElement(String text, String fontName, int fontSize, int x, int y)
      Parameters:
      text - 文本内容
      fontName - 字体名称
      fontSize - 字号
      x - x坐标
      y - y坐标
  • Method Details

    • setAutoBreakLine

      public TextElement setAutoBreakLine(int maxLineWidth, int maxLineCount, int lineHeight)
      设置自动换行
      Parameters:
      maxLineWidth - 最大宽度(超出则换行)
      maxLineCount - 最大行数(超出则丢弃)
      lineHeight - 行高
      Returns:
      当前对象
    • getText

      public String getText()
    • setText

      public TextElement setText(String text)
    • getFont

      public Font getFont()
    • setFont

      public TextElement setFont(Font font)
    • getColor

      public Color getColor()
    • setColor

      public TextElement setColor(Color color)
    • setColor

      public TextElement setColor(int r, int g, int b)
    • isStrikeThrough

      public boolean isStrikeThrough()
    • setStrikeThrough

      public TextElement setStrikeThrough(boolean strikeThrough)
    • isAutoBreakLine

      public boolean isAutoBreakLine()
    • setAutoBreakLine

      public TextElement setAutoBreakLine(boolean autoBreakLine)
    • getMaxLineWidth

      public int getMaxLineWidth()
    • setMaxLineWidth

      public TextElement setMaxLineWidth(int maxLineWidth)
    • getMaxLineCount

      public int getMaxLineCount()
    • setMaxLineCount

      public TextElement setMaxLineCount(int maxLineCount)
    • getLineHeight

      public int getLineHeight()
    • setLineHeight

      public TextElement setLineHeight(int lineHeight)
    • getRotate

      public Integer getRotate()
    • setRotate

      public TextElement setRotate(Integer rotate)