info.gridworld.gui
Class DisplayMap

java.lang.Object
  extended by info.gridworld.gui.DisplayMap

public class DisplayMap
extends java.lang.Object

DisplayMap is a collection that maps grid occupant classes to objects that know how to display them.
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
DisplayMap()
           
 
Method Summary
 Display findDisplayFor(java.lang.Class cl)
          Finds a display class that knows how to display the given object.
 javax.swing.Icon getIcon(java.lang.Class cl, int w, int h)
          Gets an icon to display a class in a menu
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayMap

public DisplayMap()
Method Detail

findDisplayFor

public Display findDisplayFor(java.lang.Class cl)
Finds a display class that knows how to display the given object.

Parameters:
cl - the class to display

getIcon

public javax.swing.Icon getIcon(java.lang.Class cl,
                                int w,
                                int h)
Gets an icon to display a class in a menu

Parameters:
cl - the class
w - the icon width
h - the icon height
Returns:
the icon