From 8bbeb6ad757265796b08e0c32720f10907a4c88d Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Wed, 20 May 2015 22:39:26 +0200 Subject: [PATCH] Two-colored backgrounds for line styles. --- .../src/de/schildbach/pte/BvgProvider.java | 1 + .../src/de/schildbach/pte/MvvProvider.java | 1 + enabler/src/de/schildbach/pte/dto/Style.java | 24 ++++++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/enabler/src/de/schildbach/pte/BvgProvider.java b/enabler/src/de/schildbach/pte/BvgProvider.java index 67264099..cf275c8b 100644 --- a/enabler/src/de/schildbach/pte/BvgProvider.java +++ b/enabler/src/de/schildbach/pte/BvgProvider.java @@ -252,6 +252,7 @@ public final class BvgProvider extends AbstractHafasProvider STYLES.put("UU1", new Style(Shape.RECT, Style.rgb(84, 131, 47), Style.WHITE)); STYLES.put("UU2", new Style(Shape.RECT, Style.rgb(215, 25, 16), Style.WHITE)); + STYLES.put("UU12", new Style(Shape.RECT, Style.rgb(84, 131, 47), Style.rgb(215, 25, 16), Style.WHITE, 0)); STYLES.put("UU3", new Style(Shape.RECT, Style.rgb(47, 152, 154), Style.WHITE)); STYLES.put("UU4", new Style(Shape.RECT, Style.rgb(255, 233, 42), Style.BLACK)); STYLES.put("UU5", new Style(Shape.RECT, Style.rgb(91, 31, 16), Style.WHITE)); diff --git a/enabler/src/de/schildbach/pte/MvvProvider.java b/enabler/src/de/schildbach/pte/MvvProvider.java index e803e077..af506e85 100644 --- a/enabler/src/de/schildbach/pte/MvvProvider.java +++ b/enabler/src/de/schildbach/pte/MvvProvider.java @@ -140,6 +140,7 @@ public class MvvProvider extends AbstractEfaProvider STYLES.put("UU4", new Style(Style.parseColor("#00ccaa"), Style.WHITE)); STYLES.put("UU5", new Style(Style.parseColor("#bb7700"), Style.WHITE)); STYLES.put("UU6", new Style(Style.parseColor("#0000cc"), Style.WHITE)); + STYLES.put("UU7", new Style(Style.parseColor("#227700"), Style.parseColor("#bb0000"), Style.WHITE, 0)); } @Override diff --git a/enabler/src/de/schildbach/pte/dto/Style.java b/enabler/src/de/schildbach/pte/dto/Style.java index 8c61c80c..a77e37b3 100644 --- a/enabler/src/de/schildbach/pte/dto/Style.java +++ b/enabler/src/de/schildbach/pte/dto/Style.java @@ -29,7 +29,7 @@ public class Style implements Serializable private static final long serialVersionUID = 7145603493425043304L; public final Shape shape; - public final int backgroundColor; + public final int backgroundColor, backgroundColor2; public final int foregroundColor; public final int borderColor; @@ -42,6 +42,7 @@ public class Style implements Serializable { this.shape = Shape.ROUNDED; this.backgroundColor = backgroundColor; + this.backgroundColor2 = 0; this.foregroundColor = foregroundColor; this.borderColor = 0; } @@ -50,6 +51,7 @@ public class Style implements Serializable { this.shape = checkNotNull(shape); this.backgroundColor = backgroundColor; + this.backgroundColor2 = 0; this.foregroundColor = foregroundColor; this.borderColor = 0; } @@ -58,6 +60,16 @@ public class Style implements Serializable { this.shape = checkNotNull(shape); this.backgroundColor = backgroundColor; + this.backgroundColor2 = 0; + this.foregroundColor = foregroundColor; + this.borderColor = borderColor; + } + + public Style(final Shape shape, final int backgroundColor, final int backgroundColor2, final int foregroundColor, final int borderColor) + { + this.shape = checkNotNull(shape); + this.backgroundColor = backgroundColor; + this.backgroundColor2 = backgroundColor2; this.foregroundColor = foregroundColor; this.borderColor = borderColor; } @@ -66,6 +78,16 @@ public class Style implements Serializable { this.shape = Shape.ROUNDED; this.backgroundColor = backgroundColor; + this.backgroundColor2 = 0; + this.foregroundColor = foregroundColor; + this.borderColor = borderColor; + } + + public Style(final int backgroundColor, final int backgroundColor2, final int foregroundColor, final int borderColor) + { + this.shape = Shape.ROUNDED; + this.backgroundColor = backgroundColor; + this.backgroundColor2 = backgroundColor2; this.foregroundColor = foregroundColor; this.borderColor = borderColor; }