// Helper method that will check if a city marker was clicked on // and respond appropriately private void checkCitiesForClick() { if (lastClicked != null) return; // Loop over the earthquake markers to see if one of them is selected for (Marker marker : cityMarkers) { if (!marker.isHidden() && marker.isInside(map, mouseX, mouseY)) { lastClicked = (CommonMarker) marker; // Hide all the other earthquakes and hide for (Marker mhide : cityMarkers) { if (mhide != lastClicked) { mhide.setHidden(true); } } for (Marker mhide : quakeMarkers) { EarthquakeMarker quakeMarker = (EarthquakeMarker) mhide; if (quakeMarker.getDistanceTo(marker.getLocation()) > quakeMarker.threatCircle()) { quakeMarker.setHidden(true); } } return; } } }