From 7a78e98d2a61309c30d4ddaf8c9334893cc9b249 Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Wed, 1 Feb 2023 12:43:35 -0700 Subject: [PATCH] MapillaryMapRenderer: Remove since all rendering happens in custom path Signed-off-by: Taylor Smock --- .../visitor/paint/MapillaryMapRenderer.java | 52 ------------------- .../mapillary/gui/layer/MapillaryLayer.java | 3 -- 2 files changed, 55 deletions(-) delete mode 100644 src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/visitor/paint/MapillaryMapRenderer.java diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/visitor/paint/MapillaryMapRenderer.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/visitor/paint/MapillaryMapRenderer.java deleted file mode 100644 index 275e23049..000000000 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/visitor/paint/MapillaryMapRenderer.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openstreetmap.josm.plugins.mapillary.data.mapillary.visitor.paint; - -import static org.openstreetmap.josm.tools.I18n.tr; - -import java.awt.Graphics2D; -import java.util.Collections; -import java.util.stream.Stream; - -import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer; -import org.openstreetmap.josm.data.vector.VectorDataSet; -import org.openstreetmap.josm.gui.MainApplication; -import org.openstreetmap.josm.gui.NavigatableComponent; -import org.openstreetmap.josm.gui.layer.LayerManager; -import org.openstreetmap.josm.gui.layer.imagery.MVTLayer; -import org.openstreetmap.josm.gui.mappaint.ElemStyles; -import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; -import org.openstreetmap.josm.plugins.mapillary.gui.layer.MapillaryLayer; -import org.openstreetmap.josm.plugins.mapillary.gui.layer.PointObjectLayer; - -public class MapillaryMapRenderer extends StyledMapRenderer { - private static final MapCSSStyleSource styleSource = new MapCSSStyleSource( - "resource://mapcss/MapillaryImagery.mapcss", tr("Mapillary"), tr("Mapillary style sheet")); - private static final ElemStyles styles = new ElemStyles(Collections.singletonList(styleSource)); - - /** - * Constructs a new {@code StyledMapRenderer}. - * - * @param g the graphics context. Must not be null. - * @param nc the map viewport. Must not be null. - * @throws IllegalArgumentException if {@code g} is null - * @throws IllegalArgumentException if {@code nc} is null - */ - public MapillaryMapRenderer(Graphics2D g, NavigatableComponent nc) { - super(g, nc, false); - if (!styleSource.isLoaded()) { - styleSource.loadStyleSource(); - } - this.setStyles(styles); - } - - /** - * Called to clear the style cache when highlights or selections change - */ - public static void selectionOrHighlightChanged() { - styles.clearCached(); - LayerManager lm = MainApplication.getLayerManager(); - Stream - .concat(lm.getLayersOfType(MapillaryLayer.class).stream(), - lm.getLayersOfType(PointObjectLayer.class).stream()) - .map(MVTLayer::getData).forEach(VectorDataSet::clearMappaintCache); - } -} diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayer.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayer.java index 5e7b53092..4a413e6d7 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayer.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayer.java @@ -83,7 +83,6 @@ import org.openstreetmap.josm.plugins.mapillary.data.mapillary.MapillarySequence; import org.openstreetmap.josm.plugins.mapillary.data.mapillary.OrganizationRecord; import org.openstreetmap.josm.plugins.mapillary.data.mapillary.VectorDataSelectionListener; -import org.openstreetmap.josm.plugins.mapillary.data.mapillary.visitor.paint.MapillaryMapRenderer; import org.openstreetmap.josm.plugins.mapillary.gui.dialog.MapillaryFilterDialog; import org.openstreetmap.josm.plugins.mapillary.gui.dialog.OldVersionDialog; import org.openstreetmap.josm.plugins.mapillary.gui.layer.geoimage.MapillaryImageEntry; @@ -831,12 +830,10 @@ public void selectionChanged( new MapillaryNodeDownloader(node, MapillaryLayer.getInstance()::setCurrentImage).execute(); } - MapillaryMapRenderer.selectionOrHighlightChanged(); } @Override public void highlightUpdated(HighlightUpdateEvent e) { - MapillaryMapRenderer.selectionOrHighlightChanged(); this.invalidate(); }