mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-06 15:08:49 +00:00
FRANCESOUTHWEST, FRANCESOUTHEAST, FRANCENORTHEAST: Remove getLineStyle() overrides.
This commit is contained in:
parent
e0be42f16d
commit
7f607160ca
4 changed files with 6 additions and 106 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue