Java プラットフォーム 1.2

javax.swing.border
クラス TitledBorder

java.lang.Object
  |
  +--javax.swing.border.AbstractBorder
        |
        +--javax.swing.border.TitledBorder
直接の既知のサブクラス:
BorderUIResource.TitledBorderUIResource

public class TitledBorder
extends AbstractBorder

String によるタイトルを位置および位置揃えを指定して追加し、任意のボーダを実装するクラスです。

警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。

関連項目:
直列化された形式

フィールドの概要
static int ABOVE_BOTTOM
          タイトルをボーダのボトムラインより上に配置します。
static int ABOVE_TOP
          タイトルをボーダのトップラインより上に配置します。
static int BELOW_BOTTOM
          タイトルをボーダのボトムラインより下に配置します。
static int BELOW_TOP
          タイトルをボーダのトップラインより下に配置します。
protected  Border border
           
static int BOTTOM
          タイトルをボーダのボトムラインの中央に配置します。
static int CENTER
          タイトルテキストをボーダラインの中央に配置します。
static int DEFAULT_JUSTIFICATION
          タイトルテキスト用としてデフォルトの位置揃えを使います。
static int DEFAULT_POSITION
          タイトルテキストに対してデフォルトの垂直方向配置を使います。
protected static int EDGE_SPACING
           
static int LEFT
          タイトルテキストをボーダラインの左側に配置します。
static int RIGHT
          タイトルテキストをボーダラインの右側に配置します。
protected static int TEXT_INSET_H
           
protected static int TEXT_SPACING
           
protected  String title
           
protected  Color titleColor
           
protected  Font titleFont
           
protected  int titleJustification
           
protected  int titlePosition
           
static int TOP
          タイトルをボーダのトップラインの中央に配置します。
 
コンストラクタの概要
TitledBorder(Border border)
          指定されたボーダと空のタイトルで、TitledBorder のインスタンスを生成します。
TitledBorder(Border border, String title)
          指定されたボーダで TitledBorder のインスタンスを生成します。
TitledBorder(Border border, String title, int titleJustification, int titlePosition)
          指定されたボーダ、タイトル、タイトルの位置揃え、およびタイトルの配置で、TitledBorder のインスタンスを生成します。
TitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont)
          指定されたボーダ、タイトル、タイトルの位置揃え、タイトルの配置、およびタイトルのフォントで、TitledBorder のインスタンスを生成します。
TitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)
          指定されたボーダ、タイトル、タイトルの位置揃え、タイトルの配置、タイトルのフォント、およびタイトルのカラーで、TitledBorder のインスタンスを生成します。
TitledBorder(String title)
          エッチングボーダを使う TitledBorder のインスタンスを生成します。
 
メソッドの概要
 Border getBorder()
          タイトル付きボーダのボーダを返します。
 Insets getBorderInsets(Component c)
          ボーダのインセットの値を返します。
 Insets getBorderInsets(Component c, Insets insets)
          insets パラメータを、この Border の現在の Insets で初期化し直します。
protected  Font getFont(Component c)
           
 Dimension getMinimumSize(Component c)
          ボーダとタイトルの全体を表示する場合にボーダが必要とする、スペースの最小値を返します。
 String getTitle()
          タイトル付きボーダのタイトルを返します。
 Color getTitleColor()
          タイトル付きボーダのタイトルカラーを返します。
 Font getTitleFont()
          タイトル付きボーダのタイトルフォントを返します。
 int getTitleJustification()
          タイトル付きボーダのタイトル位置揃えを返します。
 int getTitlePosition()
          タイトル付きボーダのタイトル位置を返します。
 boolean isBorderOpaque()
          ボーダが不透明かどうかを返します。
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          指定されたコンポーネントのボーダを、指定された位置およびサイズでペイントします。
 void setBorder(Border border)
          タイトル付きボーダのボーダを設定します。
 void setTitle(String title)
          タイトル付きボーダのタイトルを設定します。
 void setTitleColor(Color titleColor)
          タイトル付きボーダのタイトルカラーを設定します。
 void setTitleFont(Font titleFont)
          タイトル付きボーダのタイトルフォントを設定します。
 void setTitleJustification(int titleJustification)
          タイトル付きボーダのタイトル位置揃えを設定します。
 void setTitlePosition(int titlePosition)
          タイトル付きボーダのタイトル位置を設定します。
 
クラス javax.swing.border.AbstractBorder から継承したメソッド
getInteriorRectangle, getInteriorRectangle
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

title

protected String title

border

protected Border border

titlePosition

protected int titlePosition

titleJustification

protected int titleJustification

titleFont

protected Font titleFont

titleColor

protected Color titleColor

DEFAULT_POSITION

public static final int DEFAULT_POSITION
タイトルテキストに対してデフォルトの垂直方向配置を使います。既定値は Look & Feel によって異なります。

ABOVE_TOP

public static final int ABOVE_TOP
タイトルをボーダのトップラインより上に配置します。

TOP

public static final int TOP
タイトルをボーダのトップラインの中央に配置します。

BELOW_TOP

public static final int BELOW_TOP
タイトルをボーダのトップラインより下に配置します。

ABOVE_BOTTOM

public static final int ABOVE_BOTTOM
タイトルをボーダのボトムラインより上に配置します。

BOTTOM

public static final int BOTTOM
タイトルをボーダのボトムラインの中央に配置します。

BELOW_BOTTOM

public static final int BELOW_BOTTOM
タイトルをボーダのボトムラインより下に配置します。

DEFAULT_JUSTIFICATION

