com.partnersoft.v3x.apps.MapBrowser
Class MapGraphicSpecifier

java.lang.Object
  extended by com.partnersoft.v3x.gadgets.SpecifierGadget
      extended by com.partnersoft.v3x.apps.MapBrowser.MapGraphicSpecifier
All Implemented Interfaces:
MapMotionListener, MapMouseListener, Specifier, java.util.EventListener
Direct Known Subclasses:
CombinedMapGraphicSpecifier, JobNodeSpecifier, MapPointSpecifier, RoverGraphicSpecifier

public abstract class MapGraphicSpecifier
extends SpecifierGadget
implements MapMouseListener, MapMotionListener

A specifier for graphical map objects that works from MapMouseEvents in some fashion (some use the pixels, some use the map coordinates). These are designed to hook into MapViewPanels, so an MX toggle and a global on/off toggle control whether selection should happen. Subclasses should simply override the findSelectedObjectAt() method.


Constructor Summary
MapGraphicSpecifier()
           
 
Method Summary
 void disable()
           
 void enable()
           
abstract  java.lang.Object findSelectedObjectAt(Coord3D coords, int pixelX, int pixelY)
          Subclasses must override this to provide the function deriving the selected object from the given coordinates and pixels.
 Toggle getGlobalToggle()
          Toggle switch that controls global selection for a MapViewPanel - if it's off, don't select.
 Specifier getIndicationSpecifier()
           
 boolean getListening()
           
 MapViewPanel getMapViewPanel()
           
 Toggle getMXToggle()
          Toggle switch that controls MX selection for a MapViewPanel so that only one specifier is active at a time - if it's off, don't select.
 java.lang.String indicateObjectAt(Coord3D coords, int pixelX, int pixelY)
          Subclasses must override this to provide the function indicating (generally by hilite) an object from the given coordinates and pixels.
 void mapClicked(MapMouseEvent e)
          Invoked when the mouse has been clicked on a map.
 void mapDragged(MapMouseEvent e)
          Invoked when a mouse button is pressed on a map and then dragged.
 void mapEntered(MapMouseEvent e)
          Invoked when the mouse enters a map.
 void mapExited(MapMouseEvent e)
          Invoked when the mouse exits a map.
 void mapMoved(MapMouseEvent e)
          Invoked when the mouse button has been moved on a map (with no buttons no down).
 void mapPressed(MapMouseEvent e)
          Invoked when a mouse button has been pressed on a map.
 void mapReleased(MapMouseEvent e)
          Invoked when a mouse button has been released on a map.
 void setGlobalToggle(Toggle newToggle)
           
 void setListening(boolean tizit)
           
 void setMapViewPanel(MapViewPanel newView)
           
 void setMXToggle(Toggle newToggle)
           
 
Methods inherited from class com.partnersoft.v3x.gadgets.SpecifierGadget
addSpecificationListener, getSpecified, getSpecifiedClass, removeSpecificationListener, setSpecified, setSpecifiedClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapGraphicSpecifier

public MapGraphicSpecifier()
Method Detail

findSelectedObjectAt

public abstract java.lang.Object findSelectedObjectAt(Coord3D coords,
                                                      int pixelX,
                                                      int pixelY)
Subclasses must override this to provide the function deriving the selected object from the given coordinates and pixels.


indicateObjectAt

public java.lang.String indicateObjectAt(Coord3D coords,
                                         int pixelX,
                                         int pixelY)
Subclasses must override this to provide the function indicating (generally by hilite) an object from the given coordinates and pixels.


mapReleased

public void mapReleased(MapMouseEvent e)
Description copied from interface: MapMouseListener
Invoked when a mouse button has been released on a map.

Specified by:
mapReleased in interface MapMouseListener

mapClicked

public void mapClicked(MapMouseEvent e)
Description copied from interface: MapMouseListener
Invoked when the mouse has been clicked on a map.

Specified by:
mapClicked in interface MapMouseListener

mapPressed

public void mapPressed(MapMouseEvent e)
Description copied from interface: MapMouseListener
Invoked when a mouse button has been pressed on a map.

Specified by:
mapPressed in interface MapMouseListener

mapEntered

public void mapEntered(MapMouseEvent e)
Description copied from interface: MapMouseListener
Invoked when the mouse enters a map.

Specified by:
mapEntered in interface MapMouseListener

mapExited

public void mapExited(MapMouseEvent e)
Description copied from interface: MapMouseListener
Invoked when the mouse exits a map.

Specified by:
mapExited in interface MapMouseListener

mapDragged

public void mapDragged(MapMouseEvent e)
Description copied from interface: MapMotionListener
Invoked when a mouse button is pressed on a map and then dragged. Mouse drag events will continue to be delivered until the mouse button is released (regardless of whether the mouse position is within the bounds of the map).

Specified by:
mapDragged in interface MapMotionListener

mapMoved

public void mapMoved(MapMouseEvent e)
Description copied from interface: MapMotionListener
Invoked when the mouse button has been moved on a map (with no buttons no down).

Specified by:
mapMoved in interface MapMotionListener

getIndicationSpecifier

public Specifier getIndicationSpecifier()

getGlobalToggle

public Toggle getGlobalToggle()
Toggle switch that controls global selection for a MapViewPanel - if it's off, don't select.


setGlobalToggle

public void setGlobalToggle(Toggle newToggle)

getMXToggle

public Toggle getMXToggle()
Toggle switch that controls MX selection for a MapViewPanel so that only one specifier is active at a time - if it's off, don't select.


setMXToggle

public void setMXToggle(Toggle newToggle)

setMapViewPanel

public void setMapViewPanel(MapViewPanel newView)

getMapViewPanel

public MapViewPanel getMapViewPanel()

getListening

public boolean getListening()

setListening

public void setListening(boolean tizit)

enable

public void enable()

disable

public void disable()