Package journeymap.api.v2.client.model
Class TextProperties
java.lang.Object
journeymap.api.v2.client.model.TextProperties
Properties defining the display of text.
Setters use the Builder pattern so they can be chained.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Set<Context.MapType> protected Set<Context.UI> protected intprotected floatprotected intprotected booleanprotected intprotected intprotected intprotected intprotected floatprotected float -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a set of enums indicating which map types (Day, Night) the text should be active in.Returns a set of enums indicating which JourneyMap UIs (Fullscreen, Minimap, Webmap) the text should be displayed in.intGets background color.floatGets background opacity.intgetColor()Gets the font color.intThe maximum zoom level (UIState.ZOOM_IN_MAX is highest) where text should be visible.intThe minimum zoom level (UIState.FULLSCREEN_ZOOM_MIN is lowest) where the polygon should be visible.intGets how many horizontal pixels to shift the center of the label from the center of the overlay.intGets how many vertical pixels to shift the center of the label from the center of the overlay.floatGets opacity.floatgetScale()Font scale.booleanWhether font shadow should be used.booleanisActiveIn(UIState uiState) Whether the overlay should be active for the given contexts.setActiveMapTypes(Context.MapType... activeMapTypes) Set of enums indicating which JourneyMap map types (Day, Night) the text should be active in.setActiveUIs(Context.UI... activeUIs) Set of enums indicating which JourneyMap UIs (Fullscreen, Minimap, Webmap) the text should be displayed in.setBackgroundColor(int backgroundColor) Sets background color.setBackgroundOpacity(float backgroundOpacity) Sets background opacity.setColor(int color) Sets the font color (rgb).setFontShadow(boolean fontShadow) Sets whether font shadow should be used.setMaxZoom(int maxZoom) Sets the maximum zoom level (UIState.ZOOM_IN_MAX is highest) where the polygon should be visible.setMinZoom(int minZoom) Sets the minimum zoom level (UIState.FULLSCREEN_ZOOM_MIN is lowest) where text should be visible.setOffsetX(int offsetX) Sets how many horizontal pixels to shift the center of the label from the center of the overlay.setOffsetY(int offsetY) Sets how many vertical pixels to shift the center of the label from the center of the overlay.setOpacity(float opacity) Sets opacity.setScale(float scale) Sets the font scale.toString()
-
Field Details
-
activeUIs
-
activeMapTypes
-
scale
protected float scale -
color
protected int color -
backgroundColor
protected int backgroundColor -
opacity
protected float opacity -
backgroundOpacity
protected float backgroundOpacity -
fontShadow
protected boolean fontShadow -
minZoom
protected int minZoom -
maxZoom
protected int maxZoom -
offsetX
protected int offsetX -
offsetY
protected int offsetY
-
-
Constructor Details
-
TextProperties
public TextProperties()
-
-
Method Details
-
getScale
public float getScale()Font scale.- Returns:
- 1 scale
-
setScale
Sets the font scale. Best results are powers of 2: 1,2,4,8. Range is 1f - 8f;- Parameters:
scale- the scale- Returns:
- this
-
getColor
public int getColor()Gets the font color.- Returns:
- rgb color
-
setColor
Sets the font color (rgb). Range is 0x000000 - 0xffffff.- Parameters:
color- rgb- Returns:
- this
-
getBackgroundColor
public int getBackgroundColor()Gets background color.- Returns:
- the background color
-
setBackgroundColor
Sets background color.- Parameters:
backgroundColor- the background color- Returns:
- this
-
getOpacity
public float getOpacity()Gets opacity.- Returns:
- the opacity
-
setOpacity
Sets opacity.- Parameters:
opacity- the opacity- Returns:
- this
-
getBackgroundOpacity
public float getBackgroundOpacity()Gets background opacity.- Returns:
- the background opacity
-
setBackgroundOpacity
Sets background opacity. Range is 0f - 1f.- Parameters:
backgroundOpacity- the background opacity- Returns:
- this
-
hasFontShadow
public boolean hasFontShadow()Whether font shadow should be used.- Returns:
- true if shadowed
-
setFontShadow
Sets whether font shadow should be used.- Parameters:
fontShadow- true if shadow- Returns:
- this
-
getActiveUIs
Returns a set of enums indicating which JourneyMap UIs (Fullscreen, Minimap, Webmap) the text should be displayed in. This is only checked if the overlay containing these text properties is already active.For example, this can be specified to have labels only displayed in the fullscreen map, but not the minimap.
- Returns:
- enumset
-
setActiveUIs
Set of enums indicating which JourneyMap UIs (Fullscreen, Minimap, Webmap) the text should be displayed in. This is only checked if the overlay containing these text properties is already active.For example, this can be specified to have labels only displayed in the fullscreen map, but not the minimap.
- Parameters:
activeUIs- active UIs- Returns:
- this
-
getActiveMapTypes
Returns a set of enums indicating which map types (Day, Night) the text should be active in.- Returns:
- enumset
-
setActiveMapTypes
Set of enums indicating which JourneyMap map types (Day, Night) the text should be active in.- Parameters:
activeMapTypes- active types- Returns:
- this
-
isActiveIn
Whether the overlay should be active for the given contexts.- Parameters:
uiState- UIState- Returns:
- true if the overlay should be active
-
getMinZoom
public int getMinZoom()The minimum zoom level (UIState.FULLSCREEN_ZOOM_MIN is lowest) where the polygon should be visible.- Returns:
- the min zoom
-
setMinZoom
Sets the minimum zoom level (UIState.FULLSCREEN_ZOOM_MIN is lowest) where text should be visible.- Parameters:
minZoom- the min zoom- Returns:
- this
-
getMaxZoom
public int getMaxZoom()The maximum zoom level (UIState.ZOOM_IN_MAX is highest) where text should be visible.- Returns:
- the max zoom
-
setMaxZoom
Sets the maximum zoom level (UIState.ZOOM_IN_MAX is highest) where the polygon should be visible.- Parameters:
maxZoom- the max zoom- Returns:
- this
-
getOffsetX
public int getOffsetX()Gets how many horizontal pixels to shift the center of the label from the center of the overlay. (For MarkerOverlays, the "center" is directly over MarkerOverlay.getPoint(), regardless of how it's icon is placed.)- Returns:
- pixels to offset
-
setOffsetX
Sets how many horizontal pixels to shift the center of the label from the center of the overlay. (For MarkerOverlays, the "center" is directly over MarkerOverlay.getPoint(), regardless of how it's icon is placed.)- Parameters:
offsetX-- Returns:
- this
-
getOffsetY
public int getOffsetY()Gets how many vertical pixels to shift the center of the label from the center of the overlay. (For MarkerOverlays, the "center" is directly over MarkerOverlay.getPoint(), regardless of how it's icon is placed.)- Returns:
- pixels to offset
-
setOffsetY
Sets how many vertical pixels to shift the center of the label from the center of the overlay. (For MarkerOverlays, the "center" is directly over MarkerOverlay.getPoint(), regardless of how it's icon is placed.)- Parameters:
offsetY-- Returns:
- this
-
toString
-