public static final int DEFAULT_JUSTIFICATION
タイトルテキスト用としてデフォルトの位置揃えを使います。既定値は Look & Feel によって異なります。

LEFT

public static final int LEFT
タイトルテキストをボーダラインの左側に配置します。

CENTER

public static final int CENTER
タイトルテキストをボーダラインの中央に配置します。

RIGHT

public static final int RIGHT
タイトルテキストをボーダラインの右側に配置します。

EDGE_SPACING

protected static final int EDGE_SPACING

TEXT_SPACING

protected static final int TEXT_SPACING

TEXT_INSET_H

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

TitledBorder

public TitledBorder(String title)
エッチングボーダを使う TitledBorder のインスタンスを生成します。
パラメータ:
title - ボーダに表示するタイトル

TitledBorder

public TitledBorder(Border border)
指定されたボーダと空のタイトルで、TitledBorder のインスタンスを生成します。
パラメータ:
border - ボーダ

TitledBorder

public TitledBorder(Border border,
                    String title)
指定されたボーダで TitledBorder のインスタンスを生成します。
パラメータ:
border - ボーダ
title - ボーダに表示するタイトル

TitledBorder

public TitledBorder(Border border,
                    String title,
                    int titleJustification,
                    int titlePosition)
指定されたボーダ、タイトル、タイトルの位置揃え、およびタイトルの配置で、TitledBorder のインスタンスを生成します。
パラメータ:
border - ボーダ
title - ボーダに表示するタイトル
titleJustification - タイトルの位置揃え
titlePosition - タイトルの位置

TitledBorder

public TitledBorder(Border border,
                    String title,
                    int titleJustification,
                    int titlePosition,
                    Font titleFont)
指定されたボーダ、タイトル、タイトルの位置揃え、タイトルの配置、およびタイトルのフォントで、TitledBorder のインスタンスを生成します。
パラメータ:
border - ボーダ
title - ボーダに表示するタイトル
titleJustification - タイトルの位置揃え
titlePosition - タイトルの位置
titleFont - タイトルを描画するフォント

TitledBorder

public TitledBorder(Border border,
                    String title,
                    int titleJustification,
                    int titlePosition,
                    Font titleFont,
                    Color titleColor)
指定されたボーダ、タイトル、タイトルの位置揃え、タイトルの配置、タイトルのフォント、およびタイトルのカラーで、TitledBorder のインスタンスを生成します。
パラメータ:
border - ボーダ
title - ボーダに表示するタイトル
titleJustification - タイトルの位置揃え
titlePosition - タイトルの位置
titleFont - タイトルを描画するフォント
titleColor - タイトルのカラー
メソッドの詳細

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
指定されたコンポーネントのボーダを、指定された位置およびサイズでペイントします。
パラメータ:
c - ボーダがペイントされるコンポーネント
g - ペイントのグラフィックス
x - ペイントされるボーダの x 座標
y - ペイントされるボーダの y 座標
width - ペイントされるボーダの幅
height - ペイントされるボーダの高さ
オーバーライド:
クラス AbstractBorder 内の paintBorder

getBorderInsets

public Insets getBorderInsets(Component c)
ボーダのインセットの値を返します。
パラメータ:
c - このボーダのインセットの値を適用するコンポーネント
オーバーライド:
クラス AbstractBorder 内の getBorderInsets

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets insets)
insets パラメータを、この Border の現在の Insets で初期化し直します。
パラメータ:
c - このボーダの insets の値を適用するコンポーネント
insets - 初期化し直されるオブジェクト
オーバーライド:
クラス AbstractBorder 内の getBorderInsets

isBorderOpaque

public boolean isBorderOpaque()
ボーダが不透明かどうかを返します。
オーバーライド:
クラス AbstractBorder 内の isBorderOpaque

getTitle

public String getTitle()
タイトル付きボーダのタイトルを返します。

getBorder

public Border getBorder()
タイトル付きボーダのボーダを返します。

getTitlePosition

public int getTitlePosition()
タイトル付きボーダのタイトル位置を返します。

getTitleJustification

public int getTitleJustification()
タイトル付きボーダのタイトル位置揃えを返します。

getTitleFont

public Font getTitleFont()
タイトル付きボーダのタイトルフォントを返します。

getTitleColor

public Color getTitleColor()
タイトル付きボーダのタイトルカラーを返します。

setTitle

public void setTitle(String title)
タイトル付きボーダのタイトルを設定します。
パラメータ:
title - ボーダのタイトル

setBorder

public void setBorder(Border border)
タイトル付きボーダのボーダを設定します。
パラメータ:
border - ボーダ

setTitlePosition

public void setTitlePosition(int titlePosition)
タイトル付きボーダのタイトル位置を設定します。
パラメータ:
titlePosition - ボーダのタイトルの位置

setTitleJustification

public void setTitleJustification(int titleJustification)
タイトル付きボーダのタイトル位置揃えを設定します。
パラメータ:
titleJustification - ボーダのタイトルの位置揃え

setTitleFont

public void setTitleFont(Font titleFont)
タイトル付きボーダのタイトルフォントを設定します。
パラメータ:
titleFont - ボーダのタイトルのフォント

setTitleColor

public void setTitleColor(Color titleColor)
タイトル付きボーダのタイトルカラーを設定します。
パラメータ:
titleColor - ボーダのタイトルのカラー

getMinimumSize

public Dimension getMinimumSize(Component c)
ボーダとタイトルの全体を表示する場合にボーダが必要とする、スペースの最小値を返します。
パラメータ:
c - このボーダを描画されるコンポーネント

getFont

protected Font getFont(Component c)

Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.