ix.ip2.map
Class WorldStateLayer

java.lang.Object
  |
  +--OMGraphicHandlerLayer
        |
        +--ix.ip2.map.WorldStateLayer

public class WorldStateLayer
extends OMGraphicHandlerLayer

Class that creates a new layer based on the I-X state format. Objects to appear in this layer need to have two attributes at least: latitude and longitude.

See Also:
Serialized Form

Field Summary
protected  StateViewer sv
           
 
Constructor Summary
WorldStateLayer(StateViewer sv)
          The default constructor for the layer.
 
Method Summary
 void addPatternValue(LList pattern, java.lang.Object value)
          Adds a pattern-value pair.
static java.lang.String addTilde(java.lang.Object property)
          Method auxiliar to put a tilde in the place of the.
 void changePatternValue(LList pattern, java.lang.Object value)
          Changes a pattern-value pair.
 void deletePatternValue(LList pattern, java.lang.Object value)
          Deletes a pattern-value pair.
 OMGraphicList getList()
          Overriding the OMGraphicHandlerMethod, creating a list if it's null.
 MapMouseListener getMapMouseListener()
           
 java.lang.String[] getMouseModeServiceList()
           
 void loadObjectImage(java.lang.Object name, java.util.Hashtable wObject)
          Loads a gif image to represent an object.
 boolean mouseClicked(java.awt.event.MouseEvent e)
           
 boolean mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved()
           
 boolean mouseMoved(java.awt.event.MouseEvent e)
           
 boolean mousePressed(java.awt.event.MouseEvent e)
           
 boolean mouseReleased(java.awt.event.MouseEvent e)
           
 void projectionChanged(com.bbn.openmap.event.ProjectionEvent pe)
          Method from the ProjectionListener interface.
 void refresh()
          Resets the map and replace the objects.
 void reset()
          Clears both the list of graphic objects and the hashtable that contains the objects of the environment
static LList returnPattern(java.lang.Object property, java.lang.Object object)
          Method auxiliar to put a object in the correct place inside the pattern format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sv

protected StateViewer sv
Constructor Detail

WorldStateLayer

public WorldStateLayer(StateViewer sv)
The default constructor for the layer. It starts a list of graphic objects that will be placed on the map, and a hashtable that keeps all the objects that appear or not on the map.

Method Detail

reset

public void reset()
Clears both the list of graphic objects and the hashtable that contains the objects of the environment


addPatternValue

public void addPatternValue(LList pattern,
                            java.lang.Object value)
Adds a pattern-value pair. If the object does not exist, it will be created. If the pattern contains a latitude or longitude property, a special method that manipulates the location of the object on the map is called.


changePatternValue

public void changePatternValue(LList pattern,
                               java.lang.Object value)
Changes a pattern-value pair. There are three special cases when the pattern contains a latitude, a longitude or a type.


deletePatternValue

public void deletePatternValue(LList pattern,
                               java.lang.Object value)
Deletes a pattern-value pair. If a pattern that constains a latitude or longitude property is deleted, the object is removed of the map. If the type pattern is deleted, the gif that represents the object will be changed (in general).


projectionChanged

public void projectionChanged(com.bbn.openmap.event.ProjectionEvent pe)
Method from the ProjectionListener interface.


getList

public OMGraphicList getList()
Overriding the OMGraphicHandlerMethod, creating a list if it's null.


loadObjectImage

public void loadObjectImage(java.lang.Object name,
                            java.util.Hashtable wObject)
Loads a gif image to represent an object. The condition is that the object has a position (latitude and longitude). The relation object/icon follows the algorithm below:

IF there is an icon in the directory specified in "map-object-icons" parameter with the same name of the object (without the extension .gif), this icon will be used. ELSE IF the object has a type pattern (e.g. Buckingham.type=palace) AND there is an icon in the directory specified in "map-object-icons" parameter with the same name of the type value (in the example, palace), this icon will be used. ELSE IF the "map-default-icon" parameter was specified, the related icon will be used. ELSE the system will use its default icon.


getMouseModeServiceList

public java.lang.String[] getMouseModeServiceList()

mouseMoved

public void mouseMoved()

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)

mouseMoved

public boolean mouseMoved(java.awt.event.MouseEvent e)

mouseClicked

public boolean mouseClicked(java.awt.event.MouseEvent e)

mousePressed

public boolean mousePressed(java.awt.event.MouseEvent e)

mouseDragged

public boolean mouseDragged(java.awt.event.MouseEvent e)

mouseReleased

public boolean mouseReleased(java.awt.event.MouseEvent e)

getMapMouseListener

public MapMouseListener getMapMouseListener()

refresh

public void refresh()
Resets the map and replace the objects.


returnPattern

public static LList returnPattern(java.lang.Object property,
                                  java.lang.Object object)
Method auxiliar to put a object in the correct place inside the pattern format.


addTilde

public static java.lang.String addTilde(java.lang.Object property)
Method auxiliar to put a tilde in the place of the. Just to improve the output format.