/** removes any highlighting that may have been set beforehand. */ private void removeHighlighting() { highlightHelper.clear(); DataSet ds = getCurrentDataSet(); if (ds != null) { ds.clearHighlightedWaySegments(); } }
private void repaintIfRequired( Set<OsmPrimitive> newHighlights, WaySegment newHighlightedWaySegment) { boolean needsRepaint = false; DataSet ds = getCurrentDataSet(); if (newHighlightedWaySegment == null && oldHighlightedWaySegment != null) { if (ds != null) { ds.clearHighlightedWaySegments(); needsRepaint = true; } oldHighlightedWaySegment = null; } else if (newHighlightedWaySegment != null && !newHighlightedWaySegment.equals(oldHighlightedWaySegment)) { if (ds != null) { ds.setHighlightedWaySegments(Collections.singleton(newHighlightedWaySegment)); needsRepaint = true; } oldHighlightedWaySegment = newHighlightedWaySegment; } needsRepaint |= highlightHelper.highlightOnly(newHighlights); if (needsRepaint) { Main.map.mapView.repaint(); } }