Class JDPPopupMenu

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----JDPPopupMenu

public class JDPPopupMenu
extends Panel
Class JDPPopupMenu represents a class for displaying a popup menu.


Constructor Index

 o JDPPopupMenu(JDPUser, Panel)
Creates a Popup Menu.
 o JDPPopupMenu(JDPUser, Panel, JDPPopupMenu, int)
Creates a Popup Menu.

Method Index

 o addEntry(String)
Add and item to this popup menu.
 o addEntry(String[])
Add and item to this popup menu.
 o clear()
Remove all the options from the menu.
 o display(int, int)
Show the popup menu at the requested co-ordinates.
 o getCurrentMenuLvl()
Get the level of the current branch.
 o getMenuTree()
Get the JDPTreeBranch that represents this popup menu.
 o getSelectedBranch()
Get the array for the selected branch of the menu.
 o getSelectedMenu(int)
Get the name of the current branch at the selected level of the popup menu.
 o handleEvent(Event)
 o hideMenu()
Hide the popup menu.
 o hideUpperMenu()
Hide the upper part of the popup menu.
 o layout()
 o paint(Graphics)
 o resetSelections(JDPTreeBranch)
Reset the selected branch in the popup menu
 o setMenuTree(JDPTreeBranch)
Set the JDPTreeBranch that represents this popup menu.
 o update(Graphics)

Constructors

 o JDPPopupMenu
 public JDPPopupMenu(JDPUser user,
                     Panel targetPanel)
Creates a Popup Menu.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
targetPanel - the parent panel that this one will be added to.
 o JDPPopupMenu
 public JDPPopupMenu(JDPUser user,
                     Panel targetPanel,
                     JDPPopupMenu parent,
                     int dropindex)
Creates a Popup Menu.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
targetPanel - the parent panel that this one will be added to.
parent - the parent popup menu that this popup menu is attached to.
dropindex - the level that this menu sits at.

Methods

 o clear
 public void clear()
Remove all the options from the menu.

 o getMenuTree
 public JDPTreeBranch getMenuTree()
Get the JDPTreeBranch that represents this popup menu.

Returns:
the tree branch for this menu.
 o setMenuTree
 public void setMenuTree(JDPTreeBranch tree)
Set the JDPTreeBranch that represents this popup menu.

Parameters:
menuTree - the tree branch for this menu.
 o addEntry
 public boolean addEntry(String name)
Add and item to this popup menu.

Parameters:
name - the text value of the new menu option.
Returns:
true if the option already exists.
 o addEntry
 public boolean addEntry(String name[])
Add and item to this popup menu.

Parameters:
name - the array that represents the branches of the new menu option.
Returns:
true if the option already exists.
 o hideMenu
 public void hideMenu()
Hide the popup menu.

 o hideUpperMenu
 public void hideUpperMenu()
Hide the upper part of the popup menu.

 o display
 public void display(int xpos,
                     int ypos)
Show the popup menu at the requested co-ordinates.

Parameters:
xPostion - the x postion to display the menu at.
yPostion - the x postion to display the menu at.
 o layout
 public void layout()
Overrides:
layout in class Container
 o paint
 public void paint(Graphics g)
Overrides:
paint in class Container
 o update
 public void update(Graphics g)
Overrides:
update in class Component
 o getSelectedBranch
 public String[] getSelectedBranch()
Get the array for the selected branch of the menu.

Returns:
the array for the selected branch of the menu.
 o getSelectedMenu
 public String getSelectedMenu(int level)
Get the name of the current branch at the selected level of the popup menu.

Parameters:
level - the requested level.
Returns:
name of the branch at the selected level.
 o getCurrentMenuLvl
 public int getCurrentMenuLvl()
Get the level of the current branch.

Returns:
the currently selected level.
 o handleEvent
 public boolean handleEvent(Event evt)
Overrides:
handleEvent in class Component
 o resetSelections
 public void resetSelections(JDPTreeBranch branch)
Reset the selected branch in the popup menu