home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / unuy2wen / cybcerone / orient / buildinglevelmap.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  1.6 KB  |  62 lines

  1. // BuildingLevelMap.java
  2. // 23.02.96
  3. //
  4. // a map of one floor in a building
  5.  
  6. package cybcerone.orient;
  7.  
  8. import java.awt.Image;
  9.  
  10. /**
  11.  * One level in a building.  Photos, legend, desc, and all that are stored
  12.  * in the parent (essentially the default level).
  13.  */
  14. public class BuildingLevelMap implements Maplike {
  15.  
  16.   private String name;
  17.   private String parent;
  18.   private Image map;
  19.   private Zones children;
  20.   private Zones clickableZones;
  21.  
  22.   private Maplikes theMaps;
  23.  
  24.   public BuildingLevelMap (String name, String parent, Image map,
  25.                Zones children, Zones clickableZones) {
  26.     this.name = name;
  27.     this.parent = parent;
  28.     this.map = map;
  29.     this.children = children;
  30.     this.clickableZones = clickableZones;
  31.   }
  32.  
  33.   public String getName () { return name; }
  34.   public Image getMap () { return map; }
  35.   public Image getLegend () { return (getParent().getLegend()); }
  36.   public String getDesc () { return (getParent().getDesc()); }
  37.   public Image[] getPhotos () { return (getParent().getPhotos()); }
  38.   public Maplike getParent () { return (theMaps.findMap (parent)); }
  39.   
  40.   public void setMaplikes (Maplikes theMaps) {
  41.     this.theMaps = theMaps;
  42.   }
  43.  
  44.   public Zone find (String name) {
  45.     Zone theZone = children.which (name);
  46.     if (theZone == null)
  47.       theZone = clickableZones.which (name);
  48.     return theZone;
  49.   }
  50.  
  51.   public Zone find (int x, int y) {
  52.     Zone theZone = children.which (x, y);
  53.     if (theZone == null)
  54.       theZone = clickableZones.which (x, y);
  55.     return theZone;
  56.   }
  57.   
  58.   public String toString () {
  59.     return ("BuildingLevelMap[" + getName () + "]");
  60.   }
  61. }
  62.