Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
document individual properties & enum values in Java
Browse files Browse the repository at this point in the history
  • Loading branch information
incanus committed Sep 29, 2016
1 parent b0c7392 commit c58f90a
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
*/
public abstract class Property<T> {

//visibility
/**
* Layer visibility
*/
public static final String VISIBLE = "visible";
public static final String NONE = "none";

Expand All @@ -22,9 +24,14 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface VISIBILITY {}

//line-cap
/**
* `line-cap`: The display of line endings.
*/
//A cap with a squared-off end which is drawn to the exact endpoint of the line.
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.
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.
public static final String LINE_CAP_SQUARE = "square";

@StringDef({
Expand All @@ -35,9 +42,14 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface LINE_CAP {}

//line-join
/**
* `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.
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.
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.
public static final String LINE_JOIN_MITER = "miter";

@StringDef({
Expand All @@ -48,8 +60,12 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface LINE_JOIN {}

//symbol-placement
/**
* `symbol-placement`: Label placement relative to its geometry.
*/
//The label is placed at the point where the geometry is located.
public static final String SYMBOL_PLACEMENT_POINT = "point";
//The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries.
public static final String SYMBOL_PLACEMENT_LINE = "line";

@StringDef({
Expand All @@ -59,9 +75,14 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface SYMBOL_PLACEMENT {}

//icon-rotation-alignment
/**
* `icon-rotation-alignment`: In combination with `symbol-placement`, determines the rotation behavior of icons.
*/
//When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `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 `symbol-placement`.
public static final String ICON_ROTATION_ALIGNMENT_VIEWPORT = "viewport";
//When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line`, this is equivalent to `map`.
public static final String ICON_ROTATION_ALIGNMENT_AUTO = "auto";

@StringDef({
Expand All @@ -72,10 +93,16 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface ICON_ROTATION_ALIGNMENT {}

//icon-text-fit
/**
* `icon-text-fit`: Scales the icon to fit around the associated text.
*/
//The icon is displayed at its intrinsic aspect ratio.
public static final String ICON_TEXT_FIT_NONE = "none";
//The icon is scaled in the x-dimension to fit the width of the text.
public static final String ICON_TEXT_FIT_WIDTH = "width";
//The icon is scaled in the y-dimension to fit the height of the text.
public static final String ICON_TEXT_FIT_HEIGHT = "height";
//The icon is scaled in both x- and y-dimensions.
public static final String ICON_TEXT_FIT_BOTH = "both";

@StringDef({
Expand All @@ -87,9 +114,14 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface ICON_TEXT_FIT {}

//text-pitch-alignment
/**
* `text-pitch-alignment`: Orientation of text when map is pitched.
*/
//The text is aligned to the plane of the map.
public static final String TEXT_PITCH_ALIGNMENT_MAP = "map";
//The text is aligned to the plane of the viewport.
public static final String TEXT_PITCH_ALIGNMENT_VIEWPORT = "viewport";
//Automatically matches the value of `text-rotation-alignment`.
public static final String TEXT_PITCH_ALIGNMENT_AUTO = "auto";

@StringDef({
Expand All @@ -100,9 +132,14 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface TEXT_PITCH_ALIGNMENT {}

//text-rotation-alignment
/**
* `text-rotation-alignment`: In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.
*/
//When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `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 `symbol-placement`.
public static final String TEXT_ROTATION_ALIGNMENT_VIEWPORT = "viewport";
//When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line`, this is equivalent to `map`.
public static final String TEXT_ROTATION_ALIGNMENT_AUTO = "auto";

@StringDef({
Expand All @@ -113,9 +150,14 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface TEXT_ROTATION_ALIGNMENT {}

//text-justify
/**
* `text-justify`: Text justification options.
*/
//The text is aligned to the left.
public static final String TEXT_JUSTIFY_LEFT = "left";
//The text is centered.
public static final String TEXT_JUSTIFY_CENTER = "center";
//The text is aligned to the right.
public static final String TEXT_JUSTIFY_RIGHT = "right";

@StringDef({
Expand All @@ -126,15 +168,26 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface TEXT_JUSTIFY {}

//text-anchor
/**
* `text-anchor`: Part of the text placed closest to the anchor.
*/
//The center of the text is placed closest to the anchor.
public static final String TEXT_ANCHOR_CENTER = "center";
//The left side of the text is placed closest to the anchor.
public static final String TEXT_ANCHOR_LEFT = "left";
//The right side of the text is placed closest to the anchor.
public static final String TEXT_ANCHOR_RIGHT = "right";
//The top of the text is placed closest to the anchor.
public static final String TEXT_ANCHOR_TOP = "top";
//The bottom of the text is placed closest to the anchor.
public static final String TEXT_ANCHOR_BOTTOM = "bottom";
//The top left corner of the text is placed closest to the anchor.
public static final String TEXT_ANCHOR_TOP_LEFT = "top-left";
//The top right corner of the text is placed closest to the anchor.
public static final String TEXT_ANCHOR_TOP_RIGHT = "top-right";
//The bottom left corner of the text is placed closest to the anchor.
public static final String TEXT_ANCHOR_BOTTOM_LEFT = "bottom-left";
//The bottom right corner of the text is placed closest to the anchor.
public static final String TEXT_ANCHOR_BOTTOM_RIGHT = "bottom-right";

@StringDef({
Expand All @@ -151,9 +204,14 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface TEXT_ANCHOR {}

//text-transform
/**
* `text-transform`: Specifies how to capitalize text, similar to the CSS `text-transform` property.
*/
//The text is not altered.
public static final String TEXT_TRANSFORM_NONE = "none";
//Forces all letters to be displayed in uppercase.
public static final String TEXT_TRANSFORM_UPPERCASE = "uppercase";
//Forces all letters to be displayed in lowercase.
public static final String TEXT_TRANSFORM_LOWERCASE = "lowercase";

@StringDef({
Expand All @@ -164,8 +222,12 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface TEXT_TRANSFORM {}

//fill-translate-anchor
/**
* `fill-translate-anchor`: Controls the translation reference point.
*/
//The fill is translated relative to the map.
public static final String FILL_TRANSLATE_ANCHOR_MAP = "map";
//The fill is translated relative to the viewport.
public static final String FILL_TRANSLATE_ANCHOR_VIEWPORT = "viewport";

@StringDef({
Expand All @@ -175,8 +237,12 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface FILL_TRANSLATE_ANCHOR {}

//line-translate-anchor
/**
* `line-translate-anchor`: Controls the translation reference point.
*/
//The line is translated relative to the map.
public static final String LINE_TRANSLATE_ANCHOR_MAP = "map";
//The line is translated relative to the viewport.
public static final String LINE_TRANSLATE_ANCHOR_VIEWPORT = "viewport";

@StringDef({
Expand All @@ -186,8 +252,12 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface LINE_TRANSLATE_ANCHOR {}

//icon-translate-anchor
/**
* `icon-translate-anchor`: Controls the translation reference point.
*/
//Icons are translated relative to the map.
public static final String ICON_TRANSLATE_ANCHOR_MAP = "map";
//Icons are translated relative to the viewport.
public static final String ICON_TRANSLATE_ANCHOR_VIEWPORT = "viewport";

@StringDef({
Expand All @@ -197,8 +267,12 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface ICON_TRANSLATE_ANCHOR {}

//text-translate-anchor
/**
* `text-translate-anchor`: Controls the translation reference point.
*/
//The text is translated relative to the map.
public static final String TEXT_TRANSLATE_ANCHOR_MAP = "map";
//The text is translated relative to the viewport.
public static final String TEXT_TRANSLATE_ANCHOR_VIEWPORT = "viewport";

@StringDef({
Expand All @@ -208,8 +282,12 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface TEXT_TRANSLATE_ANCHOR {}

//circle-translate-anchor
/**
* `circle-translate-anchor`: Controls the translation reference point.
*/
//The circle is translated relative to the map.
public static final String CIRCLE_TRANSLATE_ANCHOR_MAP = "map";
//The circle is translated relative to the viewport.
public static final String CIRCLE_TRANSLATE_ANCHOR_VIEWPORT = "viewport";

@StringDef({
Expand All @@ -219,8 +297,12 @@ public abstract class Property<T> {
@Retention(RetentionPolicy.SOURCE)
public @interface CIRCLE_TRANSLATE_ANCHOR {}

//circle-pitch-scale
/**
* `circle-pitch-scale`: Controls the scaling behavior of the circle when the map is pitched.
*/
//Circles are scaled according to their apparent distance to the camera.
public static final String CIRCLE_PITCH_SCALE_MAP = "map";
//Circles are not scaled.
public static final String CIRCLE_PITCH_SCALE_VIEWPORT = "viewport";

@StringDef({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import java.lang.annotation.RetentionPolicy;
*/
public abstract class Property<T> {

//visibility
/**
* Layer visibility
*/
public static final String VISIBLE = "visible";
public static final String NONE = "none";

Expand All @@ -26,8 +28,11 @@ public abstract class Property<T> {
public @interface VISIBILITY {}

<% for (const property of properties) { -%>
//<%- property.name %>
<% for (const value of Object.keys(property.values)) { -%>
/**
* `<%- property.name %>`: <%- property.doc %>
*/
<% for (const value in property.values) { -%>
//<%- property.values[value].doc %>
public static final String <%- snakeCaseUpper(property.name) %>_<%- snakeCaseUpper(value) %> = "<%- value %>";
<% } -%>
Expand Down

0 comments on commit c58f90a

Please sign in to comment.