|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.event.MouseAdapter
ptolemy.vergil.tree.PTreeMenuCreator
public class PTreeMenuCreator
A mouse listener that creates context menus for a PTree using menu item factories. When asked to create a context menu, This class determines the ptolemy object associated with the point in the tree that was clicked on. Then it passes the ptolemy object to each menu item factory that it contains to add the menu items. Lastly, it pops up the resulting menu.
Red (johnr) |
Red (eal) |
Field Summary | |
---|---|
private java.util.List |
_factoryList
The menu item factories. |
Constructor Summary | |
---|---|
PTreeMenuCreator()
Create a new menu factory that contains no menu item factories. |
Method Summary | |
---|---|
private void |
_doEvent(java.awt.event.MouseEvent e)
Process a mousePressed or mouseReleased event. |
void |
addMenuItemFactory(MenuItemFactory factory)
Add a menu item factory to this creator. |
java.util.List |
menuItemFactoryList()
Return the list of menu item factories. |
void |
mousePressed(java.awt.event.MouseEvent e)
Create an instance of the menu associated with this factory. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Create an instance of the menu associated with this factory. |
void |
removeMenuItemFactory(MenuItemFactory factory)
Remove the given menu item factory from the factory list. |
Methods inherited from class java.awt.event.MouseAdapter |
---|
mouseClicked, mouseEntered, mouseExited |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.List _factoryList
Constructor Detail |
---|
public PTreeMenuCreator()
Method Detail |
---|
public void addMenuItemFactory(MenuItemFactory factory)
factory
- The menu item factory to add.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class java.awt.event.MouseAdapter
e
- The mouse event. If the mouse event is
a popup event, then menu is created and shown.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class java.awt.event.MouseAdapter
e
- The mouse event. If the mouse event is
a popup event, then menu is created and shown.public java.util.List menuItemFactoryList()
public void removeMenuItemFactory(MenuItemFactory factory)
factory
- The factory to be removed.private void _doEvent(java.awt.event.MouseEvent e)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |