twaver.gis
Class GisNetworkAdapter

java.lang.Object
  extended bytwaver.gis.GisNetworkAdapter

public class GisNetworkAdapter
extends java.lang.Object

This class helps wrap a TNetowrk object(network) with a geographical map. After installAdapter() is invoked, all the TWaver elements stored in network's databox can be located by their geographical coordinate automatically.


Constructor Summary
GisNetworkAdapter(twaver.network.TNetwork network)
          Constructs a GisNetworkAdapter instance, which will be used to wrap a TNetwork object.
 
Method Summary
 void enableVoronoiGraphVisible(boolean isVisible)
           
 GeographyMap getMap()
          Gets the map used as the background of the network.
 VoronoiDiagram getVoronoiDiagram()
           
 void installAdapter()
          Wraps the network by setting a map as the background of the network and setting the mechanism used to synchronize the topological data and the geographical data.
 boolean isVoronoiGraphVisible()
           
 boolean isZoomInByDoubleClick()
           
 void reLocateElements()
           
 void setLocateWithFilter(boolean v)
           
 void setVoronoiDiagram(VoronoiDiagram diagram)
          Assigns the VoronoiDiagram object to the adapter.
 void setVoronoiElementFilter(VoronoiElementFilter filter)
          Assigns a new VoronoiElementFilter object to the adapter.
 void setVoronoiGraphBoundsShapeGenerator(twaver.Generator gengerator)
          Assigns a new Generator object which is used to create the bounds shape of the voronoi diagram to the adapter.
 void setZoomInByDoubleClick(boolean zoomInByDoubleClick)
           
 void unInstallAdapter()
          UnWraps the network.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GisNetworkAdapter

public GisNetworkAdapter(twaver.network.TNetwork network)
Constructs a GisNetworkAdapter instance, which will be used to wrap a TNetwork object.

Parameters:
network - the target TNetwork object.
Method Detail

enableVoronoiGraphVisible

public void enableVoronoiGraphVisible(boolean isVisible)

getMap

public GeographyMap getMap()
Gets the map used as the background of the network.

Returns:
the map object used as the background

getVoronoiDiagram

public VoronoiDiagram getVoronoiDiagram()

installAdapter

public void installAdapter()
Wraps the network by setting a map as the background of the network and setting the mechanism used to synchronize the topological data and the geographical data.


isVoronoiGraphVisible

public boolean isVoronoiGraphVisible()

isZoomInByDoubleClick

public boolean isZoomInByDoubleClick()

reLocateElements

public void reLocateElements()

setLocateWithFilter

public void setLocateWithFilter(boolean v)

setVoronoiDiagram

public void setVoronoiDiagram(VoronoiDiagram diagram)
Assigns the VoronoiDiagram object to the adapter.

Parameters:
diagram - the specified VoronoiDiagram object.

setVoronoiElementFilter

public void setVoronoiElementFilter(VoronoiElementFilter filter)
Assigns a new VoronoiElementFilter object to the adapter.

Parameters:
filter - the specified VoronoiElementFilter.

setVoronoiGraphBoundsShapeGenerator

public void setVoronoiGraphBoundsShapeGenerator(twaver.Generator gengerator)
Assigns a new Generator object which is used to create the bounds shape of the voronoi diagram to the adapter. The Generator object should return a Shape object.

Parameters:
gengerator - a new Generator} object.

setZoomInByDoubleClick

public void setZoomInByDoubleClick(boolean zoomInByDoubleClick)

unInstallAdapter

public void unInstallAdapter()
UnWraps the network. Removes the map and some event listeners from the network.