Package edu.cnu.mdi.mapping.container
Class MapToolHandler
java.lang.Object
edu.cnu.mdi.container.BaseToolHandler
edu.cnu.mdi.mapping.container.MapToolHandler
- All Implemented Interfaces:
IToolHandler
Map-specific tool handler that overrides creation gestures to produce
map-native items whose geometry is stored in geographic coordinates rather
than projection-space world coordinates.
Military symbol placement is handled entirely by drag-and-drop in
MapContainer. This handler is responsible only for the normal
map drawing tools such as line, polyline, polygon, and text.
-
Field Summary
FieldsFields inherited from class edu.cnu.mdi.container.BaseToolHandler
base, buffer, container, dragPressPoint, modifying, modifyItem, modifyItems, ZOOM_FACTOR -
Constructor Summary
ConstructorsConstructorDescriptionMapToolHandler(BaseContainer container) Creates a map tool handler bound to the given container. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateLine(GestureContext gc, Point start, Point end) Creates a great-circle map line between the two screen-space endpoints.voidcreatePolygon(GestureContext gc, Point[] vertices) Creates a great-circle polygon from the supplied screen-space vertices.voidcreatePolyline(GestureContext gc, Point[] vertices) Creates a great-circle polyline from the supplied screen-space vertices.voidcreateTextItem(GestureContext gc, Point location) Creates a geolocated text item at the clicked map position.voidCompletes a projection-aware pan with a definitive repaint.voidSaves the current map extent for undo before a projection-aware pan.voidRecenters the map from the latest incremental pointer displacement.Methods inherited from class edu.cnu.mdi.container.BaseToolHandler
approveConnectionPoint, beginDragObject, boxZoomRubberbanding, captureImage, createConnection, createEllipse, createRadArc, createRectangle, delete, doNotDrag, dragObjectBy, endDragObject, hitTest, info, magnifyDoneMove, magnifyStartMove, magnifyUpdateMove, pointerClick, pointerDoubleClick, pointerRubberbanding, print, recenter, resetZoom, styleEdit, undoZoom, zoomIn, zoomOut
-
Field Details
-
mapContainer
Owning map container.
-
-
Constructor Details
-
MapToolHandler
Creates a map tool handler bound to the given container.- Parameters:
container- the owning map container
-
-
Method Details
-
panStartDrag
Saves the current map extent for undo before a projection-aware pan. Unlike ordinary canvas panning, no screenshot is captured or translated.- Specified by:
panStartDragin interfaceIToolHandler- Overrides:
panStartDragin classBaseToolHandler- Parameters:
gc- gesture context (non-null)
-
panUpdateDrag
Recenters the map from the latest incremental pointer displacement. Reprojection keeps the map domain fixed and prevents empty backfill.- Specified by:
panUpdateDragin interfaceIToolHandler- Overrides:
panUpdateDragin classBaseToolHandler- Parameters:
gc- gesture context (non-null)
-
panDoneDrag
Completes a projection-aware pan with a definitive repaint.- Specified by:
panDoneDragin interfaceIToolHandler- Overrides:
panDoneDragin classBaseToolHandler- Parameters:
gc- gesture context (non-null)
-
createLine
Creates a great-circle map line between the two screen-space endpoints.- Specified by:
createLinein interfaceIToolHandler- Overrides:
createLinein classBaseToolHandler- Parameters:
gc- the gesture contextstart- the screen-space start pointend- the screen-space end point
-
createPolyline
Creates a great-circle polyline from the supplied screen-space vertices.- Specified by:
createPolylinein interfaceIToolHandler- Overrides:
createPolylinein classBaseToolHandler- Parameters:
gc- the gesture contextvertices- screen-space vertices in draw order
-
createPolygon
Creates a great-circle polygon from the supplied screen-space vertices.- Specified by:
createPolygonin interfaceIToolHandler- Overrides:
createPolygonin classBaseToolHandler- Parameters:
gc- the gesture contextvertices- screen-space vertices in draw order
-
createTextItem
Creates a geolocated text item at the clicked map position.- Specified by:
createTextItemin interfaceIToolHandler- Overrides:
createTextItemin classBaseToolHandler- Parameters:
gc- the gesture contextlocation- the screen-space click point
-