JavaTM Platform
Standard Ed. 6

javax.swing.border
クラス AbstractBorder

java.lang.Object
  上位を拡張 javax.swing.border.AbstractBorder
すべての実装されたインタフェース:
Serializable, Border
直系の既知のサブクラス:
BasicBorders.ButtonBorder, BasicBorders.FieldBorder, BasicBorders.MarginBorder, BasicBorders.MenuBarBorder, BevelBorder, CompoundBorder, EmptyBorder, EtchedBorder, LineBorder, MetalBorders.ButtonBorder, MetalBorders.Flush3DBorder, MetalBorders.InternalFrameBorder, MetalBorders.MenuBarBorder, MetalBorders.MenuItemBorder, MetalBorders.OptionDialogBorder, MetalBorders.PaletteBorder, MetalBorders.PopupMenuBorder, MetalBorders.ScrollPaneBorder, MetalBorders.TableHeaderBorder, MetalBorders.ToolBarBorder, TitledBorder

public abstract class AbstractBorder
extends Object
implements Border, Serializable

サイズ指定のない空のボーダーを実装するクラスです。ほかのボーダーのクラスを簡単に派生できる、便利な基底クラスを提供します。

警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。JDK Version 1.4 以降、すべての JavaBeans の長期間の運用サポートは、java.beans パッケージに追加されています。詳細は、XMLEncoder を参照してください。


コンストラクタの概要
AbstractBorder()
           
 
メソッドの概要
 int getBaseline(Component c, int width, int height)
          ベースラインを返します。
 Component.BaselineResizeBehavior getBaselineResizeBehavior(Component c)
          サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。
 Insets getBorderInsets(Component c)
          このデフォルト実装は、topleftbottom、および right の各フィールドが 0 に設定されているとき、新しい Insets インスタンスを返します。
 Insets getBorderInsets(Component c, Insets insets)
          インセットパラメータを、この Border の現在のインセットで初期化し直します。
static Rectangle getInteriorRectangle(Component c, Border b, int x, int y, int width, int height)
          ボーダーのインセットから引数の値を減算して矩形を返します。
 Rectangle getInteriorRectangle(Component c, int x, int y, int width, int height)
          静的メソッドを呼び出す簡易メソッドです。
 boolean isBorderOpaque()
          このデフォルト実装は false を返します。
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          このデフォルト実装では、ペイントを行いません。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

AbstractBorder

public AbstractBorder()
メソッドの詳細

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
このデフォルト実装では、ペイントを行いません。

定義:
インタフェース Border 内の paintBorder
パラメータ:
c - このボーダーがペイントされるコンポーネント
g - ペイントのグラフィックス
x - ペイントされたボーダーの x 座標
y - ペイントされたボーダーの y 座標
width - ペイントされたボーダーの幅
height - ペイントされたボーダーの高さ

getBorderInsets

public Insets getBorderInsets(Component c)
このデフォルト実装は、topleftbottom、および right の各フィールドが 0 に設定されているとき、新しい Insets インスタンスを返します。

定義:
インタフェース Border 内の getBorderInsets
パラメータ:
c - このボーダーのインセットの値を適用するコンポーネント
戻り値:
0 に初期化される新しい Insets オブジェクト

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets insets)
インセットパラメータを、この Border の現在のインセットで初期化し直します。

パラメータ:
c - このボーダーのインセットの値を適用するコンポーネント
insets - 初期化し直されるオブジェクト
戻り値:
insets オブジェクト

isBorderOpaque

public boolean isBorderOpaque()
このデフォルト実装は false を返します。

定義:
インタフェース Border 内の isBorderOpaque
戻り値:
false

getInteriorRectangle

public Rectangle getInteriorRectangle(Component c,
                                      int x,
                                      int y,
                                      int width,
                                      int height)
静的メソッドを呼び出す簡易メソッドです。

パラメータ:
c - このボーダーが計算されるコンポーネント
x - ボーダーの x 座標
y - ボーダーの y 座標
width - ボーダーの幅
height - ボーダーの高さ
戻り値:
内部座標を持つ Rectangle

getInteriorRectangle

public static Rectangle getInteriorRectangle(Component c,
                                             Border b,
                                             int x,
                                             int y,
                                             int width,
                                             int height)
ボーダーのインセットから引数の値を減算して矩形を返します。コンポーネントが描画して埋める領域を、ボーダーと交差しないように決めるのに便利です。

パラメータ:
c - このボーダーが計算されるコンポーネント
b - Border オブジェクト
x - ボーダーの x 座標
y - ボーダーの y 座標
width - ボーダーの幅
height - ボーダーの高さ
戻り値:
内部座標を持つ Rectangle

getBaseline

public int getBaseline(Component c,
                       int width,
                       int height)
ベースラインを返します。戻り値が 0 より小さい場合は、ボーダーのベースラインが適切ではありません。

デフォルト実装は -1 を返します。ベースラインをサポートするサブクラスで適切にオーバーライドする必要があります。戻り値が 0 以上の場合、コンポーネントのベースラインは最小サイズ以上の任意のサイズに対して有効であり、getBaselineResizeBehavior を使ってサイズによるベースラインの変化を特定することができます。

パラメータ:
c - 要求される Component ベースライン
width - ベースラインを取得する幅
height - ベースラインを取得する高さ
戻り値:
ベースラインまたは 0 より小さい値 (適切なベースラインが 存在しない)
例外:
IllegalArgumentException - 幅または高さが 0 より小さい場合
導入されたバージョン:
1.6
関連項目:
Component.getBaseline(int,int), Component.getBaselineResizeBehavior()

getBaselineResizeBehavior

public Component.BaselineResizeBehavior getBaselineResizeBehavior(Component c)
サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。このメソッドは、主にレイアウトマネージャーと GUI ビルダーで使用されます。

デフォルト実装は BaselineResizeBehavior.OTHER を返します。ベースラインをサポートするサブクラスで適切にオーバーライドする必要があります。サブクラスは null を返しません。ベースラインを計算できない場合は、BaselineResizeBehavior.OTHER を返します。呼び出し側は、まず getBaseline を使ってベースラインを要求します。そして、戻り値が 0 以上の場合はこのメソッドを使用します。getBaseline が 0 より小さい値を返す場合でも、このメソッドが BaselineResizeBehavior.OTHER 以外の値を返すことは許容されます。

パラメータ:
c - ベースラインのサイズ変更の動作を返す Component
戻り値:
ボーダーのサイズ変更に伴うベースラインの変化を示す 列挙
導入されたバージョン:
1.6
関連項目:
Component.getBaseline(int,int), Component.getBaselineResizeBehavior()

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。