From 46f3cb1df2d24180b9bfddf008798cd695554e28 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Sun, 20 Nov 2016 03:07:14 -0500 Subject: Implement flexible display modes --- .../planes/gui/aircraftmap/symbols/AirportSymbol.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/AirportSymbol.java') diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/AirportSymbol.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/AirportSymbol.java index 7467a0f..7b79e80 100644 --- a/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/AirportSymbol.java +++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/symbols/AirportSymbol.java @@ -3,6 +3,7 @@ package com.benburwell.planes.gui.aircraftmap.symbols; import com.benburwell.planes.data.Airport; import com.benburwell.planes.gui.GraphicsTheme; import com.benburwell.planes.gui.aircraftmap.AircraftMap; +import com.benburwell.planes.gui.aircraftmap.DisplayMode; import com.benburwell.planes.gui.aircraftmap.Drawable; import com.benburwell.planes.gui.aircraftmap.GeoPoint; @@ -34,15 +35,18 @@ public class AirportSymbol extends GeoPoint implements Drawable { } @Override - public void drawOn(Graphics g, AircraftMap map) { - if (this.shouldDrawOn(map)) { + public void drawOn(Graphics g, AircraftMap map, DisplayMode displayMode) { + if (this.shouldDrawOn(map) && !displayMode.equals(DisplayMode.HIDDEN)) { int x = this.getX(map); int y = this.getY(map); g.setColor(GraphicsTheme.Styles.MAP_AIRPORT_COLOR); g.drawRect(x - 2, y - 2, 4, 4); - g.drawString(this.getDisplayName(), x + 6, y); + + if (displayMode.equals(DisplayMode.DETAILED)) { + g.drawString(this.getDisplayName(), x + 6, y); + } } } } -- cgit v1.2.3