home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 1.5 KB | 75 lines |
- // LeafMap.java
- // 23.02.96
- //
- // a map with no children, displayed by highlighting a box on its parent
-
- package cybcerone.orient;
-
- import java.awt.Image;
- import java.util.Vector;
-
- /**
- * A map with no children, but has its own photos and description.
- */
- public class LeafMap implements Maplike {
-
- private String name;
- private String parent;
- private String description;
-
- private Image[] photos;
-
- private Maplikes theMaps;
-
- public LeafMap (String name, String parent, String description,
- Vector photos) {
- if (photos != null) {
- this.photos = new Image[photos.size ()];
- photos.copyInto (this.photos);
- } else
- this.photos = null;
-
- this.name = name;
- this.parent = parent;
- this.description = description;
- }
-
- public String getName () { return name; }
-
- public Image getMap () {
- return (getParent().getMap());
- }
-
- public Image getLegend () {
- return (getParent().getLegend());
- }
-
- public String getDesc () { return description; }
-
- public Image[] getPhotos () { return photos; }
-
- public Maplike getParent () {
- if (theMaps != null)
- return (theMaps.findMap (parent));
- else
- return null;
- }
-
- public Zone find (String name) {
- return (getParent().find (name));
- }
-
- public Zone find (int x, int y) {
- return (getParent().find (x, y));
- }
-
- public void setMaplikes (Maplikes theMaps) {
- this.theMaps = theMaps;
- }
-
- public String toString () {
- return ("LeafMap[" + getName () + "]");
- }
-
- }
-