- java.lang.Object
- 
- javax.swing.plaf.ComponentUI
- 
- javax.swing.plaf.ButtonUI
- 
- javax.swing.plaf.MenuItemUI
- 
- javax.swing.plaf.basic.BasicMenuItemUI
 
 
 
 
- 
- 直系の既知のサブクラス:
- BasicCheckBoxMenuItemUI,- BasicMenuUI,- BasicRadioButtonMenuItemUI,- SynthMenuItemUI
 
 public class BasicMenuItemUI extends MenuItemUI BasicMenuItem実装です。
- 
- 
ネストされたクラスのサマリーネストされたクラス 修飾子と型 クラス 説明 protected classBasicMenuItemUI.MouseInputHandlerマウス入力ハンドラ
 - 
フィールドのサマリーフィールド 修飾子と型 フィールド 説明 protected StringacceleratorDelimiterアクセラレータ区切り文字列、'Ctrl+C'の'+'など。protected FontacceleratorFontアクセラレータ・フォント。protected ColoracceleratorForegroundアクセラレータの前景色。protected ColoracceleratorSelectionForegroundアクセラレータ選択の色。protected IconarrowIcon矢印アイコン。protected IconcheckIconチェック・アイコン。protected intdefaultTextIconGapテキストとアイコンの間のギャップ。protected ColordisabledForeground無効なフォアグラウンドの色。protected MenuDragMouseListenermenuDragMouseListenerMenuDragMouseListenerのインスタンス。protected JMenuItemmenuItemJMenuItemのインスタンス。protected MenuKeyListenermenuKeyListenerMenuKeyListenerのインスタンス。protected MouseInputListenermouseInputListenerMouseInputListenerのインスタンス。protected booleanoldBorderPaintedこの値は、古いボーダーがペイントされているかどうかを表します。protected PropertyChangeListenerpropertyChangeListenercreatePropertyChangeListenerから返されたPropertyChangeListener。protected ColorselectionBackground選択したバックグラウンドの色です。protected ColorselectionForeground選択前景の色です。
 - 
コンストラクタのサマリーコンストラクタ コンストラクタ 説明 BasicMenuItemUI()
 - 
メソッドのサマリーすべてのメソッド 静的メソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 protected MenuDragMouseListenercreateMenuDragMouseListener(JComponent c)MenuDragMouseListenerのインスタンスを返します。protected MenuKeyListenercreateMenuKeyListener(JComponent c)MenuKeyListenerのインスタンスを返します。protected MouseInputListenercreateMouseInputListener(JComponent c)MouseInputListenerのインスタンスを返します。protected PropertyChangeListenercreatePropertyChangeListener(JComponent c)メニュー項目に追加されるPropertyChangeListenerを作成します。static ComponentUIcreateUI(JComponent c)BasicMenuItemUIの新しいインスタンスを返します。protected voiddoClick(MenuSelectionManager msm)メニュー項目の起動時に、このメソッドを呼び出します。MenuElement[]getPath()メニュー要素のパスを返します。protected DimensiongetPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap)メニュー・アイテムの優先サイズを返します。protected StringgetPropertyPrefix()プロパティのプレフィクスを返します。protected voidinstallComponents(JMenuItem menuItem)protected voidinstallDefaults()デフォルトのプロパティをインストールします。protected voidinstallKeyboardActions()キーボード操作を登録します。protected voidinstallListeners()リスナーを登録します。protected voidpaintBackground(Graphics g, JMenuItem menuItem, Color bgColor)メニュー項目のバックグラウンドを描画します。protected voidpaintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap)メニュー・アイテムをペイントします。protected voidpaintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text)現在のメニュー項目のテキストをレンダリングします。protected voiduninstallComponents(JMenuItem menuItem)コンポーネントの登録を解除します。protected voiduninstallDefaults()既定のプロパティをアンインストールします。protected voiduninstallKeyboardActions()キーボード操作の登録を解除します。protected voiduninstallListeners()リスナーを登録解除します。voidupdate(Graphics g, JComponent c)paintMenuItem()でバックグラウンドを描画するため、update (デフォルトでは不透明なコンポーネントのバックグラウンドを塗りつぶす)をオーバーライドしてpaint()を呼び出してください。- 
クラス javax.swing.plaf.ComponentUIで宣言されたメソッドcontains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI
 
