モジュール java.desktop
パッケージ javax.swing.plaf.basic

クラスBasicMenuItemUI

直系の既知のサブクラス:
BasicCheckBoxMenuItemUI, BasicMenuUI, BasicRadioButtonMenuItemUI, SynthMenuItemUI

public class BasicMenuItemUI extends MenuItemUI
BasicMenuItem実装です。
  • フィールド詳細

    • selectionBackground

      protected Color selectionBackground
      選択のバックグラウンドの色。
    • selectionForeground

      protected Color selectionForeground
      選択の前景の色。
    • disabledForeground

      protected Color disabledForeground
      障害のあるフォアグラウンドの色。
    • acceleratorForeground

      protected Color acceleratorForeground
      アクセラレータの前景の色。
    • acceleratorSelectionForeground

      protected Color acceleratorSelectionForeground
      アクセラレータ選択の色。
    • acceleratorDelimiter

      protected String acceleratorDelimiter
      アクセラレータ区切り文字列、'Ctrl+C''+'など。
      導入されたバージョン:
      1.7
    • defaultTextIconGap

      protected int defaultTextIconGap
      テキストとアイコンの間のギャップ。
    • acceleratorFont

      protected Font acceleratorFont
      アクセラレータ・フォント。
    • mouseInputListener

      protected MouseInputListener mouseInputListener
      MouseInputListenerのインスタンス。
    • propertyChangeListener

      protected PropertyChangeListener propertyChangeListener
      createPropertyChangeListenerから返されたPropertyChangeListener このフィールドにアクセスする必要はないはずです。PropertyChangeListenerをカスタマイズする場合は、createPropertyChangeListenerをオーバーライドしてください。
      導入されたバージョン:
      1.6
      関連項目:
    • arrowIcon

      protected Icon arrowIcon
      矢印アイコン。
    • checkIcon

      protected Icon checkIcon
      チェック・アイコン。
    • oldBorderPainted

      protected boolean oldBorderPainted
      値は、古い枠線がペイントされているかどうかを表します。
  • コンストラクタの詳細

    • BasicMenuItemUI

      public BasicMenuItemUI()
      BasicMenuItemUIを構築します。
  • メソッドの詳細

    • createUI

      public static ComponentUI createUI(JComponent c)
      BasicMenuItemUIの新しいインスタンスを返します。
      パラメータ:
      c - コンポーネント
      戻り値:
      BasicMenuItemUIの新しいインスタンス
    • installDefaults

      protected void installDefaults()
      デフォルトのプロパティをインストールします。
    • installComponents

      protected void installComponents(JMenuItem menuItem)
      メニューのサブコンポーネントを登録します。
      パラメータ:
      menuItem - メニュー項目
      導入されたバージョン:
      1.3
    • getPropertyPrefix

      protected String getPropertyPrefix()
      プロパティ・プレフィクスを返します。
      戻り値:
      プロパティ・プレフィクス
    • installListeners

      protected void installListeners()
      リスナーを登録します。
    • installKeyboardActions

      protected void installKeyboardActions()
      キーボード操作を登録します。
    • uninstallDefaults

      protected void uninstallDefaults()
      デフォルト・プロパティをアンインストールします。
    • uninstallComponents

      protected void uninstallComponents(JMenuItem menuItem)
      コンポーネントの登録を解除します。
      パラメータ:
      menuItem - メニュー項目
      導入されたバージョン:
      1.3
    • uninstallListeners

      protected void uninstallListeners()
      リスナーの登録を解除します。
    • uninstallKeyboardActions

      protected void uninstallKeyboardActions()
      キーボード・アクションを登録解除します。
    • createMouseInputListener

      protected MouseInputListener createMouseInputListener(JComponent c)
      MouseInputListenerのインスタンスを返します。
      パラメータ:
      c - コンポーネント
      戻り値:
      MouseInputListenerのインスタンス
    • createMenuDragMouseListener

      protected MenuDragMouseListener createMenuDragMouseListener(JComponent c)
      MenuDragMouseListenerのインスタンスを返します。
      パラメータ:
      c - コンポーネント
      戻り値:
      MenuDragMouseListenerのインスタンス
    • createMenuKeyListener

      protected MenuKeyListener createMenuKeyListener(JComponent c)
      MenuKeyListenerのインスタンスを返します。
      パラメータ:
      c - コンポーネント
      戻り値:
      MenuKeyListenerのインスタンス
    • createPropertyChangeListener

      protected PropertyChangeListener createPropertyChangeListener(JComponent c)
      メニュー項目に追加されるPropertyChangeListenerを作成します。 このメソッドがnullを返す場合、これはメニュー項目に追加されません。
      パラメータ:
      c - コンポーネント
      戻り値:
      PropertyChangeListenerのインスタンス、またはnull
      導入されたバージョン:
      1.6
    • getPreferredMenuItemSize

      protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap)
      メニュー項目の優先サイズを返します。
      パラメータ:
      c - コンポーネント
      checkIcon - チェック・アイコン
      arrowIcon - 矢印アイコン
      defaultTextIconGap - テキストとアイコンの間の隙間
      戻り値:
      メニュー項目の優先サイズ
    • update

      public void update(Graphics g, JComponent c)
      paintMenuItem()でバックグラウンドを描画するため、update (デフォルトでは不透明なコンポーネントのバックグラウンドを塗りつぶす)をオーバーライドしてpaint()を呼び出してください。
      オーバーライド:
      update、クラスComponentUI
      パラメータ:
      g - ペイント対象のGraphicsコンテキスト
      c - ペイントされるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがある
      関連項目:
    • paintMenuItem

      protected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap)
      メニュー項目をペイントします。
      パラメータ:
      g - Graphicsのインスタンス
      c - コンポーネント
      checkIcon - チェック・アイコン
      arrowIcon - 矢印アイコン
      background - バックグラウンド色
      foreground - 前景色
      defaultTextIconGap - テキストとアイコンの間の隙間
    • paintBackground

      protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor)
      メニュー項目のバックグラウンドを描画します。
      パラメータ:
      g - ペイント・グラフィックス
      menuItem - ペイントされるメニュー項目
      bgColor - 選択バックグラウンド・カラー
      導入されたバージョン:
      1.4
    • paintText

      protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text)
      現在のメニュー項目のテキストをレンダリングします。
      パラメータ:
      g - グラフィックス・コンテキスト
      menuItem - レンダリングするメニュー項目
      textRect - テキストをレンダリングする境界矩形
      text - レンダリングする文字列
      導入されたバージョン:
      1.4
    • getPath

      public MenuElement[] getPath()
      メニュー要素のパスを返します。
      戻り値:
      メニュー要素のパス
    • doClick

      protected void doClick(MenuSelectionManager msm)
      メニュー項目の起動時に、このメソッドを呼び出します。 このメソッドは、選択したパスをクリアしたり、JMenuItemのdoClick()メソッドをメッセージとして送るなど、メニュー項目起動の詳細の一部を処理します。
      パラメータ:
      msm - MenuSelectionManager。 視覚的フィード・バックとさまざまな内部作業は、このMenuSelectionManagerに委譲される。 この引数としてnullが渡された場合、MenuSelectionManager.defaultManagerが使用される。
      導入されたバージョン:
      1.4
      関連項目: