JavaTM 2 Platform
Std. Ed. v1.3

javax.swing.border
クラス TitledBorder

java.lang.Object
  |
  +--javax.swing.border.AbstractBorder
        |
        +--javax.swing.border.TitledBorder
すべての実装インタフェース:
Border, Serializable
直系の既知のサブクラス:
BorderUIResource.TitledBorderUIResource

public class TitledBorder
extends AbstractBorder

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

ボーダ、フォント、カラーのプロパティ値が、コンストラクタ内で、または適切なセットメソッドの呼び出しによって指定されていない場合は、Defaults Table にある次のプロパティ名を使用して現在の Look & Feel でプロパティ値を定義します。

警告: このクラスの直列化されたオブジェクトは、今後の 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 LEADING
          左から右方向の場合はタイトルテキストをボーダラインの左側に、右から左方向の場合はボーダラインの右側に配置します。
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
          タイトルをボーダのトップラインの中央に配置します。
static int TRAILING
          左から右方向の場合はタイトルテキストをボーダラインの右側に、右から左方向の場合はボーダラインの左側に配置します。
 
コンストラクタの概要
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
タイトルテキストにデフォルトの垂直方向配置を使用します。

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
タイトルテキストにデフォルトの位置揃えを使用します。

LEFT

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

CENTER

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

RIGHT

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

LEADING

public static final int LEADING
左から右方向の場合はタイトルテキストをボーダラインの左側に、右から左方向の場合はボーダラインの右側に配置します。

TRAILING

public static final int TRAILING
左から右方向の場合はタイトルテキストをボーダラインの右側に、右から左方向の場合はボーダラインの左側に配置します。

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

getBorderInsets

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

getBorderInsets

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

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)

JavaTM 2 Platform
Std. Ed. v1.3

バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。

Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.