summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMap.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMap.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMap.java
index 09663fe..d61618a 100644
--- a/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMap.java
+++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMap.java
@@ -8,7 +8,7 @@ import com.benburwell.planes.gui.aircraftmap.symbols.*;
import javax.swing.*;
import java.awt.*;
-import java.util.ArrayList;
+import java.util.*;
import java.util.List;
/**
@@ -32,6 +32,12 @@ public class AircraftMap extends JPanel {
public final int MAX_ZOOM_PIXELS_PER_MILE = 2000;
public final double PAN_INTERVAL_MILES = 1.0;
+ // airports
+ public final Set<String> VALID_AIRPORT_TYPES = new HashSet<>(Arrays.asList(new String[]{
+ "large_airport",
+ "medium_airport"
+ }));
+
// instance fields
private List<Drawable> planes = new ArrayList<>();
private List<Drawable> navaids = new ArrayList<>();
@@ -86,9 +92,11 @@ public class AircraftMap extends JPanel {
}
public void addAirports(List<Airport> airports) {
- for (Airport airport : airports) {
+ airports.stream().filter(airport -> {
+ return VALID_AIRPORT_TYPES.contains(airport.getType());
+ }).forEach(airport -> {
this.airports.add(new AirportSymbol(airport));
- }
+ });
}
/**