- 
 
- 
- 
- 
フィールドの詳細- 
menuItemprotected JMenuItem menuItem JMenuItemのインスタンス。
 - 
selectionBackgroundprotected Color selectionBackground 選択したバックグラウンドの色です。
 - 
selectionForegroundprotected Color selectionForeground 選択前景の色です。
 - 
disabledForegroundprotected Color disabledForeground 無効なフォアグラウンドの色。
 - 
acceleratorForegroundprotected Color acceleratorForeground アクセラレータの前景色。
 - 
acceleratorSelectionForegroundprotected Color acceleratorSelectionForeground アクセラレータ選択の色。
 - 
acceleratorDelimiterprotected String acceleratorDelimiter アクセラレータ区切り文字列、'Ctrl+C'の'+'など。- 導入されたバージョン:
- 1.7
 
 - 
defaultTextIconGapprotected int defaultTextIconGap テキストとアイコンの間のギャップ。
 - 
acceleratorFontprotected Font acceleratorFont アクセラレータ・フォント。
 - 
mouseInputListenerprotected MouseInputListener mouseInputListener MouseInputListenerのインスタンス。
 - 
menuDragMouseListenerprotected MenuDragMouseListener menuDragMouseListener MenuDragMouseListenerのインスタンス。
 - 
menuKeyListenerprotected MenuKeyListener menuKeyListener MenuKeyListenerのインスタンス。
 - 
propertyChangeListenerprotected PropertyChangeListener propertyChangeListener createPropertyChangeListenerから返されたPropertyChangeListener。 このフィールドにアクセスする必要はないはずです。PropertyChangeListenerをカスタマイズする場合は、createPropertyChangeListenerをオーバーライドしてください。- 導入されたバージョン:
- 1.6
- 関連項目:
- createPropertyChangeListener(javax.swing.JComponent)
 
 - 
arrowIconprotected Icon arrowIcon 矢印アイコン。
 - 
checkIconprotected Icon checkIcon チェック・アイコン。
 - 
oldBorderPaintedprotected boolean oldBorderPainted この値は、古いボーダーがペイントされているかどうかを表します。
 
- 
 - 
メソッドの詳細- 
createUIpublic static ComponentUI createUI(JComponent c) BasicMenuItemUIの新しいインスタンスを返します。- パラメータ:
- c- コンポーネント
- 戻り値:
- BasicMenuItemUIの新しいインスタンス
 
 - 
installDefaultsprotected void installDefaults() デフォルトのプロパティをインストールします。
 - 
installComponentsprotected void installComponents(JMenuItem menuItem) - パラメータ:
- menuItem- メニュー・アイテム
- 導入されたバージョン:
- 1.3
 
 - 
getPropertyPrefixprotected String getPropertyPrefix() プロパティのプレフィクスを返します。- 戻り値:
- プロパティ・プレフィクス
 
 - 
installListenersprotected void installListeners() リスナーを登録します。
 - 
installKeyboardActionsprotected void installKeyboardActions() キーボード操作を登録します。
 - 
uninstallDefaultsprotected void uninstallDefaults() 既定のプロパティをアンインストールします。
 - 
uninstallComponentsprotected void uninstallComponents(JMenuItem menuItem) コンポーネントの登録を解除します。- パラメータ:
- menuItem- メニュー・アイテム
- 導入されたバージョン:
- 1.3
 
 - 
uninstallListenersprotected void uninstallListeners() リスナーを登録解除します。
 - 
uninstallKeyboardActionsprotected void uninstallKeyboardActions() キーボード操作の登録を解除します。
 - 
