- /**
- * <p>Copyright: Copyright (c) 2002-2004</p>
- * <p>Company: JavaResearch(http://www.javaresearch.org)</p>
- * <p>最后更新日期:2003年4月30日
- * @author cherami
- */
- package org.jr.swing;
-
- import javax.swing.*;
- import java.awt.*;
- /**
- * 具有显示属性的文本行。
- * @since 0.6
- */
-
- public class TextLine implements SwingConstants{
- public final String text;
- public final Color color;
- public final int align;
- public final Font font;
- /**
- * 以指定的文本构造一个TextLine。
- * @param text 文本
- */
- public TextLine(String text) {
- this(text,UIManager.getColor("Label.textForeground"),LEFT,UIManager.getFont("Label.font"));
- }
- /**
- * 以指定的文本以及前景色构造一个TextLine。
- * @param text 文本
- * @param color 前景色
- */
- public TextLine(String text,Color color) {
- this(text,color,LEFT,UIManager.getFont("Label.font"));
- }
- /**
- * 以指定的文本以及前景色构造一个TextLine。
- * @param text 文本
- * @param align 对齐方式
- */
- public TextLine(String text,int align) {
- this(text,UIManager.getColor("Label.textForeground"),align,UIManager.getFont("Label.font"));
- }
- /**
- * 以指定的文本、前景色以及显示的对齐方式构造一个TextLine。
- * @param text 文本
- * @param color 前景色
- * @param align 显示的对齐方式
- */
- public TextLine(String text,Color color,int align) {
- this(text,color,align,UIManager.getFont("Label.font"));
- }
- /**
- * 以指定的文本、前景色、显示的对齐方式以及字体构造一个TextLine。
- * @param text 文本
- * @param color 前景色
- * @param align 显示的对齐方式
- * @param font 字体
- */
- public TextLine(String text,Color color,int align,Font font) {
- this.text=text;
- this.color=color;
- this.align=align;
- this.font=font;
- }
- }