From 7f607160ca919bd68628d867f0a80972c7a471ae Mon Sep 17 00:00:00 2001 From: Anthony Chaput Date: Sun, 1 Oct 2017 16:22:07 +0200 Subject: [PATCH] FRANCESOUTHWEST, FRANCESOUTHEAST, FRANCENORTHEAST: Remove getLineStyle() overrides. --- .../pte/FranceNorthEastProvider.java | 33 ----------------- .../pte/FranceSouthEastProvider.java | 36 ------------------- .../pte/FranceSouthWestProvider.java | 36 ------------------- .../live/FranceSouthEastProviderLiveTest.java | 7 +++- 4 files changed, 6 insertions(+), 106 deletions(-) diff --git a/src/de/schildbach/pte/FranceNorthEastProvider.java b/src/de/schildbach/pte/FranceNorthEastProvider.java index 1961604d..72e72ee9 100644 --- a/src/de/schildbach/pte/FranceNorthEastProvider.java +++ b/src/de/schildbach/pte/FranceNorthEastProvider.java @@ -47,37 +47,4 @@ public class FranceNorthEastProvider extends AbstractNavitiaProvider { public String region() { return API_REGION; } - - @Override - protected Style getLineStyle(final String network, final Product product, final String code, final String color) { - switch (product) { - case REGIONAL_TRAIN: { - // Rail (route_type = 2) for TER and Corail Intercité/Lunéa (all SNCF) - return new Style(Style.parseColor(color), computeForegroundColor(color)); - } - case SUBURBAN_TRAIN: { - // Rail (route_type = 2) for Transilien (SNCF) - return new Style(Style.parseColor(color), computeForegroundColor(color)); - } - case TRAM: { - // Tram (route_type = 0) for Strasboug (CTS) and Nancy (Stan) - return new Style(Shape.RECT, Style.parseColor(color), computeForegroundColor(color)); - } - case BUS: { - // Bus (route_type = 3) - return new Style(Shape.ROUNDED, Style.parseColor(color), computeForegroundColor(color)); - } - case SUBWAY: { - // Subway (route_type = 1) for Lille (Transpole) - return new Style(Shape.CIRCLE, Style.TRANSPARENT, Style.parseColor(color), Style.parseColor(color)); - } - default: - throw new IllegalArgumentException("Unhandled product: " + product); - } - } - - @Override - protected String getAddressName(final String name, final String houseNumber) { - return houseNumber + " " + name; - } } diff --git a/src/de/schildbach/pte/FranceSouthEastProvider.java b/src/de/schildbach/pte/FranceSouthEastProvider.java index 448e7fe5..d224c488 100644 --- a/src/de/schildbach/pte/FranceSouthEastProvider.java +++ b/src/de/schildbach/pte/FranceSouthEastProvider.java @@ -45,40 +45,4 @@ public class FranceSouthEastProvider extends AbstractNavitiaProvider { public String region() { return API_REGION; } - - @Override - protected Style getLineStyle(final String network, final Product product, final String code, final String color) { - switch (product) { - case REGIONAL_TRAIN: { - // TER + Intercités - return new Style(Style.parseColor(color), computeForegroundColor(color)); - } - case SUBURBAN_TRAIN: { - return new Style(Style.parseColor(color), computeForegroundColor(color)); - } - case TRAM: { - // Tram - return new Style(Shape.CIRCLE, Style.TRANSPARENT, Style.parseColor(color), Style.parseColor(color)); - } - case BUS: { - // Bus + Transgironde - return new Style(Shape.ROUNDED, Style.parseColor(color), computeForegroundColor(color)); - } - case FERRY: { - // Batcub - return new Style(Shape.ROUNDED, Style.parseColor(color), computeForegroundColor(color)); - } - case SUBWAY: { - // Toulouse subway (from Tisseo network) - return new Style(Shape.ROUNDED, Style.parseColor(color), computeForegroundColor(color)); - } - default: - return super.getLineStyle(network, product, code, color); - } - } - - @Override - protected String getAddressName(final String name, final String houseNumber) { - return houseNumber + " " + name; - } } diff --git a/src/de/schildbach/pte/FranceSouthWestProvider.java b/src/de/schildbach/pte/FranceSouthWestProvider.java index eab42e17..1e0597af 100644 --- a/src/de/schildbach/pte/FranceSouthWestProvider.java +++ b/src/de/schildbach/pte/FranceSouthWestProvider.java @@ -45,40 +45,4 @@ public class FranceSouthWestProvider extends AbstractNavitiaProvider { public String region() { return API_REGION; } - - @Override - protected Style getLineStyle(final String network, final Product product, final String code, final String color) { - switch (product) { - case REGIONAL_TRAIN: { - // TER + Intercités - return new Style(Style.parseColor(color), computeForegroundColor(color)); - } - case SUBURBAN_TRAIN: { - return new Style(Style.parseColor(color), computeForegroundColor(color)); - } - case TRAM: { - // Tram - return new Style(Shape.CIRCLE, Style.TRANSPARENT, Style.parseColor(color), Style.parseColor(color)); - } - case BUS: { - // Bus + Transgironde - return new Style(Shape.ROUNDED, Style.parseColor(color), computeForegroundColor(color)); - } - case FERRY: { - // Batcub - return new Style(Shape.ROUNDED, Style.parseColor(color), computeForegroundColor(color)); - } - case SUBWAY: { - // Toulouse subway (from Tisseo network) - return new Style(Shape.ROUNDED, Style.parseColor(color), computeForegroundColor(color)); - } - default: - return super.getLineStyle(network, product, code, color); - } - } - - @Override - protected String getAddressName(final String name, final String houseNumber) { - return houseNumber + " " + name; - } } diff --git a/test/de/schildbach/pte/live/FranceSouthEastProviderLiveTest.java b/test/de/schildbach/pte/live/FranceSouthEastProviderLiveTest.java index e9340757..b50918b7 100644 --- a/test/de/schildbach/pte/live/FranceSouthEastProviderLiveTest.java +++ b/test/de/schildbach/pte/live/FranceSouthEastProviderLiveTest.java @@ -103,7 +103,12 @@ public class FranceSouthEastProviderLiveTest extends AbstractNavitiaProviderLive @Test public void queryTripAddressStation() throws Exception { - queryTrip("14 rue Barnave", "Louise Michel"); + queryTrip("78 Quai Pierre Scize", "Bellecour"); + } + + @Test + public void queryTripTowns() throws Exception { + queryTrip("Annecy", "Lyon"); } @Test