Search in sources :

Example 1 with GpxDisplayItem

use of net.osmand.plus.GpxSelectionHelper.GpxDisplayItem in project Osmand by osmandapp.

the class GPXLayer method drawSelectedFilesSplits.

private void drawSelectedFilesSplits(Canvas canvas, RotatedTileBox tileBox, List<SelectedGpxFile> selectedGPXFiles, DrawSettings settings) {
    if (tileBox.getZoom() >= startZoom) {
        // request to load
        for (SelectedGpxFile g : selectedGPXFiles) {
            List<GpxDisplayGroup> groups = g.getDisplayGroups();
            if (groups != null && !groups.isEmpty()) {
                GpxDataItem gpxDataItem = view.getApplication().getGpxDatabase().getItem(new File(g.getGpxFile().path));
                int color = gpxDataItem != null ? gpxDataItem.getColor() : 0;
                if (color == 0) {
                    color = g.getModifiableGpxFile().getColor(0);
                }
                if (color == 0) {
                    color = cachedColor;
                }
                paintInnerRect.setColor(color);
                paintInnerRect.setAlpha(179);
                List<GpxDisplayItem> items = groups.get(0).getModifiableList();
                drawSplitItems(canvas, tileBox, items, settings);
            }
        }
    }
}
Also used : GpxDisplayGroup(net.osmand.plus.GpxSelectionHelper.GpxDisplayGroup) SelectedGpxFile(net.osmand.plus.GpxSelectionHelper.SelectedGpxFile) GpxDataItem(net.osmand.plus.GPXDatabase.GpxDataItem) GpxDisplayItem(net.osmand.plus.GpxSelectionHelper.GpxDisplayItem) SelectedGpxFile(net.osmand.plus.GpxSelectionHelper.SelectedGpxFile) GPXFile(net.osmand.plus.GPXUtilities.GPXFile) File(java.io.File) Paint(android.graphics.Paint)

Example 2 with GpxDisplayItem

use of net.osmand.plus.GpxSelectionHelper.GpxDisplayItem in project Osmand by osmandapp.

the class MenuController method getMenuController.

public static MenuController getMenuController(MapActivity mapActivity, LatLon latLon, PointDescription pointDescription, Object object, MenuType menuType) {
    MenuController menuController = null;
    if (object != null) {
        if (object instanceof Amenity) {
            menuController = new AmenityMenuController(mapActivity, pointDescription, (Amenity) object);
        } else if (object instanceof FavouritePoint) {
            menuController = new FavouritePointMenuController(mapActivity, pointDescription, (FavouritePoint) object);
        } else if (object instanceof SearchHistoryHelper.HistoryEntry) {
            menuController = new HistoryMenuController(mapActivity, pointDescription, (SearchHistoryHelper.HistoryEntry) object);
        } else if (object instanceof TargetPoint) {
            menuController = new TargetPointMenuController(mapActivity, pointDescription, (TargetPoint) object);
        } else if (object instanceof Recording) {
            menuController = new AudioVideoNoteMenuController(mapActivity, pointDescription, (Recording) object);
        } else if (object instanceof OsmPoint) {
            menuController = new EditPOIMenuController(mapActivity, pointDescription, (OsmPoint) object);
        } else if (object instanceof WptPt) {
            menuController = new WptPtMenuController(mapActivity, pointDescription, (WptPt) object);
        } else if (object instanceof DownloadMapObject) {
            menuController = new MapDataMenuController(mapActivity, pointDescription, (DownloadMapObject) object);
        } else if (object instanceof OpenStreetNote) {
            menuController = new OsmBugMenuController(mapActivity, pointDescription, (OpenStreetNote) object);
        } else if (object instanceof GpxDisplayItem) {
            menuController = new GpxItemMenuController(mapActivity, pointDescription, (GpxDisplayItem) object);
        } else if (object instanceof MapMarker) {
            menuController = new MapMarkerMenuController(mapActivity, pointDescription, (MapMarker) object);
        } else if (object instanceof TransportStopRoute) {
            menuController = new TransportRouteController(mapActivity, pointDescription, (TransportStopRoute) object);
        } else if (object instanceof TransportStop) {
            menuController = new TransportStopController(mapActivity, pointDescription, (TransportStop) object);
        } else if (object instanceof AMapPoint) {
            menuController = new AMapPointMenuController(mapActivity, pointDescription, (AMapPoint) object);
        } else if (object instanceof LatLon) {
            if (pointDescription.isParking()) {
                menuController = new ParkingPositionMenuController(mapActivity, pointDescription);
            } else if (pointDescription.isMyLocation()) {
                menuController = new MyLocationMenuController(mapActivity, pointDescription);
            }
        } else if (object instanceof RouteDataObject) {
            menuController = new ImpassibleRoadsMenuController(mapActivity, pointDescription, (RouteDataObject) object);
        } else if (object instanceof RenderedObject) {
            menuController = new RenderedObjectMenuController(mapActivity, pointDescription, (RenderedObject) object);
        } else if (object instanceof MapillaryImage) {
            menuController = new MapillaryMenuController(mapActivity, pointDescription, (MapillaryImage) object);
        }
    }
    if (menuController == null) {
        menuController = new PointDescriptionMenuController(mapActivity, pointDescription);
    }
    menuController.menuType = menuType;
    menuController.setLatLon(latLon);
    menuController.onCreated();
    return menuController;
}
Also used : TargetPointMenuController(net.osmand.plus.mapcontextmenu.controllers.TargetPointMenuController) WptPt(net.osmand.plus.GPXUtilities.WptPt) HistoryMenuController(net.osmand.plus.mapcontextmenu.controllers.HistoryMenuController) TransportStopController(net.osmand.plus.mapcontextmenu.controllers.TransportStopController) FavouritePoint(net.osmand.data.FavouritePoint) MapMarker(net.osmand.plus.MapMarkersHelper.MapMarker) MapillaryImage(net.osmand.plus.mapillary.MapillaryImage) ParkingPositionMenuController(net.osmand.plus.parkingpoint.ParkingPositionMenuController) GpxDisplayItem(net.osmand.plus.GpxSelectionHelper.GpxDisplayItem) GpxItemMenuController(net.osmand.plus.mapcontextmenu.controllers.GpxItemMenuController) MapDataMenuController(net.osmand.plus.mapcontextmenu.controllers.MapDataMenuController) TargetPoint(net.osmand.plus.TargetPointsHelper.TargetPoint) RenderedObjectMenuController(net.osmand.plus.mapcontextmenu.controllers.RenderedObjectMenuController) ImpassibleRoadsMenuController(net.osmand.plus.mapcontextmenu.controllers.ImpassibleRoadsMenuController) EditPOIMenuController(net.osmand.plus.osmedit.EditPOIMenuController) TransportStopRoute(net.osmand.plus.transport.TransportStopRoute) MapMarkerMenuController(net.osmand.plus.mapcontextmenu.controllers.MapMarkerMenuController) PointDescriptionMenuController(net.osmand.plus.mapcontextmenu.controllers.PointDescriptionMenuController) AMapPointMenuController(net.osmand.plus.mapcontextmenu.controllers.AMapPointMenuController) TransportStop(net.osmand.data.TransportStop) Amenity(net.osmand.data.Amenity) FavouritePointMenuController(net.osmand.plus.mapcontextmenu.controllers.FavouritePointMenuController) AudioVideoNoteMenuController(net.osmand.plus.audionotes.AudioVideoNoteMenuController) OsmBugMenuController(net.osmand.plus.osmedit.OsmBugMenuController) OsmPoint(net.osmand.plus.osmedit.OsmPoint) TransportRouteController(net.osmand.plus.mapcontextmenu.controllers.TransportRouteController) AMapPoint(net.osmand.aidl.maplayer.point.AMapPoint) AmenityMenuController(net.osmand.plus.mapcontextmenu.controllers.AmenityMenuController) DownloadMapObject(net.osmand.plus.views.DownloadedRegionsLayer.DownloadMapObject) MyLocationMenuController(net.osmand.plus.mapcontextmenu.controllers.MyLocationMenuController) RenderedObjectMenuController(net.osmand.plus.mapcontextmenu.controllers.RenderedObjectMenuController) PointDescriptionMenuController(net.osmand.plus.mapcontextmenu.controllers.PointDescriptionMenuController) MapMarkerMenuController(net.osmand.plus.mapcontextmenu.controllers.MapMarkerMenuController) AMapPointMenuController(net.osmand.plus.mapcontextmenu.controllers.AMapPointMenuController) OsmBugMenuController(net.osmand.plus.osmedit.OsmBugMenuController) WptPtMenuController(net.osmand.plus.mapcontextmenu.controllers.WptPtMenuController) MapillaryMenuController(net.osmand.plus.mapillary.MapillaryMenuController) GpxItemMenuController(net.osmand.plus.mapcontextmenu.controllers.GpxItemMenuController) HistoryMenuController(net.osmand.plus.mapcontextmenu.controllers.HistoryMenuController) ParkingPositionMenuController(net.osmand.plus.parkingpoint.ParkingPositionMenuController) MapDataMenuController(net.osmand.plus.mapcontextmenu.controllers.MapDataMenuController) TargetPointMenuController(net.osmand.plus.mapcontextmenu.controllers.TargetPointMenuController) AudioVideoNoteMenuController(net.osmand.plus.audionotes.AudioVideoNoteMenuController) AmenityMenuController(net.osmand.plus.mapcontextmenu.controllers.AmenityMenuController) ImpassibleRoadsMenuController(net.osmand.plus.mapcontextmenu.controllers.ImpassibleRoadsMenuController) EditPOIMenuController(net.osmand.plus.osmedit.EditPOIMenuController) FavouritePointMenuController(net.osmand.plus.mapcontextmenu.controllers.FavouritePointMenuController) MyLocationMenuController(net.osmand.plus.mapcontextmenu.controllers.MyLocationMenuController) LatLon(net.osmand.data.LatLon) RenderedObject(net.osmand.NativeLibrary.RenderedObject) OpenStreetNote(net.osmand.plus.osmedit.OsmBugsLayer.OpenStreetNote) RouteDataObject(net.osmand.binary.RouteDataObject) Recording(net.osmand.plus.audionotes.AudioVideoNotesPlugin.Recording) WptPtMenuController(net.osmand.plus.mapcontextmenu.controllers.WptPtMenuController) MapillaryMenuController(net.osmand.plus.mapillary.MapillaryMenuController)

