All Packages Class Hierarchy This Package Previous Next Index
Class edu.cmu.owl.ui.twoD.Map
edu.cmu.owl.ui.twoD.Map
- public class Map
The abstract representation of a map
- Version:
- 5/11/97
Modifications:
Aseem Sharma - We no longer have a list of all the elements
we now have a heirarchy for all objects. The root is a ControlZonewoD.
ControlZoneTwoD implements the recursive composition patern so it could
contain any MapElement object. So we no longer have selectableElements list
we now have to go through the whole heirarchy to get the list of selectable.
-
Map()
-
-
addElement(MapElement)
- Add the given MapElement to this Map.
-
clone()
-
-
elementAt(Point)
- Determine which selectable MapElement resides at the given
point.
-
elements()
- List all the highiest level MapElement's in this Map.
-
groupCalled()
- This method is called when the users want to group the selected elements
into a ControlZoneTwoD.
-
paint(Graphics, PointConverter, ImageObserver)
- Paint each of the elements in this Map, using the given
PointConverter to scale the dimensions of the Map to screen
coordinates.
-
removeElement(MapElement)
- Remove the given MapElement from this Map.
-
setSelected(Vector)
-
-
size()
- The dimensions of this map.
-
ungroupCalled()
- This method is called when he users wants to ungroup the selected
group.
Map
public Map()
clone
public Object clone()
size
public Dimension size()
- The dimensions of this map. Note that the units are in the same
units as the MapElements, and may or may not correspond to screen
pixels.
- Returns:
- size of the map
paint
public void paint(Graphics g,
PointConverter p,
ImageObserver obs)
- Paint each of the elements in this Map, using the given
PointConverter to scale the dimensions of the Map to screen
coordinates.
- Parameters:
- g - the graphics object we will draw on
- p - the object that converts pixels to wall coordinates and vice-versa
addElement
public void addElement(MapElement newElement)
- Add the given MapElement to this Map.
Since this is called by MapBuilder and MapBuilder does not know about
the implementation details of Map,Map actually maps it to parsing the
theElements tree and inserting the newElement as the immediate child of
the root.
- Parameters:
- newElement - the MapElement object that needs to be added to the map
removeElement
public void removeElement(MapElement element)
- Remove the given MapElement from this Map.
- Parameters:
- element - is the MapElement
elements
public Enumeration elements()
- List all the highiest level MapElement's in this Map.
elementAt
public MapElement elementAt(Point where)
- Determine which selectable MapElement resides at the given
point. If multiple MapElements overlap, the one with the
smallest area is returned.
groupCalled
public void groupCalled()
- This method is called when the users want to group the selected elements
into a ControlZoneTwoD.
Right now, the algorithm says only the immediate children of the root can
be grouped. For any other mapelement in the heirarchy, this call is just
ignored.
ungroupCalled
public void ungroupCalled()
- This method is called when he users wants to ungroup the selected
group.
setSelected
public void setSelected(Vector temp)
All Packages Class Hierarchy This Package Previous Next Index