Migrate from using char as a product type to Product enum. Line labels are really just the label and can be null.

This commit is contained in:
Andreas Schildbach 2015-01-31 11:48:41 +01:00
parent 7cb4e8fb06
commit 883015177e
52 changed files with 1216 additions and 1238 deletions

View file

@ -17,6 +17,7 @@
package de.schildbach.pte;
import de.schildbach.pte.dto.Product;
import de.schildbach.pte.dto.Style;
import de.schildbach.pte.dto.Style.Shape;
@ -47,11 +48,11 @@ public class ParisProvider extends AbstractNavitiaProvider
}
@Override
protected Style getLineStyle(final char product, final String code, final String color)
protected Style getLineStyle(final Product product, final String code, final String color)
{
switch (product)
{
case 'S':
case SUBURBAN_TRAIN:
{
// RER
if (code.compareTo("F") < 0)
@ -64,17 +65,17 @@ public class ParisProvider extends AbstractNavitiaProvider
return new Style(Shape.ROUNDED, Style.TRANSPARENT, Style.parseColor(color), Style.parseColor(color));
}
}
case 'U':
case SUBWAY:
{
// Metro
return new Style(Shape.CIRCLE, Style.parseColor(color), computeForegroundColor(color));
}
case 'T':
case TRAM:
{
// Tram
return new Style(Shape.RECT, Style.parseColor(color), computeForegroundColor(color));
}
case 'B':
case BUS:
{
// Bus + Noctilien
return new Style(Shape.RECT, Style.parseColor(color), computeForegroundColor(color));