Example 3 with GpxDisplayItem

use of net.osmand.plus.GpxSelectionHelper.GpxDisplayItem in project Osmand by osmandapp.

the class SplitSegmentDialogFragment method getOverviewSegment.

private GpxDisplayItem getOverviewSegment() {
    List<GpxDisplayGroup> result = getTrackActivity().getGpxFile(false);
    GpxDisplayItem overviewSegment = null;
    if (result.size() > 0) {
        overviewSegment = result.get(0).getModifiableList().get(0);
    }
    return overviewSegment;
}
Also used : GpxDisplayGroup(net.osmand.plus.GpxSelectionHelper.GpxDisplayGroup) GpxDisplayItem(net.osmand.plus.GpxSelectionHelper.GpxDisplayItem)

Example 4 with GpxDisplayItem

use of net.osmand.plus.GpxSelectionHelper.GpxDisplayItem in project Osmand by osmandapp.

the class SplitSegmentDialogFragment method updateContent.

public void updateContent() {
    if (getTrackActivity() != null) {
        adapter.clear();
        adapter.setNotifyOnChange(false);
        GpxDisplayItem overviewSegments = getOverviewSegment();
        adapter.add(overviewSegments);
        List<GpxDisplayItem> splitSegments = getSplitSegments();
        adapter.addAll(splitSegments);
        adapter.notifyDataSetChanged();
        listView.setSelection(0);
        headerView.setTranslationY(0);
        updateHeader();
    }
}
Also used : GpxDisplayItem(net.osmand.plus.GpxSelectionHelper.GpxDisplayItem)

Example 5 with GpxDisplayItem

use of net.osmand.plus.GpxSelectionHelper.GpxDisplayItem in project Osmand by osmandapp.

the class TrackSegmentFragment method updateContent.

public void updateContent() {
    adapter.clear();
    List<GpxDisplayGroup> groups = getOriginalGroups();
    adapter.setNotifyOnChange(false);
    for (GpxDisplayItem i : flatten(groups)) {
        adapter.add(i);
    }
    adapter.notifyDataSetChanged();
    if (getActivity() != null) {
        updateHeader();
    }
}
Also used : GpxDisplayGroup(net.osmand.plus.GpxSelectionHelper.GpxDisplayGroup) GpxDisplayItem(net.osmand.plus.GpxSelectionHelper.GpxDisplayItem)

Aggregations

GpxDisplayItem (net.osmand.plus.GpxSelectionHelper.GpxDisplayItem)9 LatLon (net.osmand.data.LatLon)3 GpxDisplayGroup (net.osmand.plus.GpxSelectionHelper.GpxDisplayGroup)3 Paint (android.graphics.Paint)2 FavouritePoint (net.osmand.data.FavouritePoint)2 PointDescription (net.osmand.data.PointDescription)2 QuadRect (net.osmand.data.QuadRect)2 WptPt (net.osmand.plus.GPXUtilities.WptPt)2 TargetPoint (net.osmand.plus.TargetPointsHelper.TargetPoint)2 DialogInterface (android.content.DialogInterface)1 Rect (android.graphics.Rect)1 RectF (android.graphics.RectF)1 AlertDialog (android.support.v7.app.AlertDialog)1 CheckBox (android.widget.CheckBox)1 EditText (android.widget.EditText)1 File (java.io.File)1 Location (net.osmand.Location)1 RenderedObject (net.osmand.NativeLibrary.RenderedObject)1 AMapPoint (net.osmand.aidl.maplayer.point.AMapPoint)1 RouteDataObject (net.osmand.binary.RouteDataObject)1