public class

BalloonPopupStyleBuilder

extends PopupStyleBuilder
java.lang.Object
   ↳ com.carto.styles.StyleBuilder
     ↳ com.carto.styles.BillboardStyleBuilder
       ↳ com.carto.styles.PopupStyleBuilder
         ↳ com.carto.styles.BalloonPopupStyleBuilder

Class Overview

A builder class for BalloonPopupStyle.

Summary

Public Constructors
BalloonPopupStyleBuilder()
Constructs a BalloonPopupStyleBuilder object with all parameters set to defaults.
Public Methods
BalloonPopupStyle buildStyle()
Builds a new instance of the BalloonPopupStyle object using previously set parameters.
synchronized void delete()
BalloonPopupMargins getButtonMargins()
Returns the margins for popup buttons.
int getCornerRadius()
Returns the corner radius of the popup.
Color getDescriptionColor()
Returns the color of the description.
String getDescriptionField()
Returns the description field variable.
String getDescriptionFontName()
Returns the name of the description font.
int getDescriptionFontSize()
Returns the size of the description font.
BalloonPopupMargins getDescriptionMargins()
Returns the margins of the description.
Color getLeftColor()
Returns the background color of the left part of the popup.
Bitmap getLeftImage()
Returns the image of the left part of the popup.
BalloonPopupMargins getLeftMargins()
Returns the margins of the left part of the popup.
Color getRightColor()
Returns the background color of the right part of the popup.
Bitmap getRightImage()
Returns the image of the right part of the popup.
BalloonPopupMargins getRightMargins()
Returns the margins of the right part of the popup.
Color getStrokeColor()
Returns the color of the stroke surrounding the popup.
int getStrokeWidth()
Returns the width of the stroke surrounding the popup.
Color getTitleColor()
Returns the color of the title.
String getTitleField()
Returns the title field variable.
String getTitleFontName()
Returns the name of the title font.
int getTitleFontSize()
Returns the size of the title font.
BalloonPopupMargins getTitleMargins()
Returns the margins of the title.
int getTriangleHeight()
Returns the height of the triangle at the bottom of the popup.
int getTriangleWidth()
Returns the width of the triangle at the bottom of the popup.
boolean isDescriptionWrap()
Returns the state of the description wrap parameter.
boolean isTitleWrap()
Returns the state of the title wrap parameter.
void setButtonMargins(BalloonPopupMargins buttonMargins)
Sets the margins for popup buttons.
void setCornerRadius(int cornerRadius)
Sets the corner radius of the popup.
void setDescriptionColor(Color descColor)
Sets the color of the description.
void setDescriptionField(String field)
Sets the description field variable.
void setDescriptionFontName(String descFontName)
Sets the name of the description font.
void setDescriptionFontSize(int descFontSize)
Sets the size of the description font.
void setDescriptionMargins(BalloonPopupMargins descMargins)
Sets the margins for the description.
void setDescriptionWrap(boolean descWrap)
Sets the state of the description wrap parameter.
void setLeftColor(Color leftColor)
Sets the background color of the left part of the popup.
void setLeftImage(Bitmap leftImage)
Sets the image for the left part of the popup.
void setLeftMargins(BalloonPopupMargins leftMargins)
Sets the margins for the left part of the popup.
void setRightColor(Color rightColor)
Sets the background color of the right part of the popup.
void setRightImage(Bitmap rightImage)
Sets the image for the right part of the popup.
void setRightMargins(BalloonPopupMargins rightMargins)
Sets the margins for the right part of the popup.
void setStrokeColor(Color strokeColor)
Sets the color of the stroke surrounding the popup.
void setStrokeWidth(int strokeWidth)
Sets the width of the stroke surrounding the popup.
void setTitleColor(Color titleColor)
Sets the color of the title.
void setTitleField(String field)
Sets the title field variable.
void setTitleFontName(String titleFontName)
Sets the name of the title font.
void setTitleFontSize(int titleFontSize)
Sets the size of the title font.
void setTitleMargins(BalloonPopupMargins titleMargins)
Sets the margins for the title.
void setTitleWrap(boolean titleWrap)
Sets the state of the title wrap parameter.
void setTriangleHeight(int triangleHeight)
Sets the height of the triangle at the bottom of the popup.
void setTriangleWidth(int triangleWidth)
Sets the width of the triangle at the bottom of the popup.
[Expand]
Inherited Methods
From class com.carto.styles.PopupStyleBuilder
From class com.carto.styles.BillboardStyleBuilder
From class com.carto.styles.StyleBuilder
From class java.lang.Object

Public Constructors

public BalloonPopupStyleBuilder ()

Constructs a BalloonPopupStyleBuilder object with all parameters set to defaults.

Public Methods

public BalloonPopupStyle buildStyle ()

Builds a new instance of the BalloonPopupStyle object using previously set parameters.

Returns
  • A new BalloonPopupStyle object.

public synchronized void delete ()

public BalloonPopupMargins getButtonMargins ()

Returns the margins for popup buttons.

Returns
  • The margins for popup buttons.

public int getCornerRadius ()

Returns the corner radius of the popup.

Returns
  • The corner radius of the popup in dp.

public Color getDescriptionColor ()

Returns the color of the description.

Returns
  • The color of the description.

public String getDescriptionField ()

Returns the description field variable. If not empty, this variable is used to read actual text string from object meta info.

Returns
  • The current description variable.

public String getDescriptionFontName ()

Returns the name of the description font.

Returns
  • The name of the description font.

public int getDescriptionFontSize ()

Returns the size of the description font.

Returns
  • The size of the description font.

public BalloonPopupMargins getDescriptionMargins ()

Returns the margins of the description.

Returns
  • The margins of the description.

public Color getLeftColor ()

Returns the background color of the left part of the popup.

Returns
  • The background color of the left part of the popup.

public Bitmap getLeftImage ()

Returns the image of the left part of the popup.

Returns
  • The image of the left part of the popup.

public BalloonPopupMargins getLeftMargins ()

Returns the margins of the left part of the popup.

Returns
  • The margins of the left part of the popup.

public Color getRightColor ()

Returns the background color of the right part of the popup.

Returns
  • The background color of the right part of the popup.

public Bitmap getRightImage ()

Returns the image of the right part of the popup.

Returns
  • The image of the right part of the popup.

public BalloonPopupMargins getRightMargins ()

Returns the margins of the right part of the popup.

Returns
  • The margins of the right part of the popup.

public Color getStrokeColor ()

Returns the color of the stroke surrounding the popup.

Returns
  • The color of the stroke surrounding the popup.

public int getStrokeWidth ()

Returns the width of the stroke surrounding the popup.

Returns
  • The width of the stroke surrounding the popup in dp.

public Color getTitleColor ()

Returns the color of the title.

Returns
  • The color of the title.

public String getTitleField ()

Returns the title field variable. If not empty, this variable is used to read actual text string from object meta info.

Returns
  • The current title variable.

public String getTitleFontName ()

Returns the name of the title font.

Returns
  • The name of the title font.

public int getTitleFontSize ()

Returns the size of the title font.

Returns
  • The size of the title font.

public BalloonPopupMargins getTitleMargins ()

Returns the margins of the title.

Returns
  • The margins of the title.

public int getTriangleHeight ()

Returns the height of the triangle at the bottom of the popup.

Returns
  • The height of the triangle at the bottom of the popup in dp.

public int getTriangleWidth ()

Returns the width of the triangle at the bottom of the popup.

Returns
  • The width of the triangle at the bottom of the popup in dp.

public boolean isDescriptionWrap ()

Returns the state of the description wrap parameter.

Returns
  • True if long descriptions are wrapped, false if it is truncated.

public boolean isTitleWrap ()

Returns the state of the title wrap parameter.

Returns
  • True if long titles are wrapped, false if it is truncated.

public void setButtonMargins (BalloonPopupMargins buttonMargins)

Sets the margins for popup buttons. The margins will determine how much
empty space should surround the buttons. The default is BalloonPopupMargins(8, 0, 8, 8).

Parameters
buttonMargins The new popup margins for the buttons in dp.

public void setCornerRadius (int cornerRadius)

Sets the corner radius of the popup. Bigger values mean rounder corners, 0 creates
a rectangular popup. The default is 3.

Parameters
cornerRadius The new corner radius in dp.

public void setDescriptionColor (Color descColor)

Sets the color of the description. The default is 0xFF000000.

Parameters
descColor The new color for the description.

public void setDescriptionField (String field)

Sets the description field variable. If not empty, this variable is used to read actual text string from object meta info.

