org.apache.batik.util.gui

Class DropDownComponent.ScrollablePopupMenu

public static class DropDownComponent.ScrollablePopupMenu extends JPopupMenu

The Scrollable Popup Menu Component.
Constructor Summary
ScrollablePopupMenu(JComponent owner)
Constructor.
Method Summary
voidadd(DropDownComponent.ScrollablePopupMenuItem menuItem, int index, int oldSize, int newSize)
Adds the item to this component at the specified location.
voidaddListener(DropDownComponent.ScrollablePopupMenuListener listener)
Adds the listener to the listener list.
voidfireItemsWereAdded(DropDownComponent.ScrollablePopupMenuEvent event)
Fires the itemsWereAdded event, when the items are added to this pop up menu.
voidfireItemsWereRemoved(DropDownComponent.ScrollablePopupMenuEvent event)
Fires the itemsWereRemove event, when the items are removed from this pop up menu.
DropDownComponent.ScrollablePopupMenuItemgetFooter()
Gets the footer item.
DropDownComponent.ScrollablePopupMenuModelgetModel()
Gets the ScrollablePopupMenuModel
JComponentgetOwner()
Gets the owner component.
DimensiongetPreferredSize()
intgetSelectedItemsCount()
Gets the number of the selected items.
voidprocessItemClicked()
Processes click on the pop up menu item.
voidremove(DropDownComponent.ScrollablePopupMenuItem menuItem, int oldSize, int newSize)
Removes the item from this component.
voidselectionChanged(DropDownComponent.ScrollablePopupMenuItem targetItem, boolean wasSelected)
Invoked when item selection changes.
voidsetModel(DropDownComponent.ScrollablePopupMenuModel model)
Sets the ScrollablePopupMenuModel.
voidshowMenu(Component invoker, Component refComponent)
Shows this popup menu.

Constructor Detail

ScrollablePopupMenu

public ScrollablePopupMenu(JComponent owner)
Constructor.

Parameters: owner The owner component

Method Detail

add

public void add(DropDownComponent.ScrollablePopupMenuItem menuItem, int index, int oldSize, int newSize)
Adds the item to this component at the specified location.

Parameters: menuItem the item to add

addListener

public void addListener(DropDownComponent.ScrollablePopupMenuListener listener)
Adds the listener to the listener list.

Parameters: listener The listener to add

fireItemsWereAdded

public void fireItemsWereAdded(DropDownComponent.ScrollablePopupMenuEvent event)
Fires the itemsWereAdded event, when the items are added to this pop up menu.

Parameters: event The associated ScrollablePopupMenuEvent event

fireItemsWereRemoved

public void fireItemsWereRemoved(DropDownComponent.ScrollablePopupMenuEvent event)
Fires the itemsWereRemove event, when the items are removed from this pop up menu.

Parameters: event The associated ScrollablePopupMenuEvent event

getFooter

public DropDownComponent.ScrollablePopupMenuItem getFooter()
Gets the footer item.

Returns: the footer

getModel

public DropDownComponent.ScrollablePopupMenuModel getModel()
Gets the ScrollablePopupMenuModel

Returns: the ScrollablePopupMenuModel model

getOwner

public JComponent getOwner()
Gets the owner component.

Returns: the owner component

getPreferredSize

public Dimension getPreferredSize()

getSelectedItemsCount

public int getSelectedItemsCount()
Gets the number of the selected items.

Returns: number of selected items

processItemClicked

public void processItemClicked()
Processes click on the pop up menu item.

remove

public void remove(DropDownComponent.ScrollablePopupMenuItem menuItem, int oldSize, int newSize)
Removes the item from this component.

Parameters: menuItem the item to remove

selectionChanged

public void selectionChanged(DropDownComponent.ScrollablePopupMenuItem targetItem, boolean wasSelected)
Invoked when item selection changes.

setModel

public void setModel(DropDownComponent.ScrollablePopupMenuModel model)
Sets the ScrollablePopupMenuModel.

Parameters: model the model to set

showMenu

public void showMenu(Component invoker, Component refComponent)
Shows this popup menu.

Parameters: invoker The popup menu invoker component refComponent The dropdown component that containts this menu

Copyright B) 2008 Apache Software Foundation. All Rights Reserved.