iappli.lib.ui
クラス CLabel

Object
  上位を拡張 iappli.lib.ui.CComponent
      上位を拡張 iappli.lib.ui.CLabel

public final class CLabel
extends CComponent

Canvas上に描画するラベルです。
本部品についてイベントの発生はありません。

 【例】
 class Test extends CostumePanel {
   public void paint(Graphics g) {
     CLabel lb = new CLabel("我輩は猫である。",
                            Graphics.getColorOfName(Graphics.BLACK),
                            Graphics.getColorOfRGB(100, 100, 100, 200),
                            Graphics.getColorOfName(Graphics.WHITE));

     lb.show(g, 12, 8, false);
         :
   }
 }
 


コンストラクタの概要
CLabel()
          ラベルを生成します。
CLabel(String text)
          ラベル文字列を指定してラベルを生成します。
CLabel(String text, int c1, int c2, int s)
          ラベル文字列、前景色、背景色、影付き色を指定してラベルを生成します。
 
メソッドの概要
 void setText(String text)
          ラベル文字列を設定します。
 void show(Graphics g, int x, int y, boolean b)
          ラベルを描画します。
 
クラス iappli.lib.ui.CComponent から継承されたメソッド
clear, setBackground, setBackup, setFont, setForeground, setGraphics, setLocation, setShadow, setSize
 
クラス Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

CLabel

public CLabel()
ラベルを生成します。


CLabel

public CLabel(String text)
ラベル文字列を指定してラベルを生成します。

パラメータ:
text - ラベル文字列を指定します。

CLabel

public CLabel(String text,
              int c1,
              int c2,
              int s)
ラベル文字列、前景色、背景色、影付き色を指定してラベルを生成します。

パラメータ:
text - ラベル文字列を指定します。
c1 - 前景色を指定します。
c2 - 背景色を指定します。
s - 影付き色を指定します。
メソッドの詳細

setText

public void setText(String text)
ラベル文字列を設定します。

パラメータ:
text - ラベル文字列を指定します。 null が指定された場合は空文字列("")が設定されます。

show

public void show(Graphics g,
                 int x,
                 int y,
                 boolean b)
ラベルを描画します。
描画中のグラフィックスオブジェクトは、lock、unlock を実行しません。 呼び出し側にて実行してください。 ラベルはフォーカスを持ちません。

パラメータ:
g - キャンパスのグラフィックスオブジェクト(getGraphics())を指定します。
x - 横座標(文字数)を指定します。
y - 縦座標(文字数)を指定します。
b - trueを指定すると描画前をバックアップします。 (ヒープメモリが取られるため使わない場合は false を指定してください。)

Copyright ITmarks Inc. All rights reserved.