|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.maps.model.MapEditContext
public class MapEditContext
Encapsulates the parameters for all map editing commands.
This allows us to add more parameters without modifying the method signatures for MapEditActor implementations.
Not all parameters will be valid for any given edit action. For example, a delete command will only have the current selection as a parameter.
Copyright 2007 Partner Software, Inc.
| Method Summary | |
|---|---|
static MapEditContext |
forAdd(MapApp app)
|
static MapEditContext |
forAdd(MapApp app,
MapEditTool tool,
XyPoint point)
|
static MapEditContext |
forAdd(MapApp app,
XyPoint point)
|
static MapEditContext |
forAdd(MapApp app,
XyPoint point,
SurveyedLocation surveyedLocation)
|
static MapEditContext |
forAddMany(MapApp app)
|
static MapEditContext |
forConnect(MapApp app)
|
static MapEditContext |
forConnect(MapApp app,
XyPoint point)
|
static MapEditContext |
forConvert(MapApp app)
|
static MapEditContext |
forCopy(MapApp app)
|
static MapEditContext |
forDelete(MapApp app)
|
static MapEditContext |
forEdit(MapApp app)
|
static MapEditContext |
forMove(MapApp app)
|
static MapEditContext |
forMove(MapApp app,
XyPoint point)
|
static MapEditContext |
forMove(MapApp app,
XyPoint point,
SurveyedLocation surveyedLocation)
|
static MapEditContext |
forRotate(MapApp app)
|
static MapEditContext |
forRotate(MapApp app,
XyDirection direction)
|
static MapEditContext |
forRotate(MapApp app,
XyPoint point)
|
static MapEditContext |
forSelection(MapApp app)
|
static MapEditContext |
forWheel(MapApp app)
|
java.lang.String |
getAction()
The editing mode or action - one of "add", "delete", "move", "copy", "convert", "menu", or "browse". |
int |
getActionCount()
Returns the sequence number in a multi-part action (e.g. |
MapApp |
getApp()
|
XyDirection |
getDirection()
Returns the vector (generally from the selected item to the mouse click location) as a direction. |
double |
getDistance()
Returns the distance moved in map units. |
MapViewFrame |
getFrame()
|
XyPoint |
getLocation()
The new location for the item (e.g. |
XyPoint |
getMenuLocation()
The center of the wheel menu. |
int |
getPixelDistance()
Returns the distance moved in pixel units. |
XyRotation |
getRotation()
Returns the vector (generally from the selected item to the mouse click location) as a rotation. |
MapDataItem |
getSelected()
The current selection. |
SurveyedLocation |
getSurveyedLocation()
Set by MapEditLogic.addGPS() and .moveGPS() if the location was surveyed by a GPS. |
MapEditTool |
getTool()
The current tool selection. |
XyVector |
getVector()
Returns the vector (generally from the selected item location to the mouse click location). |
java.lang.String |
toString()
|
MapEditContext |
withAction(java.lang.String newAction)
Creates a MapEditContext with the same parameters as the current object, except with the new action. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static MapEditContext forSelection(MapApp app)
public static MapEditContext forAdd(MapApp app)
public static MapEditContext forAddMany(MapApp app)
public static MapEditContext forAdd(MapApp app,
XyPoint point)
public static MapEditContext forAdd(MapApp app,
MapEditTool tool,
XyPoint point)
public static MapEditContext forAdd(MapApp app,
XyPoint point,
SurveyedLocation surveyedLocation)
public static MapEditContext forConvert(MapApp app)
public static MapEditContext forCopy(MapApp app)
public static MapEditContext forDelete(MapApp app)
public static MapEditContext forEdit(MapApp app)
public static MapEditContext forMove(MapApp app)
public static MapEditContext forMove(MapApp app,
XyPoint point,
SurveyedLocation surveyedLocation)
public static MapEditContext forMove(MapApp app,
XyPoint point)
public static MapEditContext forRotate(MapApp app)
public static MapEditContext forRotate(MapApp app,
XyDirection direction)
public static MapEditContext forRotate(MapApp app,
XyPoint point)
public static MapEditContext forWheel(MapApp app)
public static MapEditContext forConnect(MapApp app)
public static MapEditContext forConnect(MapApp app,
XyPoint point)
public java.lang.String toString()
toString in class java.lang.Objectpublic double getDistance()
public int getPixelDistance()
public java.lang.String getAction()
The editing mode or action - one of "add", "delete", "move", "copy", "convert", "menu", or "browse".
RDC: added "add GPS" and "move GPS" to the list of actions.
public MapApp getApp()
public MapDataItem getSelected()
public XyPoint getLocation()
public XyPoint getMenuLocation()
public MapEditTool getTool()
public XyVector getVector()
public XyDirection getDirection()
public MapEditContext withAction(java.lang.String newAction)
newAction - - Action name to set in new MapEditContext.
public XyRotation getRotation()
public MapViewFrame getFrame()
public SurveyedLocation getSurveyedLocation()
Set by MapEditLogic.addGPS() and .moveGPS() if the location was surveyed by a GPS. If the location was not surveyed, this returns null.
The surveyed location object provides a GUID to the drawing actor that will match up to a post-processed point. If post-processing is not being done, the GUID will be null. Actors should store the GUID with the locations to do post-procesasing.
Aside from the GUID, a surveyed location works exactly like a normal location. The latitude and longitude have already been projected and stored in the context's location.
public int getActionCount()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||