mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 16:29:51 +00:00
dedicated style dto rather than int[]
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@888 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
473464fa11
commit
b97376570a
16 changed files with 450 additions and 424 deletions
|
@ -24,7 +24,7 @@ import java.util.Map;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.Color;
|
||||
import de.schildbach.pte.dto.Style;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -74,63 +74,63 @@ public class KvvProvider extends AbstractEfaProvider
|
|||
return super.parseLine(mot, name, longName, noTrainName);
|
||||
}
|
||||
|
||||
private static final Map<String, int[]> LINES = new HashMap<String, int[]>();
|
||||
private static final Map<String, Style> LINES = new HashMap<String, Style>();
|
||||
|
||||
static
|
||||
{
|
||||
// S-Bahn
|
||||
LINES.put("SS1", new int[] { Color.parseColor("#00a76d"), Color.WHITE });
|
||||
LINES.put("SS11", new int[] { Color.parseColor("#00a76d"), Color.WHITE });
|
||||
LINES.put("SS2", new int[] { Color.parseColor("#a066aa"), Color.WHITE });
|
||||
LINES.put("SS3", new int[] { Color.parseColor("#00a99d"), Color.WHITE });
|
||||
LINES.put("SS31", new int[] { Color.parseColor("#00a99d"), Color.WHITE });
|
||||
LINES.put("SS32", new int[] { Color.parseColor("#00a99d"), Color.WHITE });
|
||||
LINES.put("SS33", new int[] { Color.parseColor("#00a99d"), Color.WHITE });
|
||||
LINES.put("SS4", new int[] { Color.parseColor("#9f184c"), Color.WHITE });
|
||||
LINES.put("SS41", new int[] { Color.parseColor("#9f184c"), Color.WHITE });
|
||||
LINES.put("SS5", new int[] { Color.parseColor("#f69795"), Color.BLACK });
|
||||
LINES.put("SS51", new int[] { Color.parseColor("#f69795"), Color.BLACK });
|
||||
LINES.put("SS52", new int[] { Color.parseColor("#f69795"), Color.BLACK });
|
||||
LINES.put("SS6", new int[] { Color.parseColor("#282268"), Color.WHITE });
|
||||
LINES.put("SS7", new int[] { Color.parseColor("#fff200"), Color.BLACK });
|
||||
LINES.put("SS8", new int[] { Color.parseColor("#6e692a"), Color.WHITE });
|
||||
LINES.put("SS9", new int[] { Color.parseColor("#fab49b"), Color.BLACK });
|
||||
LINES.put("SS1", new Style(Style.parseColor("#00a76d"), Style.WHITE));
|
||||
LINES.put("SS11", new Style(Style.parseColor("#00a76d"), Style.WHITE));
|
||||
LINES.put("SS2", new Style(Style.parseColor("#a066aa"), Style.WHITE));
|
||||
LINES.put("SS3", new Style(Style.parseColor("#00a99d"), Style.WHITE));
|
||||
LINES.put("SS31", new Style(Style.parseColor("#00a99d"), Style.WHITE));
|
||||
LINES.put("SS32", new Style(Style.parseColor("#00a99d"), Style.WHITE));
|
||||
LINES.put("SS33", new Style(Style.parseColor("#00a99d"), Style.WHITE));
|
||||
LINES.put("SS4", new Style(Style.parseColor("#9f184c"), Style.WHITE));
|
||||
LINES.put("SS41", new Style(Style.parseColor("#9f184c"), Style.WHITE));
|
||||
LINES.put("SS5", new Style(Style.parseColor("#f69795"), Style.BLACK));
|
||||
LINES.put("SS51", new Style(Style.parseColor("#f69795"), Style.BLACK));
|
||||
LINES.put("SS52", new Style(Style.parseColor("#f69795"), Style.BLACK));
|
||||
LINES.put("SS6", new Style(Style.parseColor("#282268"), Style.WHITE));
|
||||
LINES.put("SS7", new Style(Style.parseColor("#fff200"), Style.BLACK));
|
||||
LINES.put("SS8", new Style(Style.parseColor("#6e692a"), Style.WHITE));
|
||||
LINES.put("SS9", new Style(Style.parseColor("#fab49b"), Style.BLACK));
|
||||
|
||||
// Tram
|
||||
LINES.put("T1", new int[] { Color.parseColor("#ed1c24"), Color.WHITE });
|
||||
LINES.put("T2", new int[] { Color.parseColor("#0071bc"), Color.WHITE });
|
||||
LINES.put("T2E", new int[] { Color.parseColor("#0071bc"), Color.WHITE });
|
||||
LINES.put("T3", new int[] { Color.parseColor("#947139"), Color.WHITE });
|
||||
LINES.put("T4", new int[] { Color.parseColor("#ffcb04"), Color.BLACK });
|
||||
LINES.put("T5", new int[] { Color.parseColor("#00c0f3"), Color.WHITE });
|
||||
LINES.put("T6", new int[] { Color.parseColor("#80c342"), Color.WHITE });
|
||||
LINES.put("T7", new int[] { Color.parseColor("#58595b"), Color.WHITE });
|
||||
LINES.put("T8", new int[] { Color.parseColor("#f7931d"), Color.BLACK });
|
||||
LINES.put("T1", new Style(Style.parseColor("#ed1c24"), Style.WHITE));
|
||||
LINES.put("T2", new Style(Style.parseColor("#0071bc"), Style.WHITE));
|
||||
LINES.put("T2E", new Style(Style.parseColor("#0071bc"), Style.WHITE));
|
||||
LINES.put("T3", new Style(Style.parseColor("#947139"), Style.WHITE));
|
||||
LINES.put("T4", new Style(Style.parseColor("#ffcb04"), Style.BLACK));
|
||||
LINES.put("T5", new Style(Style.parseColor("#00c0f3"), Style.WHITE));
|
||||
LINES.put("T6", new Style(Style.parseColor("#80c342"), Style.WHITE));
|
||||
LINES.put("T7", new Style(Style.parseColor("#58595b"), Style.WHITE));
|
||||
LINES.put("T8", new Style(Style.parseColor("#f7931d"), Style.BLACK));
|
||||
|
||||
// Nightliner
|
||||
LINES.put("BNL3", new int[] { Color.parseColor("#947139"), Color.WHITE });
|
||||
LINES.put("BNL4", new int[] { Color.parseColor("#ffcb04"), Color.BLACK });
|
||||
LINES.put("BNL5", new int[] { Color.parseColor("#00c0f3"), Color.WHITE });
|
||||
LINES.put("BNL6", new int[] { Color.parseColor("#80c342"), Color.WHITE });
|
||||
LINES.put("BNL3", new Style(Style.parseColor("#947139"), Style.WHITE));
|
||||
LINES.put("BNL4", new Style(Style.parseColor("#ffcb04"), Style.BLACK));
|
||||
LINES.put("BNL5", new Style(Style.parseColor("#00c0f3"), Style.WHITE));
|
||||
LINES.put("BNL6", new Style(Style.parseColor("#80c342"), Style.WHITE));
|
||||
|
||||
// Anruf-Linien-Taxi
|
||||
LINES.put("BALT6", new int[] { Color.BLACK, Color.YELLOW });
|
||||
LINES.put("BALT11", new int[] { Color.BLACK, Color.YELLOW });
|
||||
LINES.put("BALT12", new int[] { Color.BLACK, Color.YELLOW });
|
||||
LINES.put("BALT13", new int[] { Color.BLACK, Color.YELLOW });
|
||||
LINES.put("BALT14", new int[] { Color.BLACK, Color.YELLOW });
|
||||
LINES.put("BALT16", new int[] { Color.BLACK, Color.YELLOW });
|
||||
LINES.put("BALT6", new Style(Style.BLACK, Style.YELLOW));
|
||||
LINES.put("BALT11", new Style(Style.BLACK, Style.YELLOW));
|
||||
LINES.put("BALT12", new Style(Style.BLACK, Style.YELLOW));
|
||||
LINES.put("BALT13", new Style(Style.BLACK, Style.YELLOW));
|
||||
LINES.put("BALT14", new Style(Style.BLACK, Style.YELLOW));
|
||||
LINES.put("BALT16", new Style(Style.BLACK, Style.YELLOW));
|
||||
|
||||
// TODO Bus, but needs shape for disambiguation
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] lineColors(final String line)
|
||||
public Style lineStyle(final String line)
|
||||
{
|
||||
final int[] lineColors = LINES.get(line);
|
||||
if (lineColors != null)
|
||||
return lineColors;
|
||||
final Style style = LINES.get(line);
|
||||
if (style != null)
|
||||
return style;
|
||||
else
|
||||
return super.lineColors(line);
|
||||
return super.lineStyle(line);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue