diff options
author | Ben Burwell <ben.burwell@trifecta.com> | 2016-11-19 23:23:34 -0500 |
---|---|---|
committer | Ben Burwell <ben.burwell@trifecta.com> | 2016-11-19 23:23:34 -0500 |
commit | d5fddf794c2fdc0ebad0f9625ed413158d3adc4b (patch) | |
tree | 17f88b06d25b9e2a77da788f566993c821602c76 | |
parent | c893302e307b6471b8c3c7f57f46b6c92e7a55ef (diff) |
Only show large and medium airports
-rw-r--r-- | src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMap.java | 14 |
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)); - } + }); } /** |