private JMenuItem _exportKmlItem = null;
private JMenuItem _exportGpxItem = null;
private JMenuItem _exportPovItem = null;
- private JMenuItem _exportSvgItem = null;
private JMenuItem _exportImageItem = null;
private JMenu _recentFileMenu = null;
private JMenuItem _undoItem = null;
private JMenuItem _rearrangeWaypointsItem = null;
private JMenuItem _splitSegmentsItem = null;
private JMenuItem _sewSegmentsItem = null;
+ private JMenuItem _createMarkerWaypointsItem = null;
private JMenuItem _cutAndMoveItem = null;
private JMenuItem _convertNamesToTimesItem = null;
private JMenuItem _deleteFieldValuesItem = null;
private JCheckBoxMenuItem _mapCheckbox = null;
private JMenuItem _show3dItem = null;
private JMenu _browserMapMenu = null;
+ private JMenuItem _routingGraphHopperItem = null;
private JMenuItem _chartItem = null;
private JMenuItem _getGpsiesItem = null;
private JMenuItem _uploadGpsiesItem = null;
private JMenuItem _lookupSrtmItem = null;
private JMenuItem _downloadSrtmItem = null;
private JMenuItem _nearbyWikipediaItem = null;
+ private JMenuItem _nearbyOsmPoiItem = null;
private JMenuItem _showPeakfinderItem = null;
private JMenuItem _showGeohackItem = null;
- private JMenuItem _showPanoramioItem = null;
private JMenuItem _searchOpencachingDeItem = null;
private JMenuItem _searchMapillaryItem = null;
private JMenuItem _downloadOsmItem = null;
private JMenuItem _correlateAudiosItem = null;
private JMenuItem _selectNoAudioItem = null;
private JCheckBoxMenuItem _onlineCheckbox = null;
- private JCheckBoxMenuItem _antialiasCheckbox = null;
private JCheckBoxMenuItem _autosaveSettingsCheckbox = null;
// ActionListeners for reuse by menu and toolbar
// Pov
_exportPovItem = makeMenuItem(FunctionLibrary.FUNCTION_POVEXPORT, false);
fileMenu.add(_exportPovItem);
- // Svg
- _exportSvgItem = makeMenuItem(FunctionLibrary.FUNCTION_SVGEXPORT, false);
- fileMenu.add(_exportSvgItem);
// Image
_exportImageItem = makeMenuItem(FunctionLibrary.FUNCTION_IMAGEEXPORT, false);
fileMenu.add(_exportImageItem);
_browserMapMenu.add(yahooMapsItem);
JMenuItem bingMapsItem = makeMenuItem(new WebMapFunction(_app, UrlGenerator.WebService.MAP_SOURCE_BING, "menu.view.browser.bing"));
_browserMapMenu.add(bingMapsItem);
+ JMenuItem inlineMapItem = makeMenuItem(new WebMapFunction(_app, UrlGenerator.WebService.MAP_SOURCE_INLINESKATE, "menu.view.browser.inlinemap"));
+ _browserMapMenu.add(inlineMapItem);
+ _routingGraphHopperItem = makeMenuItem(new WebMapFunction(_app, UrlGenerator.WebService.MAP_SOURCE_GRAPHHOPPER, "menu.view.browser.graphhopper"));
+ _browserMapMenu.add(_routingGraphHopperItem);
onlineMenu.add(_browserMapMenu);
// wikipedia
_nearbyWikipediaItem = makeMenuItem(FunctionLibrary.FUNCTION_NEARBY_WIKIPEDIA, false);
onlineMenu.add(_nearbyWikipediaItem);
JMenuItem searchWikipediaNamesItem = makeMenuItem(FunctionLibrary.FUNCTION_SEARCH_WIKIPEDIA);
onlineMenu.add(searchWikipediaNamesItem);
+ _nearbyOsmPoiItem = makeMenuItem(FunctionLibrary.FUNCTION_SEARCH_OSMPOIS);
+ onlineMenu.add(_nearbyOsmPoiItem);
_showPeakfinderItem = makeMenuItem(new WebMapFunction(_app, UrlGenerator.WebService.MAP_SOURCE_PEAKFINDER, "webservice.peakfinder"), false);
onlineMenu.add(_showPeakfinderItem);
_showGeohackItem = makeMenuItem(new WebMapFunction(_app, UrlGenerator.WebService.MAP_SOURCE_GEOHACK, "webservice.geohack"), false);
onlineMenu.add(_showGeohackItem);
- _showPanoramioItem = makeMenuItem(new WebMapFunction(_app, UrlGenerator.WebService.MAP_SOURCE_PANORAMIO, "webservice.panoramio"), false);
- onlineMenu.add(_showPanoramioItem);
onlineMenu.addSeparator();
_searchOpencachingDeItem = makeMenuItem(new SearchOpenCachingDeFunction(_app), false);
trackMenu.add(_clearUndoItem);
trackMenu.addSeparator();
_compressItem = makeMenuItem(FunctionLibrary.FUNCTION_COMPRESS, false);
- setShortcut(_compressItem, "shortcut.menu.edit.compress");
+ setShortcut(_compressItem, "shortcut.menu.track.compress");
trackMenu.add(_compressItem);
_markRectangleItem = new JMenuItem(I18nManager.getText("menu.track.markrectangle"));
_markRectangleItem.addActionListener(new ActionListener() {
// Sew track segments
_sewSegmentsItem = makeMenuItem(FunctionLibrary.FUNCTION_SEW_SEGMENTS, false);
trackMenu.add(_sewSegmentsItem);
+ // Create marker waypoints
+ _createMarkerWaypointsItem = makeMenuItem(FunctionLibrary.FUNCTION_CREATE_MARKER_WAYPOINTS, false);
+ trackMenu.add(_createMarkerWaypointsItem);
trackMenu.addSeparator();
_learnEstimationParams = makeMenuItem(FunctionLibrary.FUNCTION_LEARN_ESTIMATION_PARAMS, false);
trackMenu.add(_learnEstimationParams);
};
_editPointItem.addActionListener(_editPointAction);
_editPointItem.setEnabled(false);
+ setShortcut(_editPointItem, "shortcut.menu.point.edit");
pointMenu.add(_editPointItem);
_editWaypointNameItem = makeMenuItem(FunctionLibrary.FUNCTION_EDIT_WAYPOINT_NAME, false);
pointMenu.add(_editWaypointNameItem);
settingsMenu.add(makeMenuItem(FunctionLibrary.FUNCTION_SET_PATHS));
// Set colours
settingsMenu.add(makeMenuItem(FunctionLibrary.FUNCTION_SET_COLOURS));
- // Set line width used for drawing
- settingsMenu.add(makeMenuItem(new ChooseSingleParameter(_app, FunctionLibrary.FUNCTION_SET_LINE_WIDTH)));
- // Use antialias or not
- _antialiasCheckbox = new JCheckBoxMenuItem(I18nManager.getText("menu.settings.antialias"), false);
- _antialiasCheckbox.setSelected(Config.getConfigBoolean(Config.KEY_ANTIALIAS));
- _antialiasCheckbox.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Config.setConfigBoolean(Config.KEY_ANTIALIAS, _antialiasCheckbox.isSelected());
- UpdateMessageBroker.informSubscribers(MAPSERVER_CHANGED);
- }
- });
- settingsMenu.add(_antialiasCheckbox);
+ // display settings
+ JMenuItem setDisplaySettingsItem = makeMenuItem(FunctionLibrary.FUNCTION_SET_DISPLAY_SETTINGS);
+ settingsMenu.add(setDisplaySettingsItem);
// Set language
settingsMenu.add(makeMenuItem(FunctionLibrary.FUNCTION_SET_LANGUAGE));
// Set altitude tolerance
settingsMenu.add(makeMenuItem(new ChooseSingleParameter(_app, FunctionLibrary.FUNCTION_SET_ALTITUDE_TOLERANCE)));
+ // Set timezone
+ settingsMenu.add(makeMenuItem(FunctionLibrary.FUNCTION_SET_TIMEZONE));
settingsMenu.addSeparator();
// Save configuration
settingsMenu.add(makeMenuItem(FunctionLibrary.FUNCTION_SAVECONFIG));
_exportKmlItem.setEnabled(hasData);
_exportGpxItem.setEnabled(hasData);
_exportPovItem.setEnabled(hasMultiplePoints);
- _exportSvgItem.setEnabled(hasMultiplePoints);
_exportImageItem.setEnabled(hasMultiplePoints);
_compressItem.setEnabled(hasData);
_markRectangleItem.setEnabled(hasData);
_markUphillLiftsItem.setEnabled(hasData && _track.hasAltitudeData());
_deleteMarkedPointsItem.setEnabled(hasData && _track.hasMarkedPoints());
_rearrangeWaypointsItem.setEnabled(hasData && _track.hasTrackPoints() && _track.hasWaypoints());
- _splitSegmentsItem.setEnabled(hasData && _track.hasTrackPoints() && _track.getNumPoints() > 3);
- _sewSegmentsItem.setEnabled(hasData && _track.hasTrackPoints() && _track.getNumPoints() > 3);
+ final boolean hasSeveralTrackPoints = hasData && _track.hasTrackPoints() && _track.getNumPoints() > 3;
+ _splitSegmentsItem.setEnabled(hasSeveralTrackPoints);
+ _sewSegmentsItem.setEnabled(hasSeveralTrackPoints);
+ _createMarkerWaypointsItem.setEnabled(hasSeveralTrackPoints);
_selectAllItem.setEnabled(hasData);
_selectNoneItem.setEnabled(hasData);
_show3dItem.setEnabled(hasMultiplePoints);
_uploadGpsiesItem.setEnabled(hasData && _track.hasTrackPoints());
_lookupSrtmItem.setEnabled(hasData);
_nearbyWikipediaItem.setEnabled(hasData);
+ _nearbyOsmPoiItem.setEnabled(hasData);
_downloadOsmItem.setEnabled(hasData);
_getWeatherItem.setEnabled(hasData);
_findWaypointItem.setEnabled(hasData && _track.hasWaypoints());
_duplicatePointItem.setEnabled(hasPoint);
_showPeakfinderItem.setEnabled(hasPoint);
_showGeohackItem.setEnabled(hasPoint);
- _showPanoramioItem.setEnabled(hasPoint);
_searchOpencachingDeItem.setEnabled(hasPoint);
_searchMapillaryItem.setEnabled(hasPoint);
// is it a waypoint?
|| _selection.getCurrentPointIndex() > (_selection.getEnd()+1));
_cutAndMoveItem.setEnabled(canCutAndMove);
_cutAndMoveButton.setEnabled(canCutAndMove);
+ final boolean isTrackLengthTwo = hasData && _track.getNumPoints() == 2;
+ _routingGraphHopperItem.setEnabled(isTrackLengthTwo || (hasData && hasRange));
// Has the map been switched on/off?
boolean mapsOn = Config.getConfigBoolean(Config.KEY_SHOW_MAP);
if (_mapCheckbox.isSelected() != mapsOn) {