|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--com.zfqjava.swing.AComboBox
AComboBox provides a another combo box.
| Inner Class Summary | |
protected class |
AComboBox.AccessibleAComboBox
This class implements accessibility support for the AComboBox class. |
| Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
AComboBox()
Constructs a combobox. |
|
| Method Summary | |
void |
addPopupMenuListener(javax.swing.event.PopupMenuListener l)
Adds a PopupMenu listener which will listen to notification
messages from the popup portion of the combo box. |
protected javax.swing.JPopupMenu |
createPopupMenu()
Creates the JPopupMenu for the popup component. |
protected void |
firePopupMenuCanceled()
Notifies PopupMenuListeners that the popup portion of the
combo box has been canceled. |
protected void |
firePopupMenuWillBecomeInvisible()
Notifies PopupMenuListeners that the popup portion of the
combo box has become invisible. |
protected void |
firePopupMenuWillBecomeVisible()
Notifies PopupMenuListeners that the popup portion of the
combo box will become visible. |
javax.accessibility.AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this AComboBox. |
javax.swing.ComboBoxEditor |
getEditor()
Returns the editor used to paint and edit the selected item in the JComboBox field. |
java.awt.Component |
getPopupComponent()
Returns the popup component added into JPopupMenu. |
javax.swing.Icon |
getPopupIcon()
Returns the popup icon used for the drop down button icon. |
javax.swing.JPopupMenu |
getPopupMenu()
Returns the popup menu. |
javax.swing.event.PopupMenuListener[] |
getPopupMenuListeners()
Returns an array of all the PopupMenuListeners added
to this JComboBox with addPopupMenuListener(). |
protected java.awt.Point |
getPopupMenuOrigin()
Computes the origin for the AComboBox's popup menu. |
javax.swing.Renderer |
getRenderer()
Returns the renderer used to display the selected item in the JComboBox field. |
java.lang.Object |
getValue()
Returns the value for the AComboBox. |
void |
hidePopup()
Causes the combo box to close its popup window. |
boolean |
isEditable()
Returns true if the JComboBox is editable. |
boolean |
isLightWeightPopupEnabled()
Gets the value of the lightWeightPopupEnabled
property. |
boolean |
isPopupVisible()
Determines the visibility of the popup. |
protected void |
paintComponent(java.awt.Graphics g)
|
protected java.lang.String |
paramString()
Returns a string representation of this AComboBox. |
void |
processKeyEvent(java.awt.event.KeyEvent e)
Handles KeyEvents, looking for the Tab key. |
void |
removePopupMenuListener(javax.swing.event.PopupMenuListener l)
Removes a PopupMenuListener. |
void |
setEditable(boolean aFlag)
Determines whether the JComboBox field is editable. |
void |
setEditor(javax.swing.ComboBoxEditor anEditor)
Sets the editor used to paint and edit the selected item in the JComboBox field. |
void |
setLightWeightPopupEnabled(boolean aFlag)
Sets the lightWeightPopupEnabled property, which
provides a hint as to whether or not a lightweight
Component should be used to contain the
JComboBox, versus a heavyweight
Component such as a Panel
or a Window. |
void |
setPopupComponent(java.awt.Component popupComponent)
Sets the popup component added into JPopupMenu. |
void |
setPopupIcon(javax.swing.Icon popupIcon)
Sets the popup icon used for the drop down button icon. |
void |
setPopupMenu(javax.swing.JPopupMenu popupMenu)
Sets the popup menu. |
void |
setPopupVisible(boolean v)
Sets the visibility of the popup. |
void |
setRenderer(javax.swing.Renderer aRenderer)
Sets the renderer that paints the list items and the item selected from the list in the JComboBox field. |
void |
setValue(java.lang.Object value)
Sets the value for the AComboBox. |
void |
showPopup()
Causes the combo box to display its popup window. |
void |
updateUI()
|
| Methods inherited from class 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, getUIClassID, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, 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, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class 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, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
| Methods inherited from class 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, isVisible, 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, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public AComboBox()
| Method Detail |
public void updateUI()
updateUI in class javax.swing.JComponentpublic void setValue(java.lang.Object value)
AComboBox.value - the value for the AComboBoxgetValue()public java.lang.Object getValue()
AComboBox.AComboBoxsetValue(java.lang.Object)public void setLightWeightPopupEnabled(boolean aFlag)
lightWeightPopupEnabled property, which
provides a hint as to whether or not a lightweight
Component should be used to contain the
JComboBox, versus a heavyweight
Component such as a Panel
or a Window. The decision of lightweight
versus heavyweight is ultimately up to the
JComboBox. Lightweight windows are more
efficient than heavyweight windows, but lightweight
and heavyweight components do not mix well in a GUI.
If your application mixes lightweight and heavyweight
components, you should disable lightweight popups.
The default value for the lightWeightPopupEnabled
property is true, unless otherwise specified
by the look and feel. Some look and feels always use
heavyweight popups, no matter what the value of this property.
See the article Mixing Heavy and Light Components on The Swing Connection This method fires a property changed event.
aFlag - if true, lightweight popups are desiredpublic boolean isLightWeightPopupEnabled()
lightWeightPopupEnabled
property.lightWeightPopupEnabled
propertysetLightWeightPopupEnabled(boolean)public void setEditable(boolean aFlag)
JComboBox field is editable.
An editable JComboBox allows the user to type into the
field or selected an item from the list to initialize the field,
after which it can be edited. (The editing affects only the field,
the list item remains intact.) A non editable JComboBox
displays the selected item in the field,
but the selection cannot be modified.aFlag - a boolean value, where true indicates that the
field is editablepublic boolean isEditable()
JComboBox is editable.
By default, a combo box is not editable.JComboBox is editable, else falsepublic void setRenderer(javax.swing.Renderer aRenderer)
The default renderer displays a string or an icon. Other renderers can handle graphic images and composite items.
To display the selected item,
aRenderer.getListCellRendererComponent
is called, passing the list object and an index of -1.
aRenderer - the ListCellRenderer that
displays the selected itemsetEditor(javax.swing.ComboBoxEditor)public javax.swing.Renderer getRenderer()
JComboBox field.ListCellRenderer that displays
the selected item.public void setEditor(javax.swing.ComboBoxEditor anEditor)
JComboBox field. The editor is used only if the
receiving JComboBox is editable. If not editable,
the combo box uses the renderer to paint the selected item.anEditor - the ComboBoxEditor that
displays the selected itemsetRenderer(javax.swing.Renderer)public javax.swing.ComboBoxEditor getEditor()
JComboBox field.ComboBoxEditor that displays the selected itempublic void setPopupIcon(javax.swing.Icon popupIcon)
popupIcon - the popup icon used for the drop down button icongetPopupIcon()public javax.swing.Icon getPopupIcon()
public void setPopupComponent(java.awt.Component popupComponent)
popupComponent - the popup component added into JPopupMenupublic java.awt.Component getPopupComponent()
protected javax.swing.JPopupMenu createPopupMenu()
protected java.awt.Point getPopupMenuOrigin()
AComboBox's popup menu.Point in the coordinate space of the
menu which should be used as the origin
of the AComboBox's popup menupublic void setPopupMenu(javax.swing.JPopupMenu popupMenu)
popupMenu - the popup menugetPopupMenu()public javax.swing.JPopupMenu getPopupMenu()
setPopupMenu(javax.swing.JPopupMenu)public void showPopup()
setPopupVisible(boolean)public void hidePopup()
setPopupVisible(boolean)public void setPopupVisible(boolean v)
public boolean isPopupVisible()
protected void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentpublic void addPopupMenuListener(javax.swing.event.PopupMenuListener l)
PopupMenu listener which will listen to notification
messages from the popup portion of the combo box.
For all standard look and feels shipped with Java 2, the popup list
portion of combo box is implemented as a JPopupMenu.
A custom look and feel may not implement it this way and will
therefore not receive the notification.
l - the PopupMenuListener to addpublic void removePopupMenuListener(javax.swing.event.PopupMenuListener l)
PopupMenuListener.l - the PopupMenuListener to removeaddPopupMenuListener(javax.swing.event.PopupMenuListener)public javax.swing.event.PopupMenuListener[] getPopupMenuListeners()
PopupMenuListeners added
to this JComboBox with addPopupMenuListener().PopupMenuListeners added or an empty
array if no listeners have been addedprotected void firePopupMenuWillBecomeVisible()
PopupMenuListeners that the popup portion of the
combo box will become visible.
This method is public but should not be called by anything other than the UI delegate.
addPopupMenuListener(javax.swing.event.PopupMenuListener)protected void firePopupMenuWillBecomeInvisible()
PopupMenuListeners that the popup portion of the
combo box has become invisible.
This method is public but should not be called by anything other than the UI delegate.
addPopupMenuListener(javax.swing.event.PopupMenuListener)protected void firePopupMenuCanceled()
PopupMenuListeners that the popup portion of the
combo box has been canceled.
This method is public but should not be called by anything other than the UI delegate.
addPopupMenuListener(javax.swing.event.PopupMenuListener)public void processKeyEvent(java.awt.event.KeyEvent e)
KeyEvents, looking for the Tab key.
If the Tab key is found, the popup window is closed.processKeyEvent in class javax.swing.JComponente - the KeyEvent containing the keyboard
key that was pressedprotected java.lang.String paramString()
null.paramString in class javax.swing.JComponentpublic javax.accessibility.AccessibleContext getAccessibleContext()
getAccessibleContext in interface javax.accessibility.AccessiblegetAccessibleContext in class javax.swing.JComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||