GNU Classpath (0.18) | ||
Prev Class | Next Class | Frames | No Frames | |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ComboBoxUI
javax.swing.plaf.basic.BasicComboBoxUI
public class BasicComboBoxUI
extends ComboBoxUI
Nested Class Summary | |
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
Field Summary | |
protected JButton |
|
protected Dimension | |
protected JComboBox |
|
protected CellRendererPane | |
protected Component |
|
protected FocusListener |
|
protected boolean |
|
protected boolean | |
protected ItemListener |
|
protected KeyListener |
|
protected JList |
|
protected ListDataListener |
|
protected ComboPopup |
|
protected KeyListener | |
protected MouseListener | |
protected MouseMotionListener | |
protected PropertyChangeListener |
|
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
protected void |
|
protected JButton |
|
protected ComboBoxEditor |
|
protected FocusListener |
|
protected ItemListener |
|
protected KeyListener |
|
protected LayoutManager |
|
protected ListDataListener |
|
protected ComboPopup |
|
protected PropertyChangeListener |
|
protected ListCellRenderer |
|
static ComponentUI |
|
Accessible |
|
int |
|
protected Dimension |
|
protected Insets |
|
protected Dimension |
|
Dimension |
|
Dimension |
|
Dimension |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
void |
|
boolean |
|
protected boolean |
|
boolean |
|
void |
|
void |
|
void |
|
protected Rectangle |
|
void |
|
protected void |
|
protected void |
|
void |
|
protected void |
|
void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
void |
|
Methods inherited from class javax.swing.plaf.ComboBoxUI | |
isFocusTraversable , isPopupVisible , setPopupVisible |
Methods inherited from class javax.swing.plaf.ComponentUI | |
contains , createUI , getAccessibleChild , getAccessibleChildrenCount , getMaximumSize , getMinimumSize , getPreferredSize , installUI , paint , uninstallUI , update |
Methods inherited from class java.lang.Object | |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
protected JButton arrowButton
This arrow button that is displayed in the rigth side of JComboBox. This button is used to hide and show combo box's list of items
protected Component editor
Component that is responsible for displaying/editting selected item of the combo box. By default JTextField is used as an editor for the JComboBox
protected FocusListener focusListener
Listener listening to focus events occuring in the JComboBox
protected ItemListener itemListener
Listener listening to item events fired by the JComboBox
protected KeyListener keyListener
KeyListener listening to key events that occur while JComboBox has focus
protected JList listBox
List used when rendering selected item of the combo box. The selection and foreground colors for combo box renderer are configured from this list
protected ListDataListener listDataListener
ListDataListener listening to JComboBox model
protected PropertyChangeListener propertyChangeListener
Listener listening to changes in the bound properties of JComboBox
public void configureArrowButton()
This method adds listeners to the arrow button part of the combo box.
protected JButton createArrowButton()
This method create arrow button for this JComboBox. Arrow button is responsible for displaying / hiding drop down list of items when it is clicked.
- Returns:
- JButton arrow button for this JComboBox.
protected ComboBoxEditor createEditor()
Creates component that will be responsible for displaying/editting selected item in the combo box. This editor is used only when combo box is editable.
- Returns:
- component that will be responsible for displaying/editting selected item in the combo box.
protected FocusListener createFocusListener()
This method create FocusListener that will listen to changes in this JComboBox's focus.
- Returns:
- theFocusListener
protected ItemListener createItemListener()
This method creates ItemListener that will listen to to the changes in the JComboBox's selection.
- Returns:
- the ItemListener
protected KeyListener createKeyListener()
Creates KeyListener to listen to key events.
- Returns:
- KeyListener that listens to key events.
protected LayoutManager createLayoutManager()
This method returns layout manager for the combo box.
- Returns:
- layout manager for the combo box
protected ListDataListener createListDataListener()
This method create ListDataListener to listen to ComboBox's data model
- Returns:
- ListDataListener
protected ComboPopup createPopup()
This method creates popup that will contain list of combo box's items
- Returns:
- popup containing list of combo box's items
protected PropertyChangeListener createPropertyChangeListener()
This method creates PropertyChangeListener to listen to the changes in the JComboBox's bound properties.
- Returns:
- the PropertyChangeListener
protected ListCellRenderer createRenderer()
This method creates component that will be responsible for rendering the selected component in the combo box.
- Returns:
- render for the combo box
public static ComponentUI createUI(JComponent c)
Factory method to create a BasicComboBoxUI for the givenJComponent
, which should be aJComboBox
.
- Overrides:
- createUI in interface ComponentUI
- Parameters:
c
- TheJComponent
a UI is being created for.
- Returns:
- A BasicComboBoxUI for the
JComponent
.
public Accessible getAccessibleChild(JComponent c, int i)
Returns the specified accessible child of the component. The default implementation delegates the inquiry to theAccessibleContext
ofc
.
- Overrides:
- getAccessibleChild in interface ComponentUI
- Parameters:
c
- the component whosei
-th accessible child is requested.i
- the index of the accessible child, starting at zero.
public int getAccessibleChildrenCount(JComponent c)
Counts the number of accessible children in the component. The default implementation delegates the inquiry to theAccessibleContext
ofc
.
- Overrides:
- getAccessibleChildrenCount in interface ComponentUI
- Parameters:
c
- the component whose accessible children are to be counted.
protected Dimension getDefaultSize()
Returns default size for the combo box that doesn't contain any elements in it
- Returns:
- Default size of the combo box with no elements in it.
protected Insets getInsets()
This method returns insets of the current border.
- Returns:
- Insets representing space between combo box and its border
protected Dimension getLargestItemSize()
Returns size of the largest item in the combo box. This size will be the size of the combo box, not including the arrowButton.
- Returns:
- dimensions of the largest item in the combo box.
public Dimension getMaximumSize(JComponent c)
This method returns the maximum size for thisJComboBox
for this look and feel.
- Overrides:
- getMaximumSize in interface ComponentUI
- Parameters:
c
- TheJComponent
to find the maximum size for
- Returns:
- The dimensions of the minimum size.
public Dimension getMinimumSize(JComponent c)
This method returns the minimum size for thisJComboBox
for this look and feel.
- Overrides:
- getMinimumSize in interface ComponentUI
- Parameters:
c
- TheJComponent
to find the minimum size for.
- Returns:
- The dimensions of the minimum size.
public Dimension getPreferredSize(JComponent c)
Returns preferred size for the given menu item.
- Overrides:
- getPreferredSize in interface ComponentUI
- Parameters:
c
- comboBox for which to get preferred size
- Returns:
- $Dimension$ preferred size for the given combo box
protected void installComponents()
This method installs components for this JComboBox. ArrowButton, main part of combo box (upper part) and popup list of items are created and configured here.
protected void installDefaults()
This method installs the defaults that are defined in the Basic look and feel for thisJComboBox
.
protected void installKeyboardActions()
This method installs the keyboard actions for the JComboBox as specified by the look and feel.
protected void installListeners()
This method creates and installs the listeners for this UI.
public void installUI(JComponent c)
This method installs the UI for the given JComponent.
- Overrides:
- installUI in interface ComponentUI
- Parameters:
c
- The JComponent to install a UI for.
public boolean isFocusTraversable(JComboBox c)
JComboBox is focus traversable if it is editable and not otherwise.
- Overrides:
- isFocusTraversable in interface ComboBoxUI
- Parameters:
c
- combo box for which to check whether it is focus traversable
- Returns:
- true if focus tranversable and false otherwise
protected boolean isNavigationKey(int keyCode)
Returns true if the specified key is a navigation key and false otherwise
- Parameters:
keyCode
- a key for which to check whether it is navigation key or not.
- Returns:
- true if the specified key is a navigation key and false otherwis
public boolean isPopupVisible(JComboBox c)
This method checks if popup part of the combo box is visible on the screen
- Overrides:
- isPopupVisible in interface ComboBoxUI
- Parameters:
c
- The JComboBox to check
- Returns:
- true if popup part of the JComboBox is visible and false otherwise.
public void paint(Graphics g, JComponent c)
Paints given menu item using specified graphics context
- Overrides:
- paint in interface ComponentUI
- Parameters:
g
- The graphics context used to paint this combo boxc
- comboBox which needs to be painted.
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus)
This method paints currently selected value in the main part of the combo box (part without popup).
- Parameters:
g
- graphics contextbounds
- Rectangle representing the size of the area in which selected item should be drawnhasFocus
- true if combo box has focus and false otherwise
public void paintCurrentValueBackground(Graphics g, Rectangle bounds, boolean hasFocus)
This method paints background of part of the combo box, where currently selected value is displayed. If the combo box has focus this method should also paint focus rectangle around the combo box.
- Parameters:
g
- graphics contextbounds
- Rectangle representing the size of the largest item in the comboBoxhasFocus
- true if combo box has fox and false otherwise
protected Rectangle rectangleForCurrentValue()
This method returns bounds in which comboBox's selected Item will be displayed
- Returns:
- rectangle bounds in which comboBox's selected Item will be displayed
protected void selectNextPossibleValue()
This method selects next possible item relative to the current selection to be next selected item in the combo box.
protected void selectPreviousPossibleValue()
This method selects previous item relative to current selection to be next selected item.
public void setPopupVisible(JComboBox c, boolean v)
Displays/Hides JComboBox's list of items on the screen.
- Overrides:
- setPopupVisible in interface ComboBoxUI
- Parameters:
c
- The combo box, for which list of items should be displayed/hiddenv
- true if show popup part of the jcomboBox and false to hide.
protected void toggleOpenClose()
This method displays combo box popup if the popup is not currently shown on the screen and hides it if it is currently shown
public void unconfigureArrowButton()
This method removes listeners from the arrow button part of the combo box.
protected void unconfigureEditor()
This method removes all the listeners for the editor.
protected void uninstallComponents()
This method uninstalls components from this JComboBox
protected void uninstallDefaults()
This method uninstalls the defaults and sets any objects created during install to null
protected void uninstallKeyboardActions()
This method uninstalls the keyboard actions for the JComboBox there were installed by ininstallListeners()
.
protected void uninstallListeners()
Detaches all the listeners we attached ininstallListeners()
.
public void uninstallUI(JComponent c)
This method uninstalls the UI.
- Overrides:
- uninstallUI in interface ComponentUI
- Parameters:
c
- The JComponent that is having this UI removed.
GNU Classpath (0.18) |