to.tetramorph.starbase.chartparts
クラス GLabel

java.lang.Object
  上位を拡張 to.tetramorph.starbase.chartparts.GComponent
      上位を拡張 to.tetramorph.starbase.chartparts.GLabel
直系の既知のサブクラス:
GSymbolLabel

public class GLabel
extends GComponent

ZodiacPanelに文字を描画するための部品。GLayout(GBoxLayout)にaddして 使用する。文字列中に改行をいれて複数行にすることはできない。


フィールドの概要
 
クラス to.tetramorph.starbase.chartparts.GComponent から継承されたフィールド
baseWidth, bgColor, BOTTOM, CENTER, g, gcl, insets, LEFT, RIGHT, TOP
 
コンストラクタの概要
GLabel()
          空のオブジェクトを作成する。
GLabel(int align)
          水平alignと文字列""を指定してオブジェクトを作成する。
GLabel(int align, double fontScale)
          水平alignとフォントスケールを指定して文字列は""のオブジェクトを作成する。
GLabel(String text)
          文字列を指定してオブジェクトを指定する。
GLabel(String text, int align)
          文字列と水平alignを指定してオブジェクトを作成する。
GLabel(String text, int align, double fontScale)
          文字列と水平alignとフォントスケールを指定してオブジェクトを作成する。
 
メソッドの概要
 GComponent contains(int x, int y)
          指定座標がこのGLableの枠内に含まれる場合はこのオブジェクト自身を返す。
protected  void draw(double x, double y)
          描画する。
 Color getColor()
          文字色を返す。
 Rectangle2D.Float getFullSize()
          部品サイズにインセットを加算したサイズを返す。
 Rectangle2D.Float getSize()
          部品のサイズを返す。
 void setColor(Color color)
          文字色をセットする。
 void setFontScale(double fontScalePer)
          フォントサイズをbaseWidthを1000として千分率で指定する。
 void setText(String text)
          文字列をセットする。
 void setup()
          描画の準備をする。
 
クラス to.tetramorph.starbase.chartparts.GComponent から継承されたメソッド
getActionCommand, getAlign, getBGColor, getGComponentListener, getInset, getVAlign, setActionCommand, setAlign, setAligns, setBaseWidth, setBGColor, setGComponentListener, setGraphics, setInset, setInsets, setVAlign
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

GLabel

public GLabel()
空のオブジェクトを作成する。 valign=TOP,align=LEFT,フォント名="Dialog"。


GLabel

public GLabel(String text)
文字列を指定してオブジェクトを指定する。


GLabel

public GLabel(String text,
              int align)
文字列と水平alignを指定してオブジェクトを作成する。


GLabel

public GLabel(int align)
水平alignと文字列""を指定してオブジェクトを作成する。


GLabel

public GLabel(String text,
              int align,
              double fontScale)
文字列と水平alignとフォントスケールを指定してオブジェクトを作成する。


GLabel

public GLabel(int align,
              double fontScale)
水平alignとフォントスケールを指定して文字列は""のオブジェクトを作成する。

メソッドの詳細

setText

public final void setText(String text)
文字列をセットする。


setColor

public void setColor(Color color)
文字色をセットする。


getColor

public Color getColor()
文字色を返す。


setFontScale

public final void setFontScale(double fontScalePer)
フォントサイズをbaseWidthを1000として千分率で指定する。baseWidthは画面全体の 幅なので、文字は通常1/50〜1/80のサイズとなる。1/50なら20を指定すればよい。


draw

protected void draw(double x,
                    double y)
クラス GComponent の記述:
描画する。x,yはピクセル値

定義:
クラス GComponent 内の draw

getSize

public Rectangle2D.Float getSize()
クラス GComponent の記述:
部品のサイズを返す。

定義:
クラス GComponent 内の getSize

getFullSize

public Rectangle2D.Float getFullSize()
クラス GComponent の記述:
部品サイズにインセットを加算したサイズを返す。

定義:
クラス GComponent 内の getFullSize

setup

public void setup()
クラス GComponent の記述:
描画の準備をする。draw(x,y)を呼び出す前にこのメソッドを呼び出されるので、 前準備を行うコードを実装する。

定義:
クラス GComponent 内の setup

contains

public GComponent contains(int x,
                           int y)
指定座標がこのGLableの枠内に含まれる場合はこのオブジェクト自身を返す。 含まれない場合はnullを返す。 ただしGComponentListenerが登録されていない場合はつねにnullを返す。

定義:
クラス GComponent 内の contains