onbon.bx06.utils
类 TextBinary

java.lang.Object
  继承者 onbon.bx06.utils.TextBinary

public class TextBinary
extends Object

文字图文工具。


嵌套类摘要
static class TextBinary.Alignment
          水平与垂直对齐方式。
static class TextBinary.BreakType
          换行处理方式。
 
构造方法摘要
TextBinary(int width, int height)
          建构子。
 
方法摘要
 BufferedImage blank()
          產生空白页。
 Color getBackground()
          取得背景色。
 Font getFont()
          取得字型。
 Color getForeground()
          取得前景色。
 int getHeight()
          取得高度。
 int getWidth()
          取得宽度。
 List<BufferedImage> horizontalMoving(String text, TextBinary.Alignment verticalAlignment)
          将播放效果为水平连移的文字分页。
 List<BufferedImage> linePaging(List<String> value, TextBinary.Alignment verticalAlignment)
          單行文字组分页。
 List<BufferedImage> linePaging(String value, TextBinary.Alignment verticalAlignment)
          單行文字组分页。
 List<BufferedImage> paging(List<String> values, TextBinary.Alignment horizontalAlignment, TextBinary.Alignment verticalAlignment, int lineHeight)
          多行文字组分页。
 List<BufferedImage> paging(String text, TextBinary.Alignment horizontalAlignment, TextBinary.Alignment verticalAlignment, int lineHeight)
          多行文字分页。
 List<String> read(String filePath, String encoding, TextBinary.BreakType breakType)
          读取纯文字档案内容。
 void setBackground(Color background)
          设定背景色。
 void setFont(Font font)
          设定字型。
 void setForeground(Color foreground)
          设定前景色。
 void setHeight(int height)
          设定高度。
 void setWidth(int width)
          设定宽度。
 List<String> split(String text)
          配合屏幕寬度與換行符號,把文字切割。
static String[] splitBreak(String text)
          把文字切割。
 List<BufferedImage> verticalMoving(List<String> values, TextBinary.Alignment horizontalAlignment, int lineHeight)
          将播放效果为垂直连移的文字组分页。
 List<BufferedImage> verticalMoving(String text, TextBinary.Alignment horizontalAlignment, int lineHeight)
          将播放效果为垂直连移的文字分页。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

TextBinary

public TextBinary(int width,
                  int height)
建构子。

参数:
width - 宽度。
height - 高度。
方法详细信息

getFont

public Font getFont()
取得字型。

返回:
字型。

setFont

public void setFont(Font font)
设定字型。

参数:
font - 字型。

getWidth

public int getWidth()
取得宽度。

返回:
宽度。

setWidth

public void setWidth(int width)
设定宽度。

参数:
width - 宽度。

getHeight

public int getHeight()
取得高度。

返回:
高度。

setHeight

public void setHeight(int height)
设定高度。

参数:
height - 高度。

getBackground

public Color getBackground()
取得背景色。

返回:
背景色。

setBackground

public void setBackground(Color background)
设定背景色。

参数:
background - 背景色。

getForeground

public Color getForeground()
取得前景色。

返回:
前景色。

setForeground

public void setForeground(Color foreground)
设定前景色。

参数:
foreground - 前景色。

read

public List<String> read(String filePath,
                         String encoding,
                         TextBinary.BreakType breakType)
                  throws Exception
读取纯文字档案内容。

参数:
filePath - 档案路径。
encoding - 编码。
breakType - 換行處理。
返回:
结果。
抛出:
Exception - 读取发生失败。

blank

public BufferedImage blank()
產生空白页。

返回:
结果。

linePaging

public List<BufferedImage> linePaging(List<String> value,
                                      TextBinary.Alignment verticalAlignment)
單行文字组分页。

参数:
value - 文字组。
verticalAlignment - 垂直对齐方式。
lineHeight - 行高。
返回:
结果。

linePaging

public List<BufferedImage> linePaging(String value,
                                      TextBinary.Alignment verticalAlignment)
單行文字组分页。

参数:
value - 文字组。
verticalAlignment - 垂直对齐方式。
返回:
结果。

paging

public List<BufferedImage> paging(String text,
                                  TextBinary.Alignment horizontalAlignment,
                                  TextBinary.Alignment verticalAlignment,
                                  int lineHeight)
多行文字分页。

参数:
text - 文字。
horizontalAlignment - 水平对齐方式。
verticalAlignment - 垂直对齐方式。
lineHeight - 行高。
返回:
结果。

paging

public List<BufferedImage> paging(List<String> values,
                                  TextBinary.Alignment horizontalAlignment,
                                  TextBinary.Alignment verticalAlignment,
                                  int lineHeight)
多行文字组分页。

参数:
values - 文字组。
horizontalAlignment - 水平对齐方式。
verticalAlignment - 垂直对齐方式。
lineHeight - 行高。
返回:
结果。

horizontalMoving

public List<BufferedImage> horizontalMoving(String text,
                                            TextBinary.Alignment verticalAlignment)
将播放效果为水平连移的文字分页。

参数:
text - 文字。
verticalAlignment - 垂直对齐方式。
lineHeight - 行高。
返回:
结果。

verticalMoving

public List<BufferedImage> verticalMoving(String text,
                                          TextBinary.Alignment horizontalAlignment,
                                          int lineHeight)
将播放效果为垂直连移的文字分页。

参数:
text - 文字。
horizontalAlignment - 水平对齐方式。
lineHeight - 行高。
返回:
结果。

verticalMoving

public List<BufferedImage> verticalMoving(List<String> values,
                                          TextBinary.Alignment horizontalAlignment,
                                          int lineHeight)
将播放效果为垂直连移的文字组分页。

参数:
values - 文字组。
horizontalAlignment - 水平对齐方式。
lineHeight - 行高。
返回:
结果。

splitBreak

public static String[] splitBreak(String text)
把文字切割。

参数:
text - 文字。
返回:
切割结果。

split

public List<String> split(String text)
配合屏幕寬度與換行符號,把文字切割。

参数:
text - 文字。
返回:
切割结果。


Copyright © 2018 onbon. All rights reserved.