JavaTM 2 Platform
Std. Ed. v1.3

javax.swing.plaf.basic
クラス BasicComboPopup

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPopupMenu
                          |
                          +--javax.swing.plaf.basic.BasicComboPopup
すべての実装インタフェース:
Accessible, ComboPopup, ImageObserver, MenuContainer, MenuElement, Serializable
直系の既知のサブクラス:
MetalComboBoxUI.MetalComboPopup

public class BasicComboPopup
extends JPopupMenu
implements ComboPopup

ComboPopup インタフェースの実装です。主に、BasicComboBoxUI およびそのサブクラスが使うためのものです。BasicComboPopup は JPopupMenu を拡張します。これは、ほとんどのコンボボックスが、ポップアップメニューを使って選択肢のリストを表示するためです。BasicComboBoxUI は ComboPopup だけを必要とするので、BasicComboBoxUI のサブクラスはこのクラスを使わなくてもかまいません。 すべてのイベント処理は、createxxxListener() の各メソッド、および内部クラスが扱います。このクラスの動作を変更するには、createxxxListener() の各メソッドをオーバーライドした上で、独自のイベントリスナーを提供するか、このクラスで提供されたイベントリスナーからサブクラス化します。 イベントを扱うための内部クラスは、次のとおりです。InvocationMouseHandler InvocationMouseMotionHandler InvocationKeyHandler ListSelectionHandler ListDataHandler ListMouseHandler ListMouseMotionHandler PropertyChangeHandler ItemHandler

警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。

関連項目:
直列化された形式

内部クラスの概要
 class BasicComboPopup.InvocationKeyHandler
          このリスナーはスペースバーの押下を監視して、必要に応じてポップアップを表示したり隠したりします。
protected  class BasicComboPopup.InvocationMouseHandler
          このリスナーは、このポップアップメニューをいつ、どのようにして呼び出すかを認識しています。
protected  class BasicComboPopup.InvocationMouseMotionHandler
          このリスナーは、マウスのドラッグを監視して、リスト上でのドラッグであればリストの現在の選択範囲を更新します。
protected  class BasicComboPopup.ItemHandler
          このリスナーは、JComboBox の選択範囲の変化を監視します。
 class BasicComboPopup.ListDataHandler
          リスト内の選択されたインデックスを、コンボボックスでの選択と同期して保持します。
protected  class BasicComboPopup.ListMouseHandler
          このリスナーは、リスト内でマウスが離されたときにポップアップを隠します。
protected  class BasicComboPopup.ListMouseMotionHandler
          このリスナーは、リスト上でのマウスの移動に応じて、選択された項目を変更します。
protected  class BasicComboPopup.ListSelectionHandler
          このリスナーは、リストの選択内の変更を監視して、その変更をコンボボックスに報告します。
protected  class BasicComboPopup.PropertyChangeHandler
          このリスナーは、JComboBox のバウンドプロパティの変化を監視します。
 
クラス javax.swing.JPopupMenu から継承した内部クラス
JPopupMenu.AccessibleJPopupMenu, JPopupMenu.Separator
 
クラス javax.swing.JComponent から継承した内部クラス
JComponent.AccessibleJComponent
 
クラス java.awt.Container から継承した内部クラス
Container.AccessibleAWTContainer
 
クラス java.awt.Component から継承した内部クラス
Component.AccessibleAWTComponent
 
フィールドの概要
protected  Timer autoscrollTimer
           
protected  JComboBox comboBox
           
protected  boolean hasEntered
           
protected  boolean isAutoScrolling
           
protected  ItemListener itemListener
           
protected  KeyListener keyListener
           
protected  JList list
           
protected  ListDataListener listDataListener
           
protected  MouseListener listMouseListener
           
protected  MouseMotionListener listMouseMotionListener
           
protected  ListSelectionListener listSelectionListener
           
protected  MouseListener mouseListener
           
protected  MouseMotionListener mouseMotionListener
           
protected  PropertyChangeListener propertyChangeListener
           
protected static int SCROLL_DOWN
           
protected static int SCROLL_UP
           
protected  int scrollDirection
           
