com.sun.kjava
クラス TextBox

java.lang.Object
  |
  +--com.sun.kjava.TextBox
直接の既知のサブクラス:
ScrollTextBox

public class TextBox
extends java.lang.Object

テキストを表示する、画面上のボックスです。このクラスは、ボックス内にテキストを表示します。ワードは分割されないので、ボックスの幅より長いワードは、見栄えが悪くなります。


フィールドの概要
protected  Graphics g
           
protected  int height
           
protected static int heightM
           
protected  IntVector lineEnds
           
protected  IntVector lineStarts
           
protected  java.lang.String text
           
protected  int width
           
protected static int widthM
           
protected  int xPos
           
protected  int yPos
           
 
コンストラクタの概要
TextBox()
          新しい TextBox オブジェクトを作成します。
TextBox(java.lang.String t, int x, int y, int w, int h)
          新しい TextBox オブジェクトを作成します。
 
メソッドの概要
 int getNumLines()
          TextBox が現在保持しているテキストの行数を返します。
 void paint()
          TextBox を画面上にペイントします。
 void setBounds(int x, int y, int w, int h)
          TextBox の表示領域をリセットします。
 void setText(java.lang.String t)
          テキストを設定します。
 
クラス java.lang.Object から継承したメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

text

protected java.lang.String text

lineStarts

protected IntVector lineStarts

lineEnds

protected IntVector lineEnds

xPos

protected int xPos

yPos

protected int yPos

width

protected int width

height

protected int height

g

protected Graphics g

widthM

protected static int widthM

heightM

protected static int heightM
コンストラクタの詳細

TextBox

public TextBox()
新しい TextBox オブジェクトを作成します。

TextBox

public TextBox(java.lang.String t,
               int x,
               int y,
               int w,
               int h)
新しい TextBox オブジェクトを作成します。
パラメータ:
t - 初期テキスト
x - ScrollTextBox の位置の X 座標
y - ScrollTextBox の位置の Y 座標
w - 幅
h - 高さ
メソッドの詳細

getNumLines

public int getNumLines()
TextBox が現在保持しているテキストの行数を返します。
戻り値:
保持されているテキストの行数

setText

public void setText(java.lang.String t)
テキストを設定します。TextBox に paint() を呼び出して、新しいテキストを表示します。
パラメータ:
t - 新しいテキストを表す文字列

setBounds

public void setBounds(int x,
                      int y,
                      int w,
                      int h)
TextBox の表示領域をリセットします。
パラメータ:
x - 新しい ScrollTextBox の位置の X 座標
y - 新しい ScrollTextBox の位置の Y 座標
w - 新しい幅
h - 新しい高さ

paint

public void paint()
TextBox を画面上にペイントします。