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

クラスBasicMenuItemUI

    • フィールドの詳細

      • menuItem

        protected JMenuItem menuItem
        JMenuItemのインスタンス。
      • 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のインスタンス。
      • menuDragMouseListener

        protected MenuDragMouseListener menuDragMouseListener
        MenuDragMouseListenerのインスタンス。
      • menuKeyListener

        protected MenuKeyListener menuKeyListener
        MenuKeyListenerのインスタンス。
      • propertyChangeListener

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

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

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

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

      • BasicMenuItemUI

        public 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オブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがある
        関連項目:
        ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent), JComponent.paintComponent(java.awt.Graphics)
      • 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
        関連項目:
        MenuSelectionManager, AbstractButton.doClick(int)