public class SynthComboBoxUI extends BasicComboBoxUI implements PropertyChangeListener, SynthUI
JComboBox
のSynth L&F UI委譲を提供します。BasicComboBoxUI.ComboBoxLayoutManager, BasicComboBoxUI.FocusHandler, BasicComboBoxUI.ItemHandler, BasicComboBoxUI.KeyHandler, BasicComboBoxUI.ListDataHandler, BasicComboBoxUI.PropertyChangeHandler
arrowButton, cachedMinimumSize, comboBox, currentValuePane, editor, focusListener, hasFocus, isMinimumSizeDirty, itemListener, keyListener, listBox, listDataListener, padding, popup, popupKeyListener, popupMouseListener, popupMouseMotionListener, propertyChangeListener, squareButton
DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED
コンストラクタ | 説明 |
---|---|
SynthComboBoxUI() |
修飾子と型 | メソッド | 説明 |
---|---|---|
protected JButton |
createArrowButton() |
コンボボックスのポップアップ部分の表示または非表示の制御に使用されるボタンを作成します。
|
protected ComboBoxEditor |
createEditor() |
編集可能なコンボボックスで使用されるデフォルト・エディタを作成します。
|
protected ComboPopup |
createPopup() |
コンボボックスのポップアップ部分を作成します。
|
protected ListCellRenderer |
createRenderer() |
編集不可能なコンボボックスで使用されるデフォルト・レンダラを作成します。
|
static ComponentUI |
createUI(JComponent c) |
指定されたコンポーネントの新しいUIオブジェクトを作成します。
|
SynthContext |
getContext(JComponent c) |
指定されたコンポーネントのコンテキストを返します。
|
protected Dimension |
getDefaultSize() |
現在のレンダラとフォントを使用するコンボボックスの、空の表示領域のデフォルト・サイズを返します。
|
protected void |
installDefaults() |
JComboBoxに、デフォルトのカラー、フォント、レンダラ、およびエディタをインストールします。
|
protected void |
installListeners() |
コンボボックスとそのモデルのためのリスナーを作成し、インストールします。
|
void |
installUI(JComponent c) |
指定されたコンポーネントをLook & Feelに応じて適切に構成します。
|
void |
paint(Graphics g, JComponent c) |
Look & Feelに従って、指定されたコンポーネントをペイントします。
|
protected void |
paint(SynthContext context, Graphics g) |
指定されたコンポーネントをペイントします。
|
void |
paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) |
ボーダーをペイントします。
|
void |
paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) |
現在選択されている項目をペイントします。
|
void |
propertyChange(PropertyChangeEvent e) |
バウンド・プロパティの変更時に呼び出されます。
|
protected void |
uninstallDefaults() |
コンボボックスからデフォルトのカラー、フォント、レンダラ、およびエディタをアンインストールします。
|
protected void |
uninstallListeners() |
インストールされたリスナーを、コンボボックスとそのモデルから削除します。
|
void |
uninstallUI(JComponent c) |
installUI 時に、指定されたコンポーネントに対して行われた構成を取り消します。 |
void |
update(Graphics g, JComponent c) |
このUI委譲に、指定されたコンポーネントを再ペイントするよう通知します。
|
addEditor, configureArrowButton, configureEditor, createFocusListener, createItemListener, createKeyListener, createLayoutManager, createListDataListener, createPropertyChangeListener, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getDisplaySize, getInsets, getMaximumSize, getMinimumSize, getPreferredSize, getSizeForComponent, installComponents, installKeyboardActions, isFocusTraversable, isNavigationKey, isPopupVisible, paintCurrentValueBackground, rectangleForCurrentValue, removeEditor, selectNextPossibleValue, selectPreviousPossibleValue, setPopupVisible, toggleOpenClose, unconfigureArrowButton, unconfigureEditor, uninstallComponents, uninstallKeyboardActions
contains
public static ComponentUI createUI(JComponent c)
c
- UIオブジェクトを作成するコンポーネントpublic void installUI(JComponent c)
ComponentUI
インスタンスが、指定されたコンポーネントのUI委譲としてインストールされているときに呼び出されます。 このメソッドは、次を含むLook & Feel用のコンポーネントを完全に構成するべきです。
LayoutManager
をインストールする。
PropertyChangeListener
を作成してコンポーネントにインストールする。
installUI
、クラスBasicComboBoxUI
c
- UI委譲がインストールされるコンポーネントComponentUI.uninstallUI(javax.swing.JComponent)
, JComponent.setUI(javax.swing.plaf.ComponentUI)
, JComponent.updateUI()
protected void installDefaults()
BasicComboBoxUI
installDefaults
、クラスBasicComboBoxUI
protected void installListeners()
installListeners
、クラスBasicComboBoxUI
public void uninstallUI(JComponent c)
installUI
時に、指定されたコンポーネントに対して行われた構成を取り消します。 このメソッドは、このUIComponent
インスタンスが、指定されたコンポーネントのUI委譲として削除されているときに呼び出されます。 このメソッドは、installUI
によって実行された構成を元に戻すべきです。この場合、JComponent
インスタンスをクリーンな状態(余分なリスナーや、Look & Feel固有のプロパティ・オブジェクトが残らないように)にするよう十分注意してください。 手順には次のものが含まれるべきです。
uninstallUI
、クラスBasicComboBoxUI
c
- このUI委譲が削除されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがあるComponentUI.installUI(javax.swing.JComponent)
, JComponent.updateUI()
protected void uninstallDefaults()
uninstallDefaults
、クラスBasicComboBoxUI
protected void uninstallListeners()
installListeners
で追加されたものと同じであるべきです。 uninstallListeners
、クラスBasicComboBoxUI
public SynthContext getContext(JComponent c)
getContext
、インタフェースSynthUI
c
- SynthContextを要求するコンポーネント。protected ComboPopup createPopup()
createPopup
、クラスBasicComboBoxUI
ComboPopup
のインスタンスComboPopup
protected ListCellRenderer createRenderer()
setRenderer
で明示的に設定されていない場合だけ、デフォルト・レンダラが使用されます。 createRenderer
、クラスBasicComboBoxUI
ListCellRender
JComboBox.setRenderer(javax.swing.ListCellRenderer<? super E>)
protected ComboBoxEditor createEditor()
setEditor
で明示的に設定されていない場合だけ、デフォルト・エディタが使用されます。 createEditor
、クラスBasicComboBoxUI
ComboBoxEditor
JComboBox.setEditor(javax.swing.ComboBoxEditor)
public void propertyChange(PropertyChangeEvent e)
propertyChange
、インタフェースPropertyChangeListener
e
- イベント・ソースと変更されたプロパティを記述したPropertyChangeEventオブジェクト。protected JButton createArrowButton()
createArrowButton
、クラスBasicComboBoxUI
public void update(Graphics g, JComponent c)
paint(SynthContext,Graphics)
メソッドを呼び出します。
一般に、このメソッドはサブクラスによってオーバーライドする必要はありません。 すべてのLook & Feelの描画コードをpaint
メソッドに入れるようにしてください。
update
、クラスComponentUI
g
- ペイントに使用されるGraphics
オブジェクトc
- ペイントされるコンポーネントpaint(SynthContext,Graphics)
public void paint(Graphics g, JComponent c)
このメソッドは、Synth Look & Feelで使用されません。 ペイントはpaint(SynthContext,Graphics)
メソッドによって処理されます。
paint
、クラスBasicComboBoxUI
g
- ペイントに使用されるGraphics
オブジェクトc
- ペイントされるコンポーネントpaint(SynthContext,Graphics)
protected void paint(SynthContext context, Graphics g)
context
- ペイントされるコンポーネントのコンテキストg
- ペイントに使用されるGraphics
オブジェクトupdate(Graphics,JComponent)
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
paintBorder
、インタフェースSynthUI
context
- コンポーネント・コンテキストg
- ペイントされるGraphics
x
- X座標y
- Y座標w
- ボーダーの幅h
- ボーダーの高さpublic void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus)
paintCurrentValue
、クラスBasicComboBoxUI
protected Dimension getDefaultSize()
getDefaultSize
、クラスBasicComboBoxUI
BasicComboBoxUI.getDisplaySize()
バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。