com.partnersoft.maps.app
Class MapSelectionLogic

java.lang.Object
  extended by com.partnersoft.maps.app.MapSelectionLogic

public class MapSelectionLogic
extends java.lang.Object

Nonvisual plumbing for controlling the current selection, selection list, and indications.

Author:
Paul Reavis Copyright 2002-2005 Partner Software, Inc.

Constructor Summary
MapSelectionLogic(MapApp app)
           
 
Method Summary
 void addAndSelect(int dataSetID, int dataID)
           
 void addAndSelect(RoverSet roverSet, int dataID)
           
 void addAndSelect(java.lang.String roverSetName, int dataID)
           
 void addSelection(double x, double y, int pixelX, int pixelY)
          Adds the items at the given coordinates.
 void addSelection(int dataSetID, int dataID)
           
 void addSelection(RoverSet roverSet, int dataID)
           
 void addToSelectionList(java.util.ArrayList smore)
          Adds the contents of a list to the existing contents of the selection list.
 void centerSelection()
           
 void clearSelectionList()
          Clears all items in the selection list.
 void ensureSelectionIsVisible()
           
 MapDataItem getCurrentItem()
           
 Point getLocationNearestLastSelect()
          Returns the point (the point itself for point or text items; a vertex for lines and areas and merged items) for current selection nearest the coordinates of the last mouse selection event.
 java.lang.String getSelectedDataAsText()
           
 MapDataItem getSelectedItem()
           
 JobDataComponent getSelectedJobDataComponent()
           
 void hover(double x, double y, int pixelX, int pixelY)
          "Hover" (causing indication behavior) at the given coordinates.
 void initialize()
          Initializes the view from preferences.
 void removeSelection(MapDataItem item)
           
 void select(double x, double y, int pixelX, int pixelY)
          Select the item at the given coordinates.
 void select(JobDataComponent jobDataComponent)
          Selects the indicated job data component, and populates the selection list with any parents.
 void selectAtPixel(int pixelX, int pixelY)
          Select the item at the given pixel coordinates.
 void selectAtPoint(double x, double y)
          Select the item at the given map coordinates.
 void selectNext()
          Selects the next item in the selection list.
 void selectPrevious()
          Selects the previous item in the selection list.
 void setCurrentSelection(int newSelection)
           
 void setSelectionList(java.util.ArrayList newList)
           
 void setSelectionList(java.util.ArrayList newList, int newCurrentSelection)
           
 void updateWheelMenu()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapSelectionLogic

public MapSelectionLogic(MapApp app)
Method Detail

initialize

public void initialize()
Initializes the view from preferences.


getSelectedItem

public MapDataItem getSelectedItem()

getLocationNearestLastSelect

public Point getLocationNearestLastSelect()
Returns the point (the point itself for point or text items; a vertex for lines and areas and merged items) for current selection nearest the coordinates of the last mouse selection event. Perhaps simpler: the part of the selected graphic nearest where the user clicked to select it.


selectPrevious

public void selectPrevious()
Selects the previous item in the selection list. Loops if already on the first item.


selectNext

public void selectNext()
Selects the next item in the selection list. Loops if already on the last item.


addToSelectionList

public void addToSelectionList(java.util.ArrayList smore)
Adds the contents of a list to the existing contents of the selection list.


setSelectionList

public void setSelectionList(java.util.ArrayList newList)

setSelectionList

public void setSelectionList(java.util.ArrayList newList,
                             int newCurrentSelection)

setCurrentSelection

public void setCurrentSelection(int newSelection)

addSelection

public void addSelection(int dataSetID,
                         int dataID)

addSelection

public void addSelection(RoverSet roverSet,
                         int dataID)

addAndSelect

public void addAndSelect(int dataSetID,
                         int dataID)

addAndSelect

public void addAndSelect(RoverSet roverSet,
                         int dataID)

addAndSelect

public void addAndSelect(java.lang.String roverSetName,
                         int dataID)

removeSelection

public void removeSelection(MapDataItem item)

getCurrentItem

public MapDataItem getCurrentItem()

ensureSelectionIsVisible

public void ensureSelectionIsVisible()

centerSelection

public void centerSelection()

clearSelectionList

public void clearSelectionList()
Clears all items in the selection list.


selectAtPoint

public void selectAtPoint(double x,
                          double y)
Select the item at the given map coordinates.


selectAtPixel

public void selectAtPixel(int pixelX,
                          int pixelY)
Select the item at the given pixel coordinates.


select

public void select(double x,
                   double y,
                   int pixelX,
                   int pixelY)
Select the item at the given coordinates.


addSelection

public void addSelection(double x,
                         double y,
                         int pixelX,
                         int pixelY)
Adds the items at the given coordinates.


select

public void select(JobDataComponent jobDataComponent)
Selects the indicated job data component, and populates the selection list with any parents.


getSelectedJobDataComponent

public JobDataComponent getSelectedJobDataComponent()

hover

public void hover(double x,
                  double y,
                  int pixelX,
                  int pixelY)
"Hover" (causing indication behavior) at the given coordinates.


updateWheelMenu

public void updateWheelMenu()

getSelectedDataAsText

public java.lang.String getSelectedDataAsText()