mine.whitespacefield.main
クラス DrawLargeSpace
java.lang.Object
mine.whitespacefield.main.DrawLargeSpace
- すべての実装されたインタフェース:
- DrawCharSPInterface
class DrawLargeSpace
- extends Object
- implements DrawCharSPInterface
Wordの全角スペースのように、□を代わりに表示します。
- 作成者:
- Mine
| クラス java.lang.Object から継承されたメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pc
private static final Color pc
DrawLargeSpace
DrawLargeSpace()
drawCharSP
public void drawCharSP(Graphics g,
int x,
int y,
int w,
int h)
- インタフェース
DrawCharSPInterface の記述:
- 特定の文字の代わりに画像や図形を表示します。
Graphics内の(x, y)が特定文字を描画する位置となり、置き換える特定の文字の大きさは(w, h)です。
ある文字(たとえば半角スペース)の代わりに、下線を表示したい場合は以下のようにします。
((Graphics2D)g).drawLine(x, y+h, x+w, y+h);
設定方法はWhiteSpaceVisibleTextField.putDrawCharSP(String, DrawCharSPInterface)を参照してください。
- 定義:
- インタフェース
DrawCharSPInterface 内の drawCharSP
- パラメータ:
g - グラフィックスコンテキストx - 特定文字の代わりに描画する画像や図形のX座標y - 特定文字の代わりに描画する画像や図形のY座標w - 特定文字の幅h - 特定文字の高さ