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

@ -20,6 +20,7 @@ package de.schildbach.pte;
import java.util.HashMap;
import java.util.Map;
import de.schildbach.pte.dto.Product;
import de.schildbach.pte.dto.Style;
import de.schildbach.pte.dto.Style.Shape;
@ -28,17 +29,17 @@ import de.schildbach.pte.dto.Style.Shape;
*/
public class Standard
{
public static final Map<Character, Style> STYLES = new HashMap<Character, Style>();
public static final Map<Product, Style> STYLES = new HashMap<Product, Style>();
static
{
STYLES.put('I', new Style(Shape.RECT, Style.WHITE, Style.RED, Style.RED));
STYLES.put('R', new Style(Shape.RECT, Style.GRAY, Style.WHITE));
STYLES.put('S', new Style(Shape.CIRCLE, Style.parseColor("#006e34"), Style.WHITE));
STYLES.put('U', new Style(Shape.RECT, Style.parseColor("#003090"), Style.WHITE));
STYLES.put('T', new Style(Shape.RECT, Style.parseColor("#cc0000"), Style.WHITE));
STYLES.put('B', new Style(Style.parseColor("#993399"), Style.WHITE));
STYLES.put('F', new Style(Shape.CIRCLE, Style.BLUE, Style.WHITE));
STYLES.put('?', new Style(Style.DKGRAY, Style.WHITE));
STYLES.put(Product.HIGH_SPEED_TRAIN, new Style(Shape.RECT, Style.WHITE, Style.RED, Style.RED));
STYLES.put(Product.REGIONAL_TRAIN, new Style(Shape.RECT, Style.GRAY, Style.WHITE));
STYLES.put(Product.SUBURBAN_TRAIN, new Style(Shape.CIRCLE, Style.parseColor("#006e34"), Style.WHITE));
STYLES.put(Product.SUBWAY, new Style(Shape.RECT, Style.parseColor("#003090"), Style.WHITE));
STYLES.put(Product.TRAM, new Style(Shape.RECT, Style.parseColor("#cc0000"), Style.WHITE));
STYLES.put(Product.BUS, new Style(Style.parseColor("#993399"), Style.WHITE));
STYLES.put(Product.FERRY, new Style(Shape.CIRCLE, Style.BLUE, Style.WHITE));
STYLES.put(null, new Style(Style.DKGRAY, Style.WHITE));
}
}