public abstract class DownloadAlongAction extends JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdaptersc| Constructor and Description |
|---|
DownloadAlongAction(java.lang.String name,
java.lang.String iconName,
java.lang.String tooltip,
Shortcut shortcut,
boolean registerInToolbar)
Constructs a new
DownloadAlongAction |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
protected static void |
addToDownload(java.awt.geom.Area a,
java.awt.geom.Rectangle2D r,
java.util.Collection<java.awt.geom.Rectangle2D> results,
double maxArea) |
protected static java.util.Collection<LatLon> |
calcBetweenPoints(LatLon p1,
LatLon p2,
double bufferDist)
Calculate list of points between two given points so that the distance between two consecutive points is below a limit.
|
protected static void |
confirmAndDownloadAreas(java.awt.geom.Area a,
double maxArea,
boolean osmDownload,
boolean gpxDownload,
java.lang.String title)
Area "a" contains the hull that we would like to download data for.
|
protected PleaseWaitRunnable |
createCalcTask(java.awt.geom.Path2D alongPath,
DownloadAlongPanel panel,
java.lang.String confirmTitle)
Create task that downloads areas along the given path using the values specified in the panel.
|
protected abstract PleaseWaitRunnable |
createTask()
Sub classes must override this method.
|
checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setTooltip, updateEnabledState, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuturepublic DownloadAlongAction(java.lang.String name, java.lang.String iconName, java.lang.String tooltip, Shortcut shortcut, boolean registerInToolbar)
DownloadAlongActionname - the action's text as displayed in the menuiconName - the filename of the icon to usetooltip - a longer description of the action that will be displayed in the tooltip. Please note
that html is not supported for menu actions on some platforms.shortcut - a ready-created shortcut object or null if you don't want a shortcut. But you always
do want a shortcut, remember you can always register it with group=none, so you
won't be assigned a shortcut unless the user configures one. If you pass null here,
the user CANNOT configure a shortcut for your action.registerInToolbar - register this action for the toolbar preferences?protected abstract PleaseWaitRunnable createTask()
protected static void addToDownload(java.awt.geom.Area a, java.awt.geom.Rectangle2D r, java.util.Collection<java.awt.geom.Rectangle2D> results, double maxArea)
protected static void confirmAndDownloadAreas(java.awt.geom.Area a, double maxArea, boolean osmDownload, boolean gpxDownload, java.lang.String title)
a - download area hullmaxArea - maximum area size for a single downloadosmDownload - Set to true if OSM data should be downloadedgpxDownload - Set to true if GPX data should be downloadedtitle - the title string for the confirmation dialogprotected static java.util.Collection<LatLon> calcBetweenPoints(LatLon p1, LatLon p2, double bufferDist)
p1 - first point or nullp2 - second point (must not be null)bufferDist - the maximum distanceprotected PleaseWaitRunnable createCalcTask(java.awt.geom.Path2D alongPath, DownloadAlongPanel panel, java.lang.String confirmTitle)
alongPath - the path along which the areas are to be downloadedpanel - the panel that was displayed to the user and now contains his selectionsconfirmTitle - the title to display in the confirmation panelpublic void actionPerformed(java.awt.event.ActionEvent e)