protected  JScrollPane scroller
           
protected  boolean valueIsAdjusting
           
 
クラス javax.swing.JComponent から継承したフィールド
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
クラス java.awt.Component から継承したフィールド
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
インタフェース java.awt.image.ImageObserver から継承したフィールド
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
コンストラクタの概要
BasicComboPopup(JComboBox combo)
           
 
メソッドの概要
protected  void autoScrollDown()
           
protected  void autoScrollUp()
           
protected  Rectangle computePopupBounds(int px, int py, int pw, int ph)
           
protected  void configureList()
          createList() で作成されたリストを構成するために呼び出されます。
protected  void configurePopup()
          この JPopupMenu を構成するために呼び出されます (BasicComboPopup は JPopupMenu)。
protected  void configureScroller()
          createScroller() で作成された JScrollPane を構成するために呼び出されます。
protected  MouseEvent convertMouseEvent(MouseEvent e)
           
protected  ItemListener createItemListener()
          JComboBox で選択された項目の変更を監視する項目リスナーを作成します。
protected  KeyListener createKeyListener()
          ComboPopup.getKeyListener() で返されるキーリスナーを作成します。
protected  JList createList()
          モデル内の項目を表示するためにポップアップで使用される JList を作成します。
protected  ListDataListener createListDataListener()
          コンボボックスモデルについて挿入または削除された項目を監視するリストデータリスナーを作成します。
protected  MouseListener createListMouseListener()
          ポップアップのリストでのマウスイベントを監視するマウスリスナーを作成します。
protected  MouseMotionListener createListMouseMotionListener()
          ポップアップのリストでのマウスイベントを監視するマウスモーションリスナーを作成します。
protected  ListSelectionListener createListSelectionListener()
          ポップアップのリストでの選択の変更を監視するリスト選択リスナーを作成します。
protected  MouseListener createMouseListener()
          ComboPopup.getMouseListener() で返されるマウスリスナーを作成します。
protected  MouseMotionListener createMouseMotionListener()
          ComboPopup.getMouseMotionListener() で返されるマウスモーションリスナーを作成します。
protected  PropertyChangeListener createPropertyChangeListener()
          JComboBox のバウンドプロパティの変更を監視するプロパティ変更リスナーを作成します。
protected  JScrollPane createScroller()
          リストを保持するためにポップアップで使用される JScrollPane を作成します。
protected  void delegateFocus(MouseEvent e)
          ポップアップが開くときに、フォーカスの送り先をイベントハンドラが決定するのを補助するユーティリティメソッドです。
 KeyListener getKeyListener()
          ComboPopup.getKeyListener() の実装です。
 JList getList()
          ComboPopup.getList() の実装です。
 MouseListener getMouseListener()
          ComboPopup.getMouseListener() の実装です。
 MouseMotionListener getMouseMotionListener()
          ComboPopup.getMouseMotionListener() の実装です。
protected  int getPopupHeightForRowCount(int maxRowCount)
           
 void hide()
          ComboPopup.hide() の実装です。
protected  void installComboBoxListeners()
          JComboBox に必要なリスナーを追加します。
protected  void installComboBoxModelListeners(ComboBoxModel model)
           
protected  void installKeyboardActions()
           
protected  void installListListeners()
          configureList() で呼び出され、必要なリスナーをリストに追加します。
 boolean isFocusTraversable()
          無条件で false を返すためにオーバーライドされます。
 void show()
          ComboPopup.show() の実装です。
protected  void startAutoScrolling(int direction)
          リストの自動スクロールを扱うために、BasicComboPopup$InvocationMouseMotionHandler によって呼び出されます。
protected  void stopAutoScrolling()
           
protected  void togglePopup()
          ポップアップが隠されていればはポップアップを可視にし、可視であればポップアップを隠します。
protected  void uninstallComboBoxModelListeners(ComboBoxModel model)
           
 void uninstallingUI()
          UI がアンインストールしているときに呼び出されます。
protected  void uninstallKeyboardActions()
           
protected  void updateListBoxSelectionForEvent(MouseEvent anEvent, boolean shouldScroll)
          イベントリスナーが使うユーティリティメソッドです。
 
