public class TextProperties
extends java.lang.Object
Setters use the Builder pattern so they can be chained.
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<Context.MapType> |
activeMapTypes |
protected java.util.Set<Context.UI> |
activeUIs |
protected int |
backgroundColor |
protected float |
backgroundOpacity |
protected int |
color |
protected boolean |
fontShadow |
protected int |
maxZoom |
protected int |
minZoom |
protected int |
offsetX |
protected int |
offsetY |
protected float |
opacity |
protected float |
scale |
| Constructor and Description |
|---|
TextProperties() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<Context.MapType> |
getActiveMapTypes()
Returns a set of enums indicating which map types (Day, Night) the text should be active in.
|
java.util.Set<Context.UI> |
getActiveUIs()
Returns a set of enums indicating which JourneyMap UIs (Fullscreen, Minimap, Webmap)
the text should be displayed in.
|
int |
getBackgroundColor()
Gets background color.
|
float |
getBackgroundOpacity()
Gets background opacity.
|
int |
getColor()
Gets the font color.
|
int |
getMaxZoom()
The maximum zoom level (UIState.ZOOM_IN_MAX is highest) where text should be visible.
|
int |
getMinZoom()
The minimum zoom level (UIState.FULLSCREEN_ZOOM_MIN is lowest) where the polygon should be visible.
|
int |
getOffsetX()
Gets how many horizontal pixels to shift the center of the label from the center of the overlay.
|
int |
getOffsetY()
Gets how many vertical pixels to shift the center of the label from the center of the overlay.
|
float |
getOpacity()
Gets opacity.
|
float |
getScale()
Font scale.
|
boolean |
hasFontShadow()
Whether font shadow should be used.
|
boolean |
isActiveIn(UIState uiState)
Whether the overlay should be active for the given contexts.
|
TextProperties |
setActiveMapTypes(Context.MapType... activeMapTypes)
Set of enums indicating which JourneyMap map types (Day, Night) the text should be active in.
|
TextProperties |
setActiveUIs(Context.UI... activeUIs)
Set of enums indicating which JourneyMap UIs (Fullscreen, Minimap, Webmap) the text should be displayed in.
|
TextProperties |
setBackgroundColor(int backgroundColor)
Sets background color.
|
TextProperties |
setBackgroundOpacity(float backgroundOpacity)
Sets background opacity.
|
TextProperties |
setColor(int color)
Sets the font color (rgb).
|
TextProperties |
setFontShadow(boolean fontShadow)
Sets whether font shadow should be used.
|
TextProperties |
setMaxZoom(int maxZoom)
Sets the maximum zoom level (UIState.ZOOM_IN_MAX is highest) where the polygon should be visible.
|
TextProperties |
setMinZoom(int minZoom)
Sets the minimum zoom level (UIState.FULLSCREEN_ZOOM_MIN is lowest) where text should be visible.
|
TextProperties |
setOffsetX(int offsetX)
Sets how many horizontal pixels to shift the center of the label from the center of the overlay.
|
TextProperties |
setOffsetY(int offsetY)
Sets how many vertical pixels to shift the center of the label from the center of the overlay.
|
TextProperties |
setOpacity(float opacity)
Sets opacity.
|
TextProperties |
setScale(float scale)
Sets the font scale.
|
java.lang.String |
toString() |
protected java.util.Set<Context.UI> activeUIs
protected java.util.Set<Context.MapType> activeMapTypes
protected float scale
protected int color
protected int backgroundColor
protected float opacity
protected float backgroundOpacity
protected boolean fontShadow
protected int minZoom
protected int maxZoom
protected int offsetX
protected int offsetY
public float getScale()
public TextProperties setScale(float scale)
scale - the scalepublic int getColor()
public TextProperties setColor(int color)
color - rgbpublic int getBackgroundColor()
public TextProperties setBackgroundColor(int backgroundColor)
backgroundColor - the background colorpublic float getOpacity()
public TextProperties setOpacity(float opacity)
opacity - the opacitypublic float getBackgroundOpacity()
public TextProperties setBackgroundOpacity(float backgroundOpacity)
backgroundOpacity - the background opacitypublic boolean hasFontShadow()
public TextProperties setFontShadow(boolean fontShadow)
fontShadow - true if shadowpublic java.util.Set<Context.UI> getActiveUIs()
For example, this can be specified to have labels only displayed in the fullscreen map, but not the minimap.
public TextProperties setActiveUIs(Context.UI... activeUIs)
For example, this can be specified to have labels only displayed in the fullscreen map, but not the minimap.
activeUIs - active UIspublic java.util.Set<Context.MapType> getActiveMapTypes()
public TextProperties setActiveMapTypes(Context.MapType... activeMapTypes)
activeMapTypes - active typespublic boolean isActiveIn(UIState uiState)
uiState - UIStatepublic int getMinZoom()
public TextProperties setMinZoom(int minZoom)
minZoom - the min zoompublic int getMaxZoom()
public TextProperties setMaxZoom(int maxZoom)
maxZoom - the max zoompublic int getOffsetX()
public TextProperties setOffsetX(int offsetX)
offsetX - public int getOffsetY()
public TextProperties setOffsetY(int offsetY)
offsetY - public java.lang.String toString()
toString in class java.lang.Object