From 681c38be7ab509a29765be8cc47d5721245a5e25 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Wed, 1 Aug 2012 16:09:32 +0200 Subject: [PATCH] line styles of Freiburg --- .../src/de/schildbach/pte/VagfrProvider.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/enabler/src/de/schildbach/pte/VagfrProvider.java b/enabler/src/de/schildbach/pte/VagfrProvider.java index 53342063..578acc4e 100644 --- a/enabler/src/de/schildbach/pte/VagfrProvider.java +++ b/enabler/src/de/schildbach/pte/VagfrProvider.java @@ -18,10 +18,14 @@ package de.schildbach.pte; import java.io.IOException; +import java.util.HashMap; import java.util.List; +import java.util.Map; import de.schildbach.pte.dto.Location; import de.schildbach.pte.dto.LocationType; +import de.schildbach.pte.dto.Style; +import de.schildbach.pte.dto.Style.Shape; /** * @author Andreas Schildbach @@ -55,4 +59,28 @@ public class VagfrProvider extends AbstractEfaProvider { return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); } + + private static final Map LINES = new HashMap(); + + static + { + // Tram + LINES.put("T1", new Style(Shape.RECT, Style.parseColor("#ed1c24"), Style.WHITE)); + LINES.put("T2", new Style(Shape.RECT, Style.parseColor("#33b540"), Style.WHITE)); + LINES.put("T3", new Style(Shape.RECT, Style.parseColor("#f79210"), Style.WHITE)); + LINES.put("T5", new Style(Shape.RECT, Style.parseColor("#0994ce"), Style.WHITE)); + + // Nachtbus + LINES.put("BN42 Jupiter", new Style(Style.parseColor("#33b540"), Style.WHITE)); + } + + @Override + public Style lineStyle(final String line) + { + final Style style = LINES.get(line); + if (style != null) + return style; + else + return super.lineStyle(line); + } }