org.placelab.demo.mapview
Class MapViewOverlay

java.lang.Object
  extended byorg.placelab.demo.mapview.MapViewOverlay
Direct Known Subclasses:
APOverlay, ParticleFilterOverlay, RegionOverlay, ReticleOverlay

public abstract class MapViewOverlay
extends java.lang.Object

A MapViewOverlay exists to group a set of glyphs that are displayed over a MapView. Specifics of the drawing and updating of those glyphs are left to implementers.


Field Summary
static long FILTER_TIME
           
protected  java.util.Vector glyphs
          when you create a new glyph, add it here
 GlyphHolder holder
           
protected  boolean isVisible
           
 MapView view
           
 
Constructor Summary
MapViewOverlay(MapView view)
          Creates a new overlay for the given mapview, and registers the overlay with the mapview.
 
Method Summary
 void dispose()
           
abstract  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.
abstract  Glyph getTopGlyph()
          Returns the top glyph in this overlay
 boolean isVisible()
           
abstract  void mapChanged(MapBacking newMap)
          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 newZoom)
          When the mapview is zoomed, this callback is given to allow you to update your overlay.
 void moveAbove(Glyph below)
          MapViewOverlays are layered in the order that they are added to the mapview.
 void setVisible(boolean visible)
          Sets whether or not the overlay ought to be shown on the mapview.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

view

public MapView view

holder

public GlyphHolder holder

isVisible

protected boolean isVisible

glyphs

protected java.util.Vector glyphs
when you create a new glyph, add it here


FILTER_TIME

public static final long FILTER_TIME
See Also:
Constant Field Values
Constructor Detail

MapViewOverlay

public MapViewOverlay(MapView view)
Creates a new overlay for the given mapview, and registers the overlay with the mapview.

Method Detail

setVisible

public void setVisible(boolean visible)
Sets whether or not the overlay ought to be shown on the mapview.


isVisible

public boolean isVisible()

mapChanged

public abstract void mapChanged(MapBacking newMap)
When the mapview has its maps switched, this callback is given to allow the overlay to update its data for the new map.


mapZoomed

public void mapZoomed(double newZoom)
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.


getSuggestedArea

public 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. If not, just return null. The mapview may use this information to do autoscrolling.


moveAbove

public void moveAbove(Glyph below)
MapViewOverlays are layered in the order that they are added to the mapview. For this order to be maintained a MapViewOverlay may be requested to move its glyphs above the argument. When you create a new set of glyphs in your MapViewOverlay you are requested to notify the view with the top of them by sending overlayHasNewTopGlyph(this)


getTopGlyph

public abstract Glyph getTopGlyph()
Returns the top glyph in this overlay


getName

public abstract java.lang.String getName()
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.


dispose

public void dispose()