onbon.bx06.utils
Class TextBinary

java.lang.Object
  extended by onbon.bx06.utils.TextBinary

public class TextBinary
extends Object

文字图文工具。


Nested Class Summary
static class TextBinary.Alignment
          水平与垂直对齐方式。
static class TextBinary.BreakType
          换行处理方式。
 
Constructor Summary
TextBinary(int width, int height)
          建构子。
 
Method Summary
 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)
          将播放效果为垂直连移的文字分页。
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextBinary

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

Parameters:
width - 宽度。
height - 高度。
Method Detail

getFont

public Font getFont()
取得字型。

Returns:
字型。

setFont

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

Parameters:
font - 字型。

getWidth

public int getWidth()
取得宽度。

Returns:
宽度。

setWidth

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

Parameters:
width - 宽度。

getHeight

public int getHeight()
取得高度。

Returns:
高度。

setHeight

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

Parameters:
height - 高度。

getBackground

public Color getBackground()
取得背景色。

Returns:
背景色。

setBackground

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

Parameters:
background - 背景色。

getForeground

public Color getForeground()
取得前景色。

Returns:
前景色。

setForeground

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

Parameters:
foreground - 前景色。

read

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

Parameters:
filePath - 档案路径。
encoding - 编码。
breakType - 換行處理。
Returns:
结果。
Throws:
Exception - 读取发生失败。

blank

public BufferedImage blank()
產生空白页。

Returns:
结果。

linePaging

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

Parameters:
value - 文字组。
verticalAlignment - 垂直对齐方式。
Returns:
结果。

linePaging

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

Parameters:
value - 文字组。
verticalAlignment - 垂直对齐方式。
Returns:
结果。

paging

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

Parameters:
text - 文字。
horizontalAlignment - 水平对齐方式。
verticalAlignment - 垂直对齐方式。
lineHeight - 行高。
Returns:
结果。

paging

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

Parameters:
values - 文字组。
horizontalAlignment - 水平对齐方式。
verticalAlignment - 垂直对齐方式。
lineHeight - 行高。
Returns:
结果。

horizontalMoving

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

Parameters:
text - 文字。
verticalAlignment - 垂直对齐方式。
Returns:
结果。

verticalMoving

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

Parameters:
text - 文字。
horizontalAlignment - 水平对齐方式。
lineHeight - 行高。
Returns:
结果。

verticalMoving

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

Parameters:
values - 文字组。
horizontalAlignment - 水平对齐方式。
lineHeight - 行高。
Returns:
结果。

splitBreak

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

Parameters:
text - 文字。
Returns:
切割结果。

split

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

Parameters:
text - 文字。
Returns:
切割结果。


Copyright © 2020 onbon. All rights reserved.