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.
-
JDPPopupMenu(JDPUser, Panel)
- Creates a Popup Menu.
-
JDPPopupMenu(JDPUser, Panel, JDPPopupMenu, int)
- Creates a Popup Menu.
-
addEntry(String)
- Add and item to this popup menu.
-
addEntry(String[])
- Add and item to this popup menu.
-
clear()
- Remove all the options from the menu.
-
display(int, int)
- Show the popup menu at the requested co-ordinates.
-
getCurrentMenuLvl()
- Get the level of the current branch.
-
getMenuTree()
- Get the JDPTreeBranch that represents this popup menu.
-
getSelectedBranch()
- Get the array for the selected branch of the menu.
-
getSelectedMenu(int)
- Get the name of the current branch at the selected level of the popup menu.
-
handleEvent(Event)
-
-
hideMenu()
- Hide the popup menu.
-
hideUpperMenu()
- Hide the upper part of the popup menu.
-
layout()
-
-
paint(Graphics)
-
-
resetSelections(JDPTreeBranch)
- Reset the selected branch in the popup menu
-
setMenuTree(JDPTreeBranch)
- Set the JDPTreeBranch that represents this popup menu.
-
update(Graphics)
-
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.
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.
clear
public void clear()
- Remove all the options from the menu.
getMenuTree
public JDPTreeBranch getMenuTree()
- Get the JDPTreeBranch that represents this popup menu.
- Returns:
- the tree branch for this menu.
setMenuTree
public void setMenuTree(JDPTreeBranch tree)
- Set the JDPTreeBranch that represents this popup menu.
- Parameters:
- menuTree - the tree branch for this menu.
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.
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.
hideMenu
public void hideMenu()
- Hide the popup menu.
hideUpperMenu
public void hideUpperMenu()
- Hide the upper part of the popup menu.
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.
layout
public void layout()
- Overrides:
- layout in class Container
paint
public void paint(Graphics g)
- Overrides:
- paint in class Container
update
public void update(Graphics g)
- Overrides:
- update in class Component
getSelectedBranch
public String[] getSelectedBranch()
- Get the array for the selected branch of the menu.
- Returns:
- the array for the selected branch of the menu.
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.
getCurrentMenuLvl
public int getCurrentMenuLvl()
- Get the level of the current branch.
- Returns:
- the currently selected level.
handleEvent
public boolean handleEvent(Event evt)
- Overrides:
- handleEvent in class Component
resetSelections
public void resetSelections(JDPTreeBranch branch)
- Reset the selected branch in the popup menu