summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-01-17 17:43:49 +0200
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-02-02 09:44:42 -0800
commitf562ecdfc3a08f7b9b0c2be938f237852a82d374 (patch)
tree71c3ceb4b2a877d124f4b069fa80156d701a6125 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java
parent8a5bff8ee630673c6ebc496322eab94a41ae9353 (diff)
downloadqtlocation-mapboxgl-f562ecdfc3a08f7b9b0c2be938f237852a82d374.tar.gz
[android] data driven style implementation
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java267
1 files changed, 116 insertions, 151 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java
index d298b62392..641ee551a2 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/Property.java
@@ -1,6 +1,7 @@
-package com.mapbox.mapboxsdk.style.layers;
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.
+package com.mapbox.mapboxsdk.style.layers;
+
import android.support.annotation.StringDef;
import java.lang.annotation.Retention;
@@ -9,7 +10,7 @@ import java.lang.annotation.RetentionPolicy;
/**
* Paint/Layout properties for Layer
*/
-public abstract class Property<T> {
+public final class Property {
// VISIBILITY: Whether this layer is displayed.
@@ -22,13 +23,12 @@ public abstract class Property<T> {
*/
public static final String NONE = "none";
- @StringDef( {
- VISIBLE,
- NONE
+ @StringDef({
+ VISIBLE,
+ NONE
})
@Retention(RetentionPolicy.SOURCE)
- public @interface VISIBILITY {
- }
+ public @interface VISIBILITY {}
// LINE_CAP: The display of line endings.
@@ -37,57 +37,50 @@ public abstract class Property<T> {
*/
public static final String LINE_CAP_BUTT = "butt";
/**
- * A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's
- * width and centered on the endpoint of the line.
+ * A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
*/
public static final String LINE_CAP_ROUND = "round";
/**
- * A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the
- * line's width.
+ * A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
*/
public static final String LINE_CAP_SQUARE = "square";
/**
* The display of line endings.
*/
- @StringDef( {
- LINE_CAP_BUTT,
- LINE_CAP_ROUND,
- LINE_CAP_SQUARE,
- })
+ @StringDef({
+ LINE_CAP_BUTT,
+ LINE_CAP_ROUND,
+ LINE_CAP_SQUARE,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface LINE_CAP {
- }
+ public @interface LINE_CAP {}
// LINE_JOIN: The display of lines when joining.
/**
- * A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the
- * line's width.
+ * A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
*/
public static final String LINE_JOIN_BEVEL = "bevel";
/**
- * A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's
- * width and centered on the endpoint of the line.
+ * A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
*/
public static final String LINE_JOIN_ROUND = "round";
/**
- * A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until
- * they meet.
+ * A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.
*/
public static final String LINE_JOIN_MITER = "miter";
/**
* The display of lines when joining.
*/
- @StringDef( {
- LINE_JOIN_BEVEL,
- LINE_JOIN_ROUND,
- LINE_JOIN_MITER,
- })
+ @StringDef({
+ LINE_JOIN_BEVEL,
+ LINE_JOIN_ROUND,
+ LINE_JOIN_MITER,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface LINE_JOIN {
- }
+ public @interface LINE_JOIN {}
// SYMBOL_PLACEMENT: Label placement relative to its geometry.
@@ -103,44 +96,38 @@ public abstract class Property<T> {
/**
* Label placement relative to its geometry.
*/
- @StringDef( {
- SYMBOL_PLACEMENT_POINT,
- SYMBOL_PLACEMENT_LINE,
- })
+ @StringDef({
+ SYMBOL_PLACEMENT_POINT,
+ SYMBOL_PLACEMENT_LINE,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface SYMBOL_PLACEMENT {
- }
+ public @interface SYMBOL_PLACEMENT {}
// ICON_ROTATION_ALIGNMENT: In combination with `symbol-placement`, determines the rotation behavior of icons.
/**
- * When {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_POINT}, aligns icons east-west. When
- * {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_LINE}, aligns icon x-axes with the line.
+ * When {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_POINT}, aligns icons east-west. When {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_LINE}, aligns icon x-axes with the line.
*/
public static final String ICON_ROTATION_ALIGNMENT_MAP = "map";
/**
- * Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of
- * {@link SYMBOL_PLACEMENT}.
+ * Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of {@link SYMBOL_PLACEMENT}.
*/
public static final String ICON_ROTATION_ALIGNMENT_VIEWPORT = "viewport";
/**
- * When {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_POINT}, this is equivalent to
- * {@link Property#ICON_ROTATION_ALIGNMENT_VIEWPORT}. When {@link SYMBOL_PLACEMENT} is set to
- * {@link Property#SYMBOL_PLACEMENT_LINE}, this is equivalent to {@link Property#ICON_ROTATION_ALIGNMENT_MAP}.
+ * When {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_POINT}, this is equivalent to {@link Property#ICON_ROTATION_ALIGNMENT_VIEWPORT}. When {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_LINE}, this is equivalent to {@link Property#ICON_ROTATION_ALIGNMENT_MAP}.
*/
public static final String ICON_ROTATION_ALIGNMENT_AUTO = "auto";
/**
* In combination with `symbol-placement`, determines the rotation behavior of icons.
*/
- @StringDef( {
- ICON_ROTATION_ALIGNMENT_MAP,
- ICON_ROTATION_ALIGNMENT_VIEWPORT,
- ICON_ROTATION_ALIGNMENT_AUTO,
- })
+ @StringDef({
+ ICON_ROTATION_ALIGNMENT_MAP,
+ ICON_ROTATION_ALIGNMENT_VIEWPORT,
+ ICON_ROTATION_ALIGNMENT_AUTO,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface ICON_ROTATION_ALIGNMENT {
- }
+ public @interface ICON_ROTATION_ALIGNMENT {}
// ICON_TEXT_FIT: Scales the icon to fit around the associated text.
@@ -164,15 +151,14 @@ public abstract class Property<T> {
/**
* Scales the icon to fit around the associated text.
*/
- @StringDef( {
- ICON_TEXT_FIT_NONE,
- ICON_TEXT_FIT_WIDTH,
- ICON_TEXT_FIT_HEIGHT,
- ICON_TEXT_FIT_BOTH,
- })
+ @StringDef({
+ ICON_TEXT_FIT_NONE,
+ ICON_TEXT_FIT_WIDTH,
+ ICON_TEXT_FIT_HEIGHT,
+ ICON_TEXT_FIT_BOTH,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface ICON_TEXT_FIT {
- }
+ public @interface ICON_TEXT_FIT {}
// TEXT_PITCH_ALIGNMENT: Orientation of text when map is pitched.
@@ -192,46 +178,39 @@ public abstract class Property<T> {
/**
* Orientation of text when map is pitched.
*/
- @StringDef( {
- TEXT_PITCH_ALIGNMENT_MAP,
- TEXT_PITCH_ALIGNMENT_VIEWPORT,
- TEXT_PITCH_ALIGNMENT_AUTO,
- })
+ @StringDef({
+ TEXT_PITCH_ALIGNMENT_MAP,
+ TEXT_PITCH_ALIGNMENT_VIEWPORT,
+ TEXT_PITCH_ALIGNMENT_AUTO,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface TEXT_PITCH_ALIGNMENT {
- }
+ public @interface TEXT_PITCH_ALIGNMENT {}
- // TEXT_ROTATION_ALIGNMENT: In combination with `symbol-placement`, determines the rotation behavior of the individual
- // glyphs forming the text.
+ // TEXT_ROTATION_ALIGNMENT: In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.
/**
- * When {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_POINT}, aligns text east-west. When
- * {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_LINE}, aligns text x-axes with the line.
+ * When {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_POINT}, aligns text east-west. When {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_LINE}, aligns text x-axes with the line.
*/
public static final String TEXT_ROTATION_ALIGNMENT_MAP = "map";
/**
- * Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of
- * {@link SYMBOL_PLACEMENT}.
+ * Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of {@link SYMBOL_PLACEMENT}.
*/
public static final String TEXT_ROTATION_ALIGNMENT_VIEWPORT = "viewport";
/**
- * When {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_POINT}, this is equivalent to
- * {@link Property#TEXT_ROTATION_ALIGNMENT_VIEWPORT}. When {@link SYMBOL_PLACEMENT} is set to
- * {@link Property#SYMBOL_PLACEMENT_LINE}, this is equivalent to {@link Property#TEXT_ROTATION_ALIGNMENT_MAP}.
+ * When {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_POINT}, this is equivalent to {@link Property#TEXT_ROTATION_ALIGNMENT_VIEWPORT}. When {@link SYMBOL_PLACEMENT} is set to {@link Property#SYMBOL_PLACEMENT_LINE}, this is equivalent to {@link Property#TEXT_ROTATION_ALIGNMENT_MAP}.
*/
public static final String TEXT_ROTATION_ALIGNMENT_AUTO = "auto";
/**
* In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.
*/
- @StringDef( {
- TEXT_ROTATION_ALIGNMENT_MAP,
- TEXT_ROTATION_ALIGNMENT_VIEWPORT,
- TEXT_ROTATION_ALIGNMENT_AUTO,
- })
+ @StringDef({
+ TEXT_ROTATION_ALIGNMENT_MAP,
+ TEXT_ROTATION_ALIGNMENT_VIEWPORT,
+ TEXT_ROTATION_ALIGNMENT_AUTO,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface TEXT_ROTATION_ALIGNMENT {
- }
+ public @interface TEXT_ROTATION_ALIGNMENT {}
// TEXT_JUSTIFY: Text justification options.
@@ -251,14 +230,13 @@ public abstract class Property<T> {
/**
* Text justification options.
*/
- @StringDef( {
- TEXT_JUSTIFY_LEFT,
- TEXT_JUSTIFY_CENTER,
- TEXT_JUSTIFY_RIGHT,
- })
+ @StringDef({
+ TEXT_JUSTIFY_LEFT,
+ TEXT_JUSTIFY_CENTER,
+ TEXT_JUSTIFY_RIGHT,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface TEXT_JUSTIFY {
- }
+ public @interface TEXT_JUSTIFY {}
// TEXT_ANCHOR: Part of the text placed closest to the anchor.
@@ -302,20 +280,19 @@ public abstract class Property<T> {
/**
* Part of the text placed closest to the anchor.
*/
- @StringDef( {
- TEXT_ANCHOR_CENTER,
- TEXT_ANCHOR_LEFT,
- TEXT_ANCHOR_RIGHT,
- TEXT_ANCHOR_TOP,
- TEXT_ANCHOR_BOTTOM,
- TEXT_ANCHOR_TOP_LEFT,
- TEXT_ANCHOR_TOP_RIGHT,
- TEXT_ANCHOR_BOTTOM_LEFT,
- TEXT_ANCHOR_BOTTOM_RIGHT,
- })
+ @StringDef({
+ TEXT_ANCHOR_CENTER,
+ TEXT_ANCHOR_LEFT,
+ TEXT_ANCHOR_RIGHT,
+ TEXT_ANCHOR_TOP,
+ TEXT_ANCHOR_BOTTOM,
+ TEXT_ANCHOR_TOP_LEFT,
+ TEXT_ANCHOR_TOP_RIGHT,
+ TEXT_ANCHOR_BOTTOM_LEFT,
+ TEXT_ANCHOR_BOTTOM_RIGHT,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface TEXT_ANCHOR {
- }
+ public @interface TEXT_ANCHOR {}
// TEXT_TRANSFORM: Specifies how to capitalize text, similar to the CSS `text-transform` property.
@@ -335,14 +312,13 @@ public abstract class Property<T> {
/**
* Specifies how to capitalize text, similar to the CSS `text-transform` property.
*/
- @StringDef( {
- TEXT_TRANSFORM_NONE,
- TEXT_TRANSFORM_UPPERCASE,
- TEXT_TRANSFORM_LOWERCASE,
- })
+ @StringDef({
+ TEXT_TRANSFORM_NONE,
+ TEXT_TRANSFORM_UPPERCASE,
+ TEXT_TRANSFORM_LOWERCASE,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface TEXT_TRANSFORM {
- }
+ public @interface TEXT_TRANSFORM {}
// FILL_TRANSLATE_ANCHOR: Controls the translation reference point.
@@ -358,13 +334,12 @@ public abstract class Property<T> {
/**
* Controls the translation reference point.
*/
- @StringDef( {
- FILL_TRANSLATE_ANCHOR_MAP,
- FILL_TRANSLATE_ANCHOR_VIEWPORT,
- })
+ @StringDef({
+ FILL_TRANSLATE_ANCHOR_MAP,
+ FILL_TRANSLATE_ANCHOR_VIEWPORT,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface FILL_TRANSLATE_ANCHOR {
- }
+ public @interface FILL_TRANSLATE_ANCHOR {}
// LINE_TRANSLATE_ANCHOR: Controls the translation reference point.
@@ -380,13 +355,12 @@ public abstract class Property<T> {
/**
* Controls the translation reference point.
*/
- @StringDef( {
- LINE_TRANSLATE_ANCHOR_MAP,
- LINE_TRANSLATE_ANCHOR_VIEWPORT,
- })
+ @StringDef({
+ LINE_TRANSLATE_ANCHOR_MAP,
+ LINE_TRANSLATE_ANCHOR_VIEWPORT,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface LINE_TRANSLATE_ANCHOR {
- }
+ public @interface LINE_TRANSLATE_ANCHOR {}
// ICON_TRANSLATE_ANCHOR: Controls the translation reference point.
@@ -402,13 +376,12 @@ public abstract class Property<T> {
/**
* Controls the translation reference point.
*/
- @StringDef( {
- ICON_TRANSLATE_ANCHOR_MAP,
- ICON_TRANSLATE_ANCHOR_VIEWPORT,
- })
+ @StringDef({
+ ICON_TRANSLATE_ANCHOR_MAP,
+ ICON_TRANSLATE_ANCHOR_VIEWPORT,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface ICON_TRANSLATE_ANCHOR {
- }
+ public @interface ICON_TRANSLATE_ANCHOR {}
// TEXT_TRANSLATE_ANCHOR: Controls the translation reference point.
@@ -424,13 +397,12 @@ public abstract class Property<T> {
/**
* Controls the translation reference point.
*/
- @StringDef( {
- TEXT_TRANSLATE_ANCHOR_MAP,
- TEXT_TRANSLATE_ANCHOR_VIEWPORT,
- })
+ @StringDef({
+ TEXT_TRANSLATE_ANCHOR_MAP,
+ TEXT_TRANSLATE_ANCHOR_VIEWPORT,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface TEXT_TRANSLATE_ANCHOR {
- }
+ public @interface TEXT_TRANSLATE_ANCHOR {}
// CIRCLE_TRANSLATE_ANCHOR: Controls the translation reference point.
@@ -446,13 +418,12 @@ public abstract class Property<T> {
/**
* Controls the translation reference point.
*/
- @StringDef( {
- CIRCLE_TRANSLATE_ANCHOR_MAP,
- CIRCLE_TRANSLATE_ANCHOR_VIEWPORT,
- })
+ @StringDef({
+ CIRCLE_TRANSLATE_ANCHOR_MAP,
+ CIRCLE_TRANSLATE_ANCHOR_VIEWPORT,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface CIRCLE_TRANSLATE_ANCHOR {
- }
+ public @interface CIRCLE_TRANSLATE_ANCHOR {}
// CIRCLE_PITCH_SCALE: Controls the scaling behavior of the circle when the map is pitched.
@@ -468,20 +439,14 @@ public abstract class Property<T> {
/**
* Controls the scaling behavior of the circle when the map is pitched.
*/
- @StringDef( {
- CIRCLE_PITCH_SCALE_MAP,
- CIRCLE_PITCH_SCALE_VIEWPORT,
- })
+ @StringDef({
+ CIRCLE_PITCH_SCALE_MAP,
+ CIRCLE_PITCH_SCALE_VIEWPORT,
+ })
@Retention(RetentionPolicy.SOURCE)
- public @interface CIRCLE_PITCH_SCALE {
- }
+ public @interface CIRCLE_PITCH_SCALE {}
- // Class definition
- public final String name;
- public final T value;
- /* package */ Property(String name, T value) {
- this.name = name;
- this.value = value;
+ private Property() {
}
}