クラス javax.swing.JPopupMenu から継承したメソッド
add, add, add, addPopupMenuListener, addSeparator, createActionChangeListener, createActionComponent, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMargin, getSelectionModel, getSubElements, getUI, getUIClassID, insert, insert, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, isVisible, menuSelectionChanged, pack, paintBorder, paramString, processKeyEvent, processMouseEvent, remove, removePopupMenuListener, setBorderPainted, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelected, setSelectionModel, setUI, setVisible, show, updateUI
 
クラス javax.swing.JComponent から継承したメソッド
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
クラス java.awt.Container から継承したメソッド
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
クラス java.awt.Component から継承したメソッド
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setName, setSize, setSize, show, size, toString, transferFocus
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
インタフェース javax.swing.plaf.basic.ComboPopup から継承したメソッド
isVisible
 

フィールドの詳細

comboBox

protected JComboBox comboBox

list

protected JList list

scroller

protected JScrollPane scroller

valueIsAdjusting

protected boolean valueIsAdjusting

mouseMotionListener

protected MouseMotionListener mouseMotionListener

mouseListener

protected MouseListener mouseListener

keyListener

protected KeyListener keyListener

listSelectionListener

protected ListSelectionListener listSelectionListener

listDataListener

protected ListDataListener listDataListener

listMouseListener

protected MouseListener listMouseListener

listMouseMotionListener

protected MouseMotionListener listMouseMotionListener

propertyChangeListener

protected PropertyChangeListener propertyChangeListener

itemListener

protected ItemListener itemListener

autoscrollTimer

protected Timer autoscrollTimer

hasEntered

protected boolean hasEntered

isAutoScrolling

protected boolean isAutoScrolling

scrollDirection

protected int scrollDirection

SCROLL_UP

protected static final int SCROLL_UP

SCROLL_DOWN

protected static final int SCROLL_DOWN
コンストラクタの詳細

BasicComboPopup

public BasicComboPopup(JComboBox combo)
メソッドの詳細

show

public void show()
ComboPopup.show() の実装です。
定義:
インタフェース ComboPopup 内の show
オーバーライド:
クラス Component 内の show

hide

public void hide()
ComboPopup.hide() の実装です。
定義:
インタフェース ComboPopup 内の hide
オーバーライド:
クラス JComponent 内の hide

getList

public JList getList()
ComboPopup.getList() の実装です。
定義:
インタフェース ComboPopup 内の getList

getMouseListener

public MouseListener getMouseListener()
ComboPopup.getMouseListener() の実装です。
定義:
インタフェース ComboPopup 内の getMouseListener

getMouseMotionListener

public MouseMotionListener getMouseMotionListener()
ComboPopup.getMouseMotionListener() の実装です。
定義:
インタフェース ComboPopup 内の getMouseMotionListener

getKeyListener

public KeyListener getKeyListener()
ComboPopup.getKeyListener() の実装です。
定義:
インタフェース ComboPopup 内の getKeyListener

uninstallingUI

public void uninstallingUI()
UI がアンインストールしているときに呼び出されます。このポップアップはコンポーネントツリーに含まれないので、コンポーネントツリーの uninstallUI() は呼び出されません。addComboBoxListeners() に追加されたリスナーを削除します。
定義:
インタフェース ComboPopup 内の uninstallingUI

uninstallComboBoxModelListeners

protected void uninstallComboBoxModelListeners(ComboBoxModel model)

uninstallKeyboardActions

protected void uninstallKeyboardActions()

createMouseListener

protected MouseListener createMouseListener()
ComboPopup.getMouseListener() で返されるマウスリスナーを作成します。BasicComboPopup$InvocationMouseHandler のインスタンスを返します。

createMouseMotionListener

protected MouseMotionListener createMouseMotionListener()
ComboPopup.getMouseMotionListener() で返されるマウスモーションリスナーを作成します。BasicComboPopup$InvocationMouseMotionListener のインスタンスを返します。

createKeyListener

protected KeyListener createKeyListener()
ComboPopup.getKeyListener() で返されるキーリスナーを作成します。BasicComboPopup$InvocationKeyHandler のインスタンスを返します。

