クラスSynthStyleFactory
java.lang.Object
javax.swing.plaf.synth.SynthStyleFactory
public abstract class SynthStyleFactory extends Object
SynthStyleを取得するために使用するファクトリです。 Synthの各ComponentUIは、現在のSynthStyleFactoryを呼び出して、それらが持っている個別の領域ごとにSynthStyleを取得します。
次の例では、Regionに基づいて異なるスタイルを返すカスタムのSynthStyleFactoryを作成します。
class MyStyleFactory extends SynthStyleFactory {
public SynthStyle getStyle(JComponent c, Region id) {
if (id == Region.BUTTON) {
return buttonStyle;
}
else if (id == Region.TREE) {
return treeStyle;
}
return defaultStyle;
}
}
SynthLookAndFeel laf = new SynthLookAndFeel();
UIManager.setLookAndFeel(laf);
SynthLookAndFeel.setStyleFactory(new MyStyleFactory());
- 導入されたバージョン:
- 1.5
- 関連項目:
-
コンストラクタのサマリー
コンストラクタ -
メソッドのサマリー
クラスオブジェクトで宣言されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait修飾子と型メソッド説明protected Objectclone()このオブジェクトのコピーを作成して、返します。booleanこのオブジェクトと他のオブジェクトが等しいかどうかを示します。protected voidfinalize()削除予定のため非推奨: このAPI要素は、将来のバージョンで削除される可能性があります。最終決定は非推奨であり、将来のリリースで削除される可能性があります。final Class<?> getClass()このObjectの実行時クラスを返します。inthashCode()このオブジェクトに対するハッシュ・コード値を返します。final voidnotify()このオブジェクトのモニターで待機中のスレッドを1つ再開します。final voidこのオブジェクトのモニターで待機中のすべてのスレッドを再開します。toString()オブジェクトの文字列表現を返します。final voidwait()現在のスレッドが目覚めるまで待機します。通常、notifiedまたはinterruptedです。final voidwait(long timeoutMillis) 現在のスレッドは、通常、notifiedまたはinterruptedであるか、一定のリアルタイムが経過するまで、目覚めるまで待機します。final voidwait(long timeoutMillis, int nanos) 現在のスレッドは、通常、notifiedまたはinterruptedであるか、一定のリアルタイムが経過するまで、目覚めるまで待機します。
-
コンストラクタの詳細
-
SynthStyleFactory
public SynthStyleFactory()SynthStyleFactoryを作成します。
-
-
メソッドの詳細
-
getStyle
public abstract SynthStyle getStyle(JComponent c, Region id) 指定されたComponentのスタイルを返します。- パラメータ:
c- 要求されるコンポーネントid- Region識別子- 戻り値:
- 領域のSynthStyle。
-