Class Map.View

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
PrivateMap.View
Enclosing class:
Map

public static class Map.View extends JPanel
The (JPanel-extending) component that represents the map itself
See Also:
  • Field Details

    • map

      protected Map map
  • Constructor Details

    • View

      public View(Map m)
      Create our view
      Parameters:
      m - lets us know what Map we represent
  • Method Details

    • paint

      public void paint(Graphics g)
      Draw our graphics to the graphics object
      Overrides:
      paint in class JComponent
      Parameters:
      g - target graphics object
    • update

      public void update(Graphics g)
      Update our panel (by painting it)
      Overrides:
      update in class JComponent
      Parameters:
      g - target graphics object
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
      Returns:
      our preferred size will be that of the map.
    • getMap

      public Map getMap()
      returns the map we're assigned to