createMouseInputListenerprotected MouseInputListener createMouseInputListener(JComponent c) MouseInputListenerのインスタンスを返します。- パラメータ:
- c- コンポーネント
- 戻り値:
- MouseInputListenerのインスタンス
 
 - 
createMenuDragMouseListenerprotected MenuDragMouseListener createMenuDragMouseListener(JComponent c) MenuDragMouseListenerのインスタンスを返します。- パラメータ:
- c- コンポーネント
- 戻り値:
- MenuDragMouseListenerのインスタンス
 
 - 
createMenuKeyListenerprotected MenuKeyListener createMenuKeyListener(JComponent c) MenuKeyListenerのインスタンスを返します。- パラメータ:
- c- コンポーネント
- 戻り値:
- MenuKeyListenerのインスタンス
 
 - 
createPropertyChangeListenerprotected PropertyChangeListener createPropertyChangeListener(JComponent c) メニュー項目に追加されるPropertyChangeListenerを作成します。 このメソッドがnullを返す場合、これはメニュー項目に追加されません。- パラメータ:
- c- コンポーネント
- 戻り値:
- PropertyChangeListenerのインスタンス、またはnull
- 導入されたバージョン:
- 1.6
 
 - 
getPreferredMenuItemSizeprotected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap) メニュー・アイテムの優先サイズを返します。- パラメータ:
- c- コンポーネント
- checkIcon- チェック・アイコン
- arrowIcon- 矢印アイコン
- defaultTextIconGap- テキストとアイコンの間の隙間
- 戻り値:
- メニュー・アイテムの優先サイズ
 
 - 
updatepublic void update(Graphics g, JComponent c) paintMenuItem()でバックグラウンドを描画するため、update (デフォルトでは不透明なコンポーネントのバックグラウンドを塗りつぶす)をオーバーライドしてpaint()を呼び出してください。- オーバーライド:
- update、クラス- ComponentUI
- パラメータ:
- g- ペイント対象の- Graphicsコンテキスト
- c- ペイントされるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがある
- 関連項目:
- ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent),- JComponent.paintComponent(java.awt.Graphics)
 
 - 
paintMenuItemprotected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap) メニュー・アイテムをペイントします。- パラメータ:
- g-- Graphicsのインスタンス
- c- コンポーネント
- checkIcon- チェック・アイコン
- arrowIcon- 矢印アイコン
- background- バックグラウンド色
- foreground- 前景色
- defaultTextIconGap- テキストとアイコンの間の隙間
 
 - 
paintBackgroundprotected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) メニュー項目のバックグラウンドを描画します。- パラメータ:
- g- ペイント・グラフィックス
- menuItem- ペイントされるメニュー項目
- bgColor- 選択バックグラウンド・カラー
- 導入されたバージョン:
- 1.4
 
 - 
paintTextprotected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) 現在のメニュー項目のテキストをレンダリングします。- パラメータ:
- g- グラフィックス・コンテキスト
- menuItem- レンダリングするメニュー項目
- textRect- テキストをレンダリングする境界矩形
- text- レンダリングする文字列
- 導入されたバージョン:
- 1.4
 
 - 
getPathpublic MenuElement[] getPath() メニュー要素のパスを返します。- 戻り値:
- メニュー要素のパス
 
 - 
doClickprotected void doClick(MenuSelectionManager msm) メニュー項目の起動時に、このメソッドを呼び出します。 このメソッドは、選択したパスをクリアしたり、JMenuItemのdoClick()メソッドをメッセージとして送るなど、メニュー項目起動の詳細の一部を処理します。- パラメータ:
- msm- MenuSelectionManager。 視覚的フィード・バックとさまざまな内部作業は、このMenuSelectionManagerに委譲される。 この引数として- nullが渡された場合、- MenuSelectionManager.defaultManagerが使用される。
- 導入されたバージョン:
- 1.4
- 関連項目:
- MenuSelectionManager,- AbstractButton.doClick(int)
 
 
- 
 
-