|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.gridworld.gui.MenuMaker<T>
public class MenuMaker<T>
Makes the menus for constructing new occupants and grids, and for invoking
methods on existing occupants.
This code is not tested on the AP CS A and AB exams. It contains GUI
implementation details that are not intended to be understood by AP CS
students.
| Constructor Summary | |
|---|---|
MenuMaker(WorldFrame<T> parent,
java.util.ResourceBundle resources,
DisplayMap displayMap)
Constructs a menu maker for a given world. |
|
| Method Summary | |
|---|---|
void |
addConstructors(javax.swing.JMenu menu,
java.util.Collection<java.lang.Class> classes)
Adds menu items that call all public constructors of a collection of classes to a menu |
javax.swing.JPopupMenu |
makeConstructorMenu(java.util.Collection<java.lang.Class> classes,
Location loc)
Makes a menu that displays all public constructors of a collection of classes. |
javax.swing.JPopupMenu |
makeMethodMenu(T occupant,
Location loc)
Makes a menu that displays all public methods of an object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MenuMaker(WorldFrame<T> parent,
java.util.ResourceBundle resources,
DisplayMap displayMap)
parent - the frame in which the world is displayedresources - the resource bundledisplayMap - the display map| Method Detail |
|---|
public javax.swing.JPopupMenu makeMethodMenu(T occupant,
Location loc)
occupant - the object whose methods should be displayedloc - the location of the occupant
public javax.swing.JPopupMenu makeConstructorMenu(java.util.Collection<java.lang.Class> classes,
Location loc)
classes - the classes whose constructors should be displayedloc - the location of the occupant to be constructed
public void addConstructors(javax.swing.JMenu menu,
java.util.Collection<java.lang.Class> classes)
menu - the menu to which the items should be addedclasses - the collection of classes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||