Parameters
field The description field to use for displaying text from metainfo.

public void setDescriptionFontName (String descFontName)

Sets the name of the description font. It must be one of the fonts bundled with the platform.
The default is HelveticaNeue-Light.

Parameters
descFontName The new name for the description font.

public void setDescriptionFontSize (int descFontSize)

Sets the size of the description font. The default is 14.

Parameters
descFontSize The new size for the description font in pts.

public void setDescriptionMargins (BalloonPopupMargins descMargins)

Sets the margins for the description. The margins will determine how much
empty space should surround the description. The default is BalloonPopupMargins(8, 0, 8, 6).

Parameters
descMargins The new margins for the description in dp.

public void setDescriptionWrap (boolean descWrap)

Sets the state of the description wrap parameter. If set to true, long descriptions that are
wider than the sreen width will be wrapped to multiple lines, increasing the height of the popup.
If set to false, long descriptions are truncated with three dots.

Parameters
descWrap The new state of the description wrap parameter.

public void setLeftColor (Color leftColor)

Sets the background color of the left part of the popup. The size of the colored area
is determined by the left margins and the left image. The default is 0xFF00B483.

Parameters
leftColor The new color for the left part of the popup.

public void setLeftImage (Bitmap leftImage)

Sets the image for the left part of the popup. If null is passed no image will be drawn.
The default is null.

Parameters
leftImage The new image for the left part of the popup.

public void setLeftMargins (BalloonPopupMargins leftMargins)

Sets the margins for the left part of the popup. The margins will determine how much
empty space should surround the left image. The default is BalloonPopupMargins(5, 0, 5, 0).

Parameters
leftMargins The new margins for the left part of the popup in dp.

public void setRightColor (Color rightColor)

Sets the background color of the right part of the popup. The size of the colored area
is determined by the right margins and the right image. The default is 0xFF00B483.

Parameters
rightColor The new color for the right part of the popup.

public void setRightImage (Bitmap rightImage)

Sets the image for the right part of the popup. If null is passed no image will be drawn.
The default is null.

Parameters
rightImage The new image for the right part of the popup.

public void setRightMargins (BalloonPopupMargins rightMargins)

Sets the margins for the right part of the popup. The margins will determine how much
empty space should surround the right image. The default is BalloonPopupMargins(5, 0, 5, 0).

Parameters
rightMargins The new margins for the right part of the popup in dp.

public void setStrokeColor (Color strokeColor)

Sets the color of the stroke surrounding the popup. The default is 0xFF000000.

Parameters
strokeColor The new color of the stroke surrounding the popup.

public void setStrokeWidth (int strokeWidth)

Sets the width of the stroke surrounding the popup. The default is 1.

Parameters
strokeWidth The new width of the stroke surrounding the popup.

public void setTitleColor (Color titleColor)

Sets the color of the title. The default is 0xFF000000.

Parameters
titleColor The new color for the title.

public void setTitleField (String field)

Sets the title field variable. If not empty, this variable is used to read actual text string from object meta info.

Parameters
field The text field to use for displaying title from metainfo.

public void setTitleFontName (String titleFontName)

Sets the name of the title font. It must be one of the fonts bundled with the platform.
The default is HelveticaNeue-Light.

Parameters
titleFontName The new name for the title font.

public void setTitleFontSize (int titleFontSize)

Sets the size of the title font. The default is 16.

Parameters
titleFontSize The new size for the title font in pts.

public void setTitleMargins (BalloonPopupMargins titleMargins)

Sets the margins for the title. The margins will determine how much
empty space should surround the title. The default is BalloonPopupMargins(8, 4, 8, 0).

Parameters
titleMargins The new margins for the title in dp.

public void setTitleWrap (boolean titleWrap)

Sets the state of the title wrap parameter. If set to true, long titles that are
wider than the sreen width will be wrapped to multiple lines, increasing the height of the popup.
If set to false, long titles are truncated with three dots.

Parameters
titleWrap The new state of the title wrap parameter.

public void setTriangleHeight (int triangleHeight)

Sets the height of the triangle at the bottom of the popup. The default is 10.

Parameters
triangleHeight The new height of the triangle at the bottom of the popup.

public void setTriangleWidth (int triangleWidth)

Sets the width of the triangle at the bottom of the popup. The default is 20.

Parameters
triangleWidth The new width of the triangle at the bottom of the popup.