createListSelectionListener

protected ListSelectionListener createListSelectionListener()
ポップアップのリストでの選択の変更を監視するリスト選択リスナーを作成します。BasicComboPopup$ListSelectionHandler のインスタンスを返します。

createListDataListener

protected ListDataListener createListDataListener()
コンボボックスモデルについて挿入または削除された項目を監視するリストデータリスナーを作成します。

createListMouseListener

protected MouseListener createListMouseListener()
ポップアップのリストでのマウスイベントを監視するマウスリスナーを作成します。BasicComboPopup$ListMouseHandler のインスタンスを返します。

createListMouseMotionListener

protected MouseMotionListener createListMouseMotionListener()
ポップアップのリストでのマウスイベントを監視するマウスモーションリスナーを作成します。BasicComboPopup$ListMouseMotionHandler のインスタンスを返します。

createPropertyChangeListener

protected PropertyChangeListener createPropertyChangeListener()
JComboBox のバウンドプロパティの変更を監視するプロパティ変更リスナーを作成します。BasicComboPopup$PropertyChangeHandler のインスタンスを返します。

createItemListener

protected ItemListener createItemListener()
JComboBox で選択された項目の変更を監視する項目リスナーを作成します。BasicComboPopup$ItemHandler のインスタンスを返します。

createList

protected JList createList()
モデル内の項目を表示するためにポップアップで使用される JList を作成します。

configureList

protected void configureList()
createList() で作成されたリストを構成するために呼び出されます。

installListListeners

protected void installListListeners()
configureList() で呼び出され、必要なリスナーをリストに追加します。

createScroller

protected JScrollPane createScroller()
リストを保持するためにポップアップで使用される JScrollPane を作成します。

configureScroller

protected void configureScroller()
createScroller() で作成された JScrollPane を構成するために呼び出されます。

configurePopup

protected void configurePopup()
この JPopupMenu を構成するために呼び出されます (BasicComboPopup は JPopupMenu)。

installComboBoxListeners

protected void installComboBoxListeners()
JComboBox に必要なリスナーを追加します。

installComboBoxModelListeners

protected void installComboBoxModelListeners(ComboBoxModel model)

installKeyboardActions

protected void installKeyboardActions()

isFocusTraversable

public boolean isFocusTraversable()
無条件で false を返すためにオーバーライドされます。
オーバーライド:
クラス JComponent 内の isFocusTraversable
クラス javax.swing.JComponent からコピーされたタグ:
戻り値:
このコンポーネントがフォーカスを受け取れる場合は true

startAutoScrolling

protected void startAutoScrolling(int direction)
リストの自動スクロールを扱うために、BasicComboPopup$InvocationMouseMotionHandler によって呼び出されます。

stopAutoScrolling

protected void stopAutoScrolling()

autoScrollUp

protected void autoScrollUp()

autoScrollDown

protected void autoScrollDown()

delegateFocus

protected void delegateFocus(MouseEvent e)
ポップアップが開くときに、フォーカスの送り先をイベントハンドラが決定するのを補助するユーティリティメソッドです。標準的な実装では、コンボボックスが編集可能な場合はエディタにフォーカスを委譲し、編集不可能な場合は JComboBox に委譲します。

togglePopup

protected void togglePopup()
ポップアップが隠されていればはポップアップを可視にし、可視であればポップアップを隠します。

convertMouseEvent

protected MouseEvent convertMouseEvent(MouseEvent e)

getPopupHeightForRowCount

protected int getPopupHeightForRowCount(int maxRowCount)

computePopupBounds

protected Rectangle computePopupBounds(int px,
                                       int py,
                                       int pw,
                                       int ph)

updateListBoxSelectionForEvent

protected void updateListBoxSelectionForEvent(MouseEvent anEvent,
                                              boolean shouldScroll)
イベントリスナーが使うユーティリティメソッドです。マウスイベントを受けて、マウスの下にあるリスト項目のリスト選択を変更します。

JavaTM 2 Platform
Std. Ed. v1.3

バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。

Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.