org.placelab.demo.mapview
Class ReticleOverlay

java.lang.Object
  extended byorg.placelab.demo.mapview.MapViewOverlay
      extended byorg.placelab.demo.mapview.ReticleOverlay
All Implemented Interfaces:
EstimateListener

public class ReticleOverlay
extends MapViewOverlay
implements EstimateListener

Implements the reticle that tracks movement on the mapviews by listening to updates from placelab.


Field Summary
 boolean autoscroll
           
 FilteredEstimateListener estimateListener
           
static int[] reticleColors
           
protected  GlyphReticle[] reticles
           
 Tracker tracker
           
 
Fields inherited from class org.placelab.demo.mapview.MapViewOverlay
FILTER_TIME, glyphs, holder, isVisible, view
 
Constructor Summary
ReticleOverlay(MapView view, PlacelabWithProxy daemon)
           
ReticleOverlay(MapView view, Tracker tracker)
           
 
Method Summary
 void estimateUpdated(Tracker t, Estimate est, Measurement m)
          Implement this method to respond to updates from the Tracker(s) you are registered with.
 boolean getDrawConfidence()
           
 java.lang.String getName()
          Returns the name that is displayed in menus and so forth referring to this overlay.
 org.eclipse.swt.graphics.Rectangle getSuggestedArea()
          If your overlay has an area that it would like to keep onscreen if possible, then you can return that here.
 Glyph getTopGlyph()
          Returns the top glyph in this overlay
 void mapChanged(MapBacking map)
          When the mapview has its maps switched, this callback is given to allow the overlay to update its data for the new map.
 void mapZoomed(double zoom)
          When the mapview is zoomed, this callback is given to allow you to update your overlay.
 void plotReticle(Tracker t, Estimate est, int reticleIdx)
           
 void setAutoScroll(boolean scroll)
           
 void setDaemon(PlacelabWithProxy daemon)
           
 void setDrawConfidence(boolean flag)
           
 void setTracker(Tracker _tracker)
           
 void updateReticle(int idx, int x, int y, int radius)
           
 
Methods inherited from class org.placelab.demo.mapview.MapViewOverlay
dispose, isVisible, moveAbove, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reticles

protected GlyphReticle[] reticles

reticleColors

public static int[] reticleColors

autoscroll

public boolean autoscroll

tracker

public Tracker tracker

estimateListener

public FilteredEstimateListener estimateListener
Constructor Detail

ReticleOverlay

public ReticleOverlay(MapView view,
                      PlacelabWithProxy daemon)

ReticleOverlay

public ReticleOverlay(MapView view,
                      Tracker tracker)
Method Detail

setTracker

public void setTracker(Tracker _tracker)

setDaemon

public void setDaemon(PlacelabWithProxy daemon)

setAutoScroll

public void setAutoScroll(boolean scroll)

mapChanged

public void mapChanged(MapBacking map)
Description copied from class: MapViewOverlay
When the mapview has its maps switched, this callback is given to allow the overlay to update its data for the new map.

Specified by:
mapChanged in class MapViewOverlay

mapZoomed

public void mapZoomed(double zoom)
Description copied from class: MapViewOverlay
When the mapview is zoomed, this callback is given to allow you to update your overlay. Generally you shouldn't need to do anything here because your glyphs will automatically resize and point translate for the zoom.

Overrides:
mapZoomed in class MapViewOverlay

getName

public java.lang.String getName()
Description copied from class: MapViewOverlay
Returns the name that is displayed in menus and so forth referring to this overlay. In this way, applications using mapviews can build menus that allow toggling of overlays in a generic fashion.

Specified by:
getName in class MapViewOverlay

estimateUpdated

public void estimateUpdated(Tracker t,
                            Estimate est,
                            Measurement m)
Description copied from interface: EstimateListener
Implement this method to respond to updates from the Tracker(s) you are registered with.

Specified by:
estimateUpdated in interface EstimateListener
Parameters:
t - the Tracker producing the Estimate
est - the Estimate produced by the Tracker
m - the latest Measurement used by the Tracker to produce the Estimate

plotReticle

public void plotReticle(Tracker t,
                        Estimate est,
                        int reticleIdx)

updateReticle

public void updateReticle(int idx,
                          int x,
                          int y,
                          int radius)

setDrawConfidence

public void setDrawConfidence(boolean flag)

getDrawConfidence

public boolean getDrawConfidence()

getSuggestedArea

public org.eclipse.swt.graphics.Rectangle getSuggestedArea()
Description copied from class: MapViewOverlay
If your overlay has an area that it would like to keep onscreen if possible, then you can return that here. If not, just return null. The mapview may use this information to do autoscrolling.

Overrides:
getSuggestedArea in class MapViewOverlay

getTopGlyph

public Glyph getTopGlyph()
Description copied from class: MapViewOverlay
Returns the top glyph in this overlay

Specified by:
getTopGlyph in class MapViewOverlay