|
TV-Browser 2.7.5 API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JMenuItem
javax.swing.JMenu
util.ui.ScrollableMenu
public class ScrollableMenu
An implementation of a scrollable menu -- a popup window containing
JMenuItems that is displayed when the user selects an item on
the JMenuBar. In addition to JMenuItems, a
JMenu can also contain JSeparators.
In essence, a menu is a button with an associated JPopupMenu.
When the "button" is pressed, the JPopupMenu appears. If the
"button" is on the JMenuBar, the menu is a top-level window.
If the "button" is another menu item, then the JPopupMenu is
"pull-right" menu.
If the menu contains more items than displayable on the screen the menu
becomes scrollable by hiding some of the items and adding an add and a down
arrow at both ends of the menu to scroll the menu with this arrows.
description: A popup window containing menu items displayed in a menu bar.
JPopupMenu,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JMenu |
|---|
JMenu.AccessibleJMenu, JMenu.WinListener |
| Nested classes/interfaces inherited from class javax.swing.JMenuItem |
|---|
JMenuItem.AccessibleJMenuItem |
| Nested classes/interfaces inherited from class javax.swing.AbstractButton |
|---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JMenu |
|---|
popupListener |
| 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 javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ScrollableMenu()
Constructs a new JMenu with no text. |
|
ScrollableMenu(Action a)
Constructs a new JMenu whose properties are taken from the
Action supplied. |
|
ScrollableMenu(String menuTitle)
Constructs a new JMenu with the supplied string as its text. |
|
ScrollableMenu(String s,
boolean b)
Constructs a new JMenu with the supplied string as its text
and specified as a tear-off menu or not. |
|
| Method Summary | |
|---|---|
Component |
add(Component component)
Appends a component to the end of this menu. |
Component |
add(Component component,
int index)
Adds the specified component to this container at the given position. |
JMenuItem |
add(JMenuItem menuItem)
Appends a menu item to the end of this menu. |
protected void |
addScrollableComponent(Component component)
Add the specified component at the end of this scrollable menu |
protected void |
addScrollableComponent(Component component,
int pos)
Add the specified component to this scrollable menu |
void |
addSeparator()
Appends a new separator to the end of the menu. |
JMenuItem |
getItem(int pos)
Returns the JMenuItem at the specified position. |
int |
getItemCount()
Returns the number of items on the menu, including separators. |
Component |
getMenuComponent(int n)
Returns the component at position n. |
int |
getMenuComponentCount()
Returns the number of components on the menu. |
Component[] |
getMenuComponents()
Returns an array of Components of the menu's subcomponents. |
JMenuItem |
insert(Action a,
int pos)
Inserts a new menu item attached to the specified Action
object at a given position. |
JMenuItem |
insert(JMenuItem menuItem,
int pos)
Inserts the specified JMenuitem at a given position. |
void |
insert(String s,
int pos)
|
boolean |
isMenuComponent(Component component)
Returns true if the specified component exists in the submenu hierarchy. |
void |
remove(Component component)
Removes the component c from this menu. |
void |
remove(int pos)
Removes the menu item at the specified index from this menu. |
void |
remove(JMenuItem menuItem)
Removes the specified menu item from this menu. |
void |
removeAll()
Removes all menu items from this menu. |
protected void |
removeScrollableComponent(Component component)
Remove the specified component from this scrollable menu |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.swing.MenuElement |
|---|
processKeyEvent, processMouseEvent |
| Constructor Detail |
|---|
public ScrollableMenu()
JMenu with no text.
public ScrollableMenu(Action a)
JMenu whose properties are taken from the
Action supplied.
a - an Action
public ScrollableMenu(String s,
boolean b)
JMenu with the supplied string as its text
and specified as a tear-off menu or not.
s - the text for the menu labelb - can the menu be torn off (not yet implemented)public ScrollableMenu(String menuTitle)
JMenu with the supplied string as its text.
menuTitle - the text for the menu label| Method Detail |
|---|
public JMenuItem add(JMenuItem menuItem)
add in class JMenumenuItem - the JMenuitem to be added
JMenuItem addedpublic Component add(Component component)
add in class JMenucomponent - the Component to add
Component added
public Component add(Component component,
int index)
index equals -1, the component will be appended to the end.
add in class JMenucomponent - the Component to addindex - the position at which to insert the component
Component addedremove(Component),
Container.add(Component, int)
public void insert(String s,
int pos)
insert in class JMenu
public JMenuItem insert(JMenuItem menuItem,
int pos)
JMenuitem at a given position.
insert in class JMenumenuItem - the JMenuitem to addpos - an integer specifying the position at which to add the new
JMenuitem
IllegalArgumentException - if the value of pos < 0
public JMenuItem insert(Action a,
int pos)
Action
object at a given position.
insert in class JMenua - the Action object for the menu item to addpos - an integer specifying the position at which to add the new menu
item
IllegalArgumentException - if the value of pos < 0public JMenuItem getItem(int pos)
JMenuItem at the specified position. If the
component at pos is not a menu item, null is
returned. This method is included for AWT compatibility.
getItem in class JMenupos - an integer specifying the position
null if
the item as the specified position is not a menu item
IllegalArgumentException - if the value of pos < 0public int getItemCount()
getItemCount in class JMenugetMenuComponentCount()public void remove(JMenuItem menuItem)
remove in class JMenumenuItem - the JMenuItem to be removed from the menupublic void remove(int pos)
remove in class JMenupos - the position of the item to be removed
IllegalArgumentException - if the value of pos < 0,
or if pos is greater than the number of menu
itemspublic void remove(Component component)
c from this menu.
remove in class JMenucomponent - the component to be removedpublic void removeAll()
removeAll in class JMenupublic int getMenuComponentCount()
getMenuComponentCount in class JMenupublic Component getMenuComponent(int n)
n.
getMenuComponent in class JMenun - the position of the component to be returned
null if there is no
popup menupublic Component[] getMenuComponents()
Components of the menu's subcomponents.
Note that this returns all Components in the popup menu,
including separators.
getMenuComponents in class JMenuComponents or an empty array if there
is no popup menupublic boolean isMenuComponent(Component component)
isMenuComponent in class JMenucomponent - the Component to be tested
Component exists, false otherwisepublic void addSeparator()
addSeparator in class JMenu
protected void addScrollableComponent(Component component,
int pos)
component - the Component to addpos - an integer specifying the position at which to add the new
componentprotected void addScrollableComponent(Component component)
component - the Component to addprotected void removeScrollableComponent(Component component)
component - the Component to remove
|
TV-Browser 2.7.5 API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||