com.partnersoft.maps.app
Class MapEditLogic

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

public class MapEditLogic
extends java.lang.Object

Takes care of editing logic - the manipulation of editable map geometry.

Copyright 2005-2009 Partner Software, Inc.

Version:
$Id: MapEditLogic.java 2328 2010-01-06 15:38:22Z paul $
Author:
Paul Reavis

Field Summary
protected  MapEditMode mode
           
 
Constructor Summary
MapEditLogic(MapApp app)
           
 
Method Summary
 void activateKeypadItem(java.lang.String keyName)
           
 void add(double x, double y)
           
 void add(MapEditTool tool, double x, double y)
           
 void add(XyPoint point)
           
 void addAtCenterOrGps()
           
 void addGPS()
          Deprecated.  
 void addWithGps()
           
 void connect(double x, double y)
           
 void convert()
           
 void convertOrCopy(MapEditTool tool)
          If possible, converts the current selection, otherwise, if possible, copies it.
 void copy()
           
 void delete()
          Deletes the currently-selected item.
 void edit()
           
 int getActionCount()
           
 NameSet getConnectTargetDataTypes()
           
 java.lang.String getConnectTargetMapSet()
           
 MapSet getCurrentMapSet()
           
 MapEditActor getCurrentMapSetEditActor()
           
 MapEditActor getCurrentSelectionEditActor()
           
 MapEditTool getCurrentTool()
           
 MapEditMode getMode()
           
 MapEditToolTreeModel getToolModel()
           
 boolean hitWheelMenu(MapMouseEvent event)
          Checks for a hit on the wheel menu.
 boolean hoverWheelMenu(int pixelX, int pixelY)
          Checks for indication (hover) on the wheel menu.
protected  void initialize()
           
 boolean isAddAvailable()
           
 boolean isDeleteAvailable()
           
 boolean isEditAvailable()
           
 boolean isMoveAvailable()
           
 boolean isRotateAvailable()
           
 MapEditTool lookupTool(java.lang.String mapsetName, java.lang.String category, java.lang.String toolName)
          Looks up a desired MapEditTool using a mapset name, category name, and thing name.
 void move(double x, double y)
          Moves the currently selected item to the given location.
 void move(XyPoint newLocation)
          Moves the currently selected item to the given location.
 void moveWithGps()
           
 boolean onWheelMenu(int pixelX, int pixelY)
           
 void reloadToolRack()
          Reloads the tool rack (e.g.
 void rotate(double x, double y)
          Rotates the currently selected item to the given angle (in degrees).
 void rotate(XyDirection direction)
          Rotates the currently selected item to the given direction.
 void setActionCount(int count)
           
 void setConnectTargetDataTypes(NameSet connectTargetDataTypes)
           
 void setConnectTargetDataTypes(java.lang.String... types)
           
 void setConnectTargetMapSet(java.lang.String connectTargetMapSet)
           
 void setCurrentSelection(MapDataItem item)
           
 void setMode(MapEditMode newMode)
           
 void showActionMenu(int pixelX, int pixelY)
           
 void showSelectionMenu(int pixelX, int pixelY)
           
 void updateGui()
          Use this (sparingly!) to force the various wheel menu and edit buttons etc.
 void updateWheelMenu()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mode

protected MapEditMode mode
Constructor Detail

MapEditLogic

public MapEditLogic(MapApp app)
Method Detail

initialize

protected void initialize()

reloadToolRack

public void reloadToolRack()
Reloads the tool rack (e.g. if the list has changed).


rotate

public void rotate(double x,
                   double y)
Rotates the currently selected item to the given angle (in degrees).


rotate

public void rotate(XyDirection direction)
Rotates the currently selected item to the given direction.


connect

public void connect(double x,
                    double y)

move

public void move(XyPoint newLocation)
Moves the currently selected item to the given location.


move

public void move(double x,
                 double y)
Moves the currently selected item to the given location.


moveWithGps

public void moveWithGps()

addWithGps

public void addWithGps()

delete

public void delete()
Deletes the currently-selected item.


setCurrentSelection

public void setCurrentSelection(MapDataItem item)

updateGui

public void updateGui()
Use this (sparingly!) to force the various wheel menu and edit buttons etc. to update their enablement etc. It should get taken care of automatically so only use this if it is not.


updateWheelMenu

public void updateWheelMenu()

add

public void add(XyPoint point)

add

public void add(double x,
                double y)

addGPS

public void addGPS()
Deprecated. 

Old method, use addWithGps() instead.


add

public void add(MapEditTool tool,
                double x,
                double y)

copy

public void copy()

convert

public void convert()

edit

public void edit()

activateKeypadItem

public void activateKeypadItem(java.lang.String keyName)

addAtCenterOrGps

public void addAtCenterOrGps()

showActionMenu

public void showActionMenu(int pixelX,
                           int pixelY)

showSelectionMenu

public void showSelectionMenu(int pixelX,
                              int pixelY)

convertOrCopy

public void convertOrCopy(MapEditTool tool)
If possible, converts the current selection, otherwise, if possible, copies it.


setMode

public void setMode(MapEditMode newMode)

getMode

public MapEditMode getMode()

hitWheelMenu

public boolean hitWheelMenu(MapMouseEvent event)
Checks for a hit on the wheel menu. If it hits, takes appropriate action and returns true. Otherwise, returns false.


hoverWheelMenu

public boolean hoverWheelMenu(int pixelX,
                              int pixelY)
Checks for indication (hover) on the wheel menu. If the pixels are over the wheel, it takes appropriate action and returns true. Otherwise, returns false.


onWheelMenu

public boolean onWheelMenu(int pixelX,
                           int pixelY)

getCurrentSelectionEditActor

public MapEditActor getCurrentSelectionEditActor()

getCurrentMapSetEditActor

public MapEditActor getCurrentMapSetEditActor()

getToolModel

public MapEditToolTreeModel getToolModel()

getCurrentMapSet

public MapSet getCurrentMapSet()

getCurrentTool

public MapEditTool getCurrentTool()

lookupTool

public MapEditTool lookupTool(java.lang.String mapsetName,
                              java.lang.String category,
                              java.lang.String toolName)
Looks up a desired MapEditTool using a mapset name, category name, and thing name. Returns null on failure.


setActionCount

public void setActionCount(int count)

getActionCount

public int getActionCount()

getConnectTargetMapSet

public java.lang.String getConnectTargetMapSet()

setConnectTargetMapSet

public void setConnectTargetMapSet(java.lang.String connectTargetMapSet)

getConnectTargetDataTypes

public NameSet getConnectTargetDataTypes()

setConnectTargetDataTypes

public void setConnectTargetDataTypes(NameSet connectTargetDataTypes)

setConnectTargetDataTypes

public void setConnectTargetDataTypes(java.lang.String... types)

isAddAvailable

public boolean isAddAvailable()

isMoveAvailable

public boolean isMoveAvailable()

isEditAvailable

public boolean isEditAvailable()

isDeleteAvailable

public boolean isDeleteAvailable()

isRotateAvailable

public boolean isRotateAvailable()