aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/maps/CachesOverlay.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/maps/CachesOverlay.java')
-rw-r--r--main/src/cgeo/geocaching/maps/CachesOverlay.java38
1 files changed, 19 insertions, 19 deletions
diff --git a/main/src/cgeo/geocaching/maps/CachesOverlay.java b/main/src/cgeo/geocaching/maps/CachesOverlay.java
index 048217e..9649c0d 100644
--- a/main/src/cgeo/geocaching/maps/CachesOverlay.java
+++ b/main/src/cgeo/geocaching/maps/CachesOverlay.java
@@ -43,13 +43,13 @@ public class CachesOverlay extends AbstractItemizedOverlay {
private List<CachesOverlayItemImpl> items = new ArrayList<>();
private Context context = null;
private boolean displayCircles = false;
- private Progress progress = new Progress();
+ private final Progress progress = new Progress();
private Paint blockedCircle = null;
private PaintFlagsDrawFilter setFilter = null;
private PaintFlagsDrawFilter removeFilter = null;
private MapItemFactory mapItemFactory = null;
- public CachesOverlay(ItemizedOverlayImpl ovlImpl, Context contextIn) {
+ public CachesOverlay(final ItemizedOverlayImpl ovlImpl, final Context contextIn) {
super(ovlImpl);
populate();
@@ -60,19 +60,19 @@ public class CachesOverlay extends AbstractItemizedOverlay {
mapItemFactory = mapProvider.getMapItemFactory();
}
- void updateItems(CachesOverlayItemImpl item) {
- List<CachesOverlayItemImpl> itemsPre = new ArrayList<>();
+ void updateItems(final CachesOverlayItemImpl item) {
+ final List<CachesOverlayItemImpl> itemsPre = new ArrayList<>();
itemsPre.add(item);
updateItems(itemsPre);
}
- void updateItems(List<CachesOverlayItemImpl> itemsPre) {
+ void updateItems(final List<CachesOverlayItemImpl> itemsPre) {
if (itemsPre == null) {
return;
}
- for (CachesOverlayItemImpl item : itemsPre) {
+ for (final CachesOverlayItemImpl item : itemsPre) {
item.setMarker(boundCenterBottom(item.getMarker(0)));
}
@@ -97,7 +97,7 @@ public class CachesOverlay extends AbstractItemizedOverlay {
}
@Override
- public void draw(Canvas canvas, MapViewImpl mapView, boolean shadow) {
+ public void draw(final Canvas canvas, final MapViewImpl mapView, final boolean shadow) {
drawInternal(canvas, mapView.getMapProjection());
@@ -105,15 +105,15 @@ public class CachesOverlay extends AbstractItemizedOverlay {
}
@Override
- public void drawOverlayBitmap(Canvas canvas, Point drawPosition,
- MapProjectionImpl projection, byte drawZoomLevel) {
+ public void drawOverlayBitmap(final Canvas canvas, final Point drawPosition,
+ final MapProjectionImpl projection, final byte drawZoomLevel) {
drawInternal(canvas, projection);
super.drawOverlayBitmap(canvas, drawPosition, projection, drawZoomLevel);
}
- private void drawInternal(Canvas canvas, MapProjectionImpl projection) {
+ private void drawInternal(final Canvas canvas, final MapProjectionImpl projection) {
if (!displayCircles || items.isEmpty()) {
return;
}
@@ -129,7 +129,7 @@ public class CachesOverlay extends AbstractItemizedOverlay {
final int radius = calculateDrawingRadius(projection);
final Point center = new Point();
- for (CachesOverlayItemImpl item : items) {
+ for (final CachesOverlayItemImpl item : items) {
if (item.applyDistanceRule()) {
final Geopoint itemCoord = item.getCoord().getCoords();
final GeoPointImpl itemGeo = mapItemFactory.getGeoPointBase(itemCoord);
@@ -159,8 +159,8 @@ public class CachesOverlay extends AbstractItemizedOverlay {
* levels which are used to see the circles.
*
*/
- private int calculateDrawingRadius(MapProjectionImpl projection) {
- float[] distanceArray = new float[1];
+ private int calculateDrawingRadius(final MapProjectionImpl projection) {
+ final float[] distanceArray = new float[1];
final Geopoint itemCoord = items.get(0).getCoord().getCoords();
Location.distanceBetween(itemCoord.getLatitude(), itemCoord.getLongitude(),
@@ -200,7 +200,7 @@ public class CachesOverlay extends AbstractItemizedOverlay {
}
@Override
- public boolean onTap(int index) {
+ public boolean onTap(final int index) {
try {
if (items.size() <= index) {
@@ -230,7 +230,7 @@ public class CachesOverlay extends AbstractItemizedOverlay {
if (StringUtils.equalsIgnoreCase(coordType, "cache") && StringUtils.isNotBlank(coordinate.getGeocode())) {
final Geocache cache = DataStore.loadCache(coordinate.getGeocode(), LoadFlags.LOAD_CACHE_OR_DB);
if (cache != null) {
- RequestDetailsThread requestDetailsThread = new RequestDetailsThread(cache);
+ final RequestDetailsThread requestDetailsThread = new RequestDetailsThread(cache);
if (!requestDetailsThread.requestRequired()) {
// don't show popup if we have enough details
progress.dismiss();
@@ -251,7 +251,7 @@ public class CachesOverlay extends AbstractItemizedOverlay {
}
progress.dismiss();
- } catch (NotFoundException e) {
+ } catch (final NotFoundException e) {
Log.e("CachesOverlay.onTap", e);
progress.dismiss();
}
@@ -260,10 +260,10 @@ public class CachesOverlay extends AbstractItemizedOverlay {
}
@Override
- public CachesOverlayItemImpl createItem(int index) {
+ public CachesOverlayItemImpl createItem(final int index) {
try {
return items.get(index);
- } catch (Exception e) {
+ } catch (final Exception e) {
Log.e("CachesOverlay.createItem", e);
}
@@ -274,7 +274,7 @@ public class CachesOverlay extends AbstractItemizedOverlay {
public int size() {
try {
return items.size();
- } catch (Exception e) {
+ } catch (final Exception e) {
Log.e("CachesOverlay.size", e);
}