public class MapGroup extends java.lang.Object implements MapChangeListener
Modifier and Type | Field and Description |
---|---|
java.util.Vector<MapChangeListener> |
listeners |
java.util.Hashtable<java.lang.String,MapType> |
maps |
protected MissionType |
mission |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(MapChangeListener listener)
Adds a MapChangeListener to the current list of listeners
All these listeners will be warned whenever a object in any f the current maps
is changed, removed or added.
|
void |
addMap(MapType map)
Adds a Map to this group
|
static boolean |
containsInstance(java.lang.String id)
Verifies if currently exists an instance relative to the given mission id.
|
AbstractElement |
findObject(java.lang.String objID) |
AbstractElement[] |
getAllObjects()
This method fetches the objects from all maps and returns them as an array
It's very useful for displaying the objects from various maps
|
<T> java.util.Vector<T> |
getAllObjectsOfType(java.lang.Class<T> type) |
CoordinateSystem |
getCoordinateSystem() |
HomeReferenceElement |
getHomeRef() |
pt.lsts.imc.IMCMessage |
getIMCSerialization(java.lang.String mapId) |
MapType |
getMapByID(java.lang.String mapID)
Given a MapID, returns the Map identified
|
static MapGroup |
getMapGroupInstance(MissionType mt)
This method will return (possibly creating a new one) the MapGroup related to the given mission
|
AbstractElement |
getMapObject(java.lang.String objID)
Returns a map object given its string representation:
A String representation of an object is [mapID]:[objID]
|
AbstractElement[] |
getMapObjectsByID(java.lang.String objID) |
MapType[] |
getMaps() |
MissionType |
getMission() |
static MapGroup |
getNewInstance(CoordinateSystem cs) |
AbstractElement[][] |
getObjectsByLayers() |
AbstractElement[] |
getObjectsFromMap(java.lang.String mapID) |
AbstractElement[] |
getObjectsFromOtherMaps(java.lang.String mapID) |
java.util.Vector<AbstractElement> |
getObstacles() |
MapType |
getPivotMap() |
void |
mapChanged(MapChangeEvent changeEvent)
If any of its maps has changed, warn all the listeners of this map group
|
int |
numObjects() |
void |
removeChangeListener(MapChangeListener listener)
Removes the given MapChangeListener from the current list of listeners
|
void |
removeMap(java.lang.String mapID)
Removes the given map from this group
|
static void |
resetMissionInstance(MissionType newMission)
Resets the mission's map group instance
|
void |
setCoordinateSystem(CoordinateSystem cs) |
void |
setHomeRef(HomeReferenceElement homeRef) |
void |
setMap(MapType map)
Deprecated.
|
static MapGroup |
setMissionInstance(java.lang.String id,
MapGroup mg)
This method alters the possibly existing MapGroup instance to be
equal to the given MapGroup.
|
void |
updateObjectIds() |
void |
warnListeners(MapChangeEvent changeEvent)
Warns all the current MapChangeListeners that a change in some object has ocurred
|
public java.util.Hashtable<java.lang.String,MapType> maps
public java.util.Vector<MapChangeListener> listeners
protected MissionType mission
public java.util.Vector<AbstractElement> getObstacles()
public <T> java.util.Vector<T> getAllObjectsOfType(java.lang.Class<T> type)
public static MapGroup getNewInstance(CoordinateSystem cs)
public MapType getPivotMap()
public static MapGroup getMapGroupInstance(MissionType mt)
mt
- A MissionTypepublic static boolean containsInstance(java.lang.String id)
id
- A mission idpublic static void resetMissionInstance(MissionType newMission)
public static MapGroup setMissionInstance(java.lang.String id, MapGroup mg)
id
- mg
- public void addMap(MapType map)
map
- The map to be added to this MapGrouppublic void removeMap(java.lang.String mapID)
mapID
- The map that is to be removed@Deprecated public void setMap(MapType map)
map
- public MapType getMapByID(java.lang.String mapID)
mapID
- A String identifier of the map to returnpublic void mapChanged(MapChangeEvent changeEvent)
mapChanged
in interface MapChangeListener
public AbstractElement getMapObject(java.lang.String objID)
objID
- A String like "mapID":"objID"public AbstractElement findObject(java.lang.String objID)
public void updateObjectIds()
public AbstractElement[] getMapObjectsByID(java.lang.String objID)
public MapType[] getMaps()
public void addChangeListener(MapChangeListener listener)
listener
- public void removeChangeListener(MapChangeListener listener)
listener
- The MapChangeListener that will be removed from the list of listenerspublic void warnListeners(MapChangeEvent changeEvent)
public AbstractElement[] getObjectsFromOtherMaps(java.lang.String mapID)
public AbstractElement[] getObjectsFromMap(java.lang.String mapID)
public AbstractElement[] getAllObjects()
public AbstractElement[][] getObjectsByLayers()
public int numObjects()
public CoordinateSystem getCoordinateSystem()
public void setCoordinateSystem(CoordinateSystem cs)
public HomeReferenceElement getHomeRef()
public void setHomeRef(HomeReferenceElement homeRef)
homeRef
- The homeRef to set.public pt.lsts.imc.IMCMessage getIMCSerialization(java.lang.String mapId)
public MissionType getMission()
Copyright © 2004-2020 FEUP-LSTS and Neptus developers. All Rights Reserved.