Java Reference
In-Depth Information
A set of layers overlapping the same image form a cartographic map that
is represented by the entity CartographicMap . It has one basic property:
Persistence : the association between the image and the overlapping layers
is saved in persistent storage.
Finally, entity Editor represents the graphical editor to build cartographic
maps. It is a standalone application made up of a graphical user interface
that maps user events to actions on the cartographic entities defined above.
15.4.2
Design
Entities MapSite , MapLink and MapArea share the same functionalities and
differ only in their geometric representation. Thus, we decide to introduce
class MapEntity that is the abstract superclass of all the three cartographic
entities. This generalization enables the exploitation of polymorphism more
than reuse of data structures which are specific for every subclass. Common
methods will be defined in class MapEntity . Some of them need to be
implemented in every subclass.
Decision point
How is entity visibility handled?
The user can select which types of geographic entity are visible in a carto-
graphic map. For example, one may select only sites and links, while areas
remain hidden. We have two possibilities for managing entity visibility. The
first solution consists in defining attribute visible in class MapEntity . When the
user wants to set an entity type visible, the attribute visible of all the instances
of that entity type in all the visible layers is set to true . The second solution
consists in grouping entities according to their type. Thus, each layer is made
up of three sets of entities, one for sites, one for links and one for areas. In
order to make a given type of entity visible or hidden, only the visibility
attribute of the corresponding entity set needs to be set to true or false. This
solution improves the performance of the graphical editor and of the other
two GIS tools. It requires the introduction of the new class MapEntitySet .
Figure 15.3 represents the class diagram of the GIS cartographic model. It
includes classes MapLayer and CartographicMap , which correspond to the
entities identified in the previous section. In particular, it shows that a
cartographic map has a reference to an Image object and is made up of a
collection of map layers that overlap the map image. Each map layer is made
up of a collection of map entities.
Decision point
How is entity selection handled?
 
Search WWH ::




Custom Search