<MAP> : Map

Java class : leon.view.LyMap

ROLE

A map allows displaying any type of map view: maps representing geographic or synoptic areas, displaying of elements with different types of positioning, displaying of nodes, links, images, etc. There are four types of elements that can be placed on a map: the nodes, the links, the regions and the images.
The elements placed on a map can be sensitive or not (except the images that can never be sensitive).
It is possible to specify for the nodes and the links the layer on which they are.
This layer allows to place the elements of a higher layer over the elements of a lower layer (for example, the elements of the layer 2 are placed over the elements of the layer 1). The nodes allow defining elements that can be placed at any location on the map and that can be moved.
By using a special positioning manager, it is possible to place these nodes according to a predefined geometry (matrix, circle, ellipse, line,...).
When zooming on the map, a node keeps always the same aspect unlike an element of image type. The links allow defining segments between two nodes of the map.
If one of the two nodes defining the link is moved, the link follows the moved node so that it always starts from its source node and that it always arrives to its destination node. The regions allow representing geometric areas defined by a discrete set of points.
These areas can be sensitive.
It is notably possible to lead to other map views when launching an action over one of these regions. It is possible to define the background that will be used for the map (defined by an image), the selection mode (none, simple or multiple), the visualization mode (through a viewer or with scroll bars) and to specify if the map is in two or three dimensions. The possible movements on a map are translations, zooms (forward/backward) and rotations.
A map in three dimensions allows spatial rotations enabling to display the regions in three dimensions.
A map in two dimensions allows the axial rotations around the center of the map.

ATTRIBUTES

<!ATTLIST MAP
	  id NMTOKEN #IMPLIED
	  template NMTOKEN #IMPLIED
	  label CDATA #IMPLIED
	  controller CDATA #IMPLIED
	  selectionMode ( NONE | SINGLE | MULTIPLE) "MULTIPLE"
	  selectionDraw ( FILL | BORDER) "FILL"
	  viewer ( true | false) "true"
	  viewerStatus ( SHOW | HIDE) "SHOW"
	  viewerX NMTOKEN #IMPLIED
	  viewerY NMTOKEN #IMPLIED
	  zoom ( true | false) "true"
	  zoomStatus ( SHOW | HIDE) "SHOW"
	  zoomStep NMTOKEN #IMPLIED
	  zoomFactor NMTOKEN #IMPLIED
	  translation ( true | false) "true"
	  translationStep NMTOKEN #IMPLIED
	  translationStatus ( SHOW | HIDE) "SHOW"
	  spatial ( true | false) "false"
	  background CDATA #IMPLIED
	  titleFont CDATA #IMPLIED
	  color CDATA #IMPLIED
	  fontColor CDATA #IMPLIED
	  selectedColor CDATA #IMPLIED
	  outlineColor CDATA #IMPLIED
	  width NMTOKEN #IMPLIED
	  height NMTOKEN #IMPLIED
	  style ( STANDARD | HYBRID | ROADMAP | SATELLITE | TERRAIN) "STANDARD"
	  latitude NMTOKEN #IMPLIED
	  longitude NMTOKEN #IMPLIED>
Attribute Mand. Description Default
id no Identifier of the map.  
template no MAP.template  
label no Label of the map.  
controller no Reference of the controller that manages the map (i.e. handles user demands and refresh content).  
selectionMode no Selection mode of the elements of the map. The following modes are managed:
NONE: No selection is possible
SINGLE: Selection of only one node at a time
MULTIPLE: Selection of several elements at a time
MULTIPLE
selectionDraw no Draw style for the elements that are selected on the map.
This type allows defining the way the selection of an element of the map is represented. The following types are managed:
FILL: Filled frame style
BORDER: Outlined frame style
FILL
viewer no Visualization mode of the map.
The true value indicates a visualization by using a viewer representing a small-scale.
The viewer allows locating its position and to move on the map.
In the absence of a viewer, the map manages scroll bars.
true
viewerStatus no Status of the viewer in the viewer mode.
The viewer can have the two following statuses:
SHOW: the viewer is shown.
HIDE: the viewer is hidden.
SHOW
viewerX no X position of the viewer in the map. -1
viewerY no Y position of the viewer in the map. -1
zoom no Indicates if the zoom widget must be displayed on the map. true
zoomStatus no Indicates if the zoom widget is visible or hidden. SHOW
zoomStep no Step of the zoom widget (must be greater than 1). 0F
zoomFactor no Current zoom factor of the map. 0F
translation no Indicates if the translation widget must be displayed on the map. true
translationStep no Step of the translation widget. Used by the translation widget to move the map and also by the Struts map component to compute the number of sub-images that must be generated for the map background. -1
translationStatus no Indicates if the translation widget is visible or hidden. SHOW
spatial no Indicates if the map is in three dimensions.
A map in two dimensions manages only the coordinates in abscissa and in ordinate of the elements that it contains.
false
background no Background of the map.
The expected value is the key of an image or else the name of an image.
The pattern representing this image is repeated in order to recover the whole visible part of the map.
All the elements that are available on the map are displayed over this background.
 
titleFont no Font of the map title.  
color no MAP.color  
fontColor no MAP.fontColor  
selectedColor no Selection color used when nodes or links are selected within the map.  
outlineColor no Color used for outline.  
width no Width of the map component. -1
height no Height of the map component. -1
style no Style of the map component. STANDARD
latitude no Latitude of the map component.  
longitude no Longitude of the map component.  

ELEMENTS

<!ELEMENT MAP 
	  ((MAP_NODE | MAP_LINK | MAP_REGION)*,
	   MAP_CONTENT?,
	   LAYOUT?,
	   CONSTRAINT?,
	   DATA*)>
Element Mand. Mult. Description
MAP_NODE yes no Nodes of the map.
MAP_LINK yes no Links of the map.
MAP_REGION yes no Regions of the map.
MAP_CONTENT no no Additional elements of the map.
These elements represent the static part of the elements of the map.
They are not intended to evolve dynamically when the map is used.
Generally, these elements are defined in a file that is associated to the action used to display the map.
LAYOUT no no Layout manager of the map.
CONSTRAINT no no Positioning constraint of the map.
DATA no yes MAP.DATA

SAMPLE 1

<!-- Map with an image and 3 nodes representing towns, linked with links -->
<MAP id="map_geo" spatial='false' viewer='true'>
	<MAP_NODE image='france.gif' sensitive='false'/>
	<MAP_NODE id="a" label="Paris" x="20" y="-100" style='IMAGE'
			labelAlign='TOP' image="LY_ALARM_ANIM"/>
	<MAP_NODE id="b" label="Bordeaux" x="0" y="0" style='IMAGE'
			labelAlign='LEFT'/>
	<MAP_NODE id="c" label="Marseille" x="140" y="170" style='IMAGE' 		
		labelAlign='BOTTOM' selected='true'/>
	<MAP_LINK label="link1" startNode="a" endNode="b"
			imageStart="LY_ACTION_DELETE" style='TUBE' arrow='BOTH'
			width='20' color='LY_TREENODE_FONT_COLOR'/>
	<MAP_LINK label="link2" startNode="b" endNode="c"
			imageMiddle="LY_ALARM_ANIM" style='TUBE' arrow='BOTH'
			width='10' color='LY_TREENODE_SELECTED_BG_COLOR'/>
	<MAP_LINK label="link3" startNode="a" endNode="c"
			imageMiddle="LY_ALARM_ANIM" style='LINE' arrow='BOTH'
			width='10' double='false' color='LY_HREF_VISITED'
			colorEnd='LY_HREF_VISITED'/>
</MAP>

SAMPLE 2

<!-- Map with 6 nodes and using a matrix positioning -->
<MAP id="map_matrix" spatial='true' viewer='false'>
	<MAP_NODE id="a3" label="NA" style='CIRCLE' labelAlign='BOTTOM'/>
	<MAP_NODE id="b3" label="NB" style='SQUARE' labelAlign='BOTTOM'/>
	<MAP_NODE id="c3" label="NC" style='TRIANGLE' labelAlign='BOTTOM'/>
	<MAP_NODE id="d3" label="ND" style='IMAGE' labelAlign='BOTTOM'/>
	<MAP_NODE id="e3" label="NE" style='CIRCLE' labelAlign='BOTTOM'/>
	<MAP_NODE id="f3" label="NF" style='CIRCLE' labelAlign='BOTTOM'/>
	<LAYOUT style='MATRIX' hAlign='LEFT' vAlign='TOP' deltaNode="30"
		deltaBorder="50"/>
</MAP>