mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-10 20:48:47 +00:00
shapes for standard styles
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@896 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
138cf34224
commit
8cab86e4e2
2 changed files with 9 additions and 24 deletions
|
@ -17,9 +17,6 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Point;
|
import de.schildbach.pte.dto.Point;
|
||||||
import de.schildbach.pte.dto.Style;
|
import de.schildbach.pte.dto.Style;
|
||||||
|
|
||||||
|
@ -28,25 +25,11 @@ import de.schildbach.pte.dto.Style;
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractNetworkProvider implements NetworkProvider
|
public abstract class AbstractNetworkProvider implements NetworkProvider
|
||||||
{
|
{
|
||||||
private static final Map<Character, Style> LINES = new HashMap<Character, Style>();
|
|
||||||
|
|
||||||
static
|
|
||||||
{
|
|
||||||
LINES.put('I', new Style(Style.WHITE, Style.RED, Style.RED));
|
|
||||||
LINES.put('R', new Style(Style.GRAY, Style.WHITE));
|
|
||||||
LINES.put('S', new Style(Style.parseColor("#006e34"), Style.WHITE));
|
|
||||||
LINES.put('U', new Style(Style.parseColor("#003090"), Style.WHITE));
|
|
||||||
LINES.put('T', new Style(Style.parseColor("#cc0000"), Style.WHITE));
|
|
||||||
LINES.put('B', new Style(Style.parseColor("#993399"), Style.WHITE));
|
|
||||||
LINES.put('F', new Style(Style.BLUE, Style.WHITE));
|
|
||||||
LINES.put('?', new Style(Style.DKGRAY, Style.WHITE));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Style lineStyle(final String line)
|
public Style lineStyle(final String line)
|
||||||
{
|
{
|
||||||
if (line.length() == 0)
|
if (line.length() == 0)
|
||||||
return null;
|
return null;
|
||||||
return LINES.get(line.charAt(0));
|
return StandardColors.LINES.get(line.charAt(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Point[] getArea()
|
public Point[] getArea()
|
||||||
|
|
|
@ -21,6 +21,7 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Style;
|
import de.schildbach.pte.dto.Style;
|
||||||
|
import de.schildbach.pte.dto.Style.Shape;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
|
@ -31,12 +32,13 @@ public class StandardColors
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
LINES.put('I', new Style(Style.WHITE, Style.RED, Style.RED));
|
LINES.put('I', new Style(Shape.RECT, Style.WHITE, Style.RED, Style.RED));
|
||||||
LINES.put('R', new Style(Style.GRAY, Style.WHITE));
|
LINES.put('R', new Style(Shape.RECT, Style.GRAY, Style.WHITE));
|
||||||
LINES.put('S', new Style(Style.parseColor("#006e34"), Style.WHITE));
|
LINES.put('S', new Style(Shape.CIRCLE, Style.parseColor("#006e34"), Style.WHITE));
|
||||||
LINES.put('U', new Style(Style.parseColor("#003090"), Style.WHITE));
|
LINES.put('U', new Style(Shape.RECT, Style.parseColor("#003090"), Style.WHITE));
|
||||||
LINES.put('T', new Style(Style.parseColor("#cc0000"), Style.WHITE));
|
LINES.put('T', new Style(Shape.RECT, Style.parseColor("#cc0000"), Style.WHITE));
|
||||||
LINES.put('B', new Style(Style.parseColor("#993399"), Style.WHITE));
|
LINES.put('B', new Style(Style.parseColor("#993399"), Style.WHITE));
|
||||||
LINES.put('F', new Style(Style.BLUE, Style.WHITE));
|
LINES.put('F', new Style(Shape.CIRCLE, Style.BLUE, Style.WHITE));
|
||||||
|
LINES.put('?', new Style(Style.DKGRAY, Style.WHITE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue