Package com.massifmaps.styles
Class BalloonPopupStyleBuilder
java.lang.Object
com.massifmaps.styles.StyleBuilder
com.massifmaps.styles.BillboardStyleBuilder
com.massifmaps.styles.PopupStyleBuilder
com.massifmaps.styles.BalloonPopupStyleBuilder
A builder class for BalloonPopupStyle.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a BalloonPopupStyleBuilder object with all parameters set to defaults. -
Method Summary
Modifier and TypeMethodDescriptionBuilds a new instance of the BalloonPopupStyle object using previously set parameters.Returns the margins for popup buttons.intReturns the corner radius of the popup.Returns the color of the description.Returns the description field variable.Returns the name of the description font.intReturns the size of the description font.Returns the margins of the description.Returns the background color of the left part of the popup.Returns the image of the left part of the popup.Returns the margins of the left part of the popup.Returns the background color of the right part of the popup.Returns the image of the right part of the popup.Returns the margins of the right part of the popup.Returns the color of the stroke surrounding the popup.intReturns the width of the stroke surrounding the popup.Returns the color of the title.Returns the title field variable.Returns the name of the title font.intReturns the size of the title font.Returns the margins of the title.intReturns the height of the triangle at the bottom of the popup.intReturns the width of the triangle at the bottom of the popup.booleanReturns the state of the description wrap parameter.booleanReturns the state of the title wrap parameter.voidsetButtonMargins(BalloonPopupMargins buttonMargins) Sets the margins for popup buttons.voidsetCornerRadius(int cornerRadius) Sets the corner radius of the popup.voidsetDescriptionColor(Color descColor) Sets the color of the description.voidsetDescriptionField(String field) Sets the description field variable.voidsetDescriptionFontName(String descFontName) Sets the name of the description font.voidsetDescriptionFontSize(int descFontSize) Sets the size of the description font.voidsetDescriptionMargins(BalloonPopupMargins descMargins) Sets the margins for the description.voidsetDescriptionWrap(boolean descWrap) Sets the state of the description wrap parameter.voidsetLeftColor(Color leftColor) Sets the background color of the left part of the popup.voidsetLeftImage(Bitmap leftImage) Sets the image for the left part of the popup.voidsetLeftMargins(BalloonPopupMargins leftMargins) Sets the margins for the left part of the popup.voidsetRightColor(Color rightColor) Sets the background color of the right part of the popup.voidsetRightImage(Bitmap rightImage) Sets the image for the right part of the popup.voidsetRightMargins(BalloonPopupMargins rightMargins) Sets the margins for the right part of the popup.voidsetStrokeColor(Color strokeColor) Sets the color of the stroke surrounding the popup.voidsetStrokeWidth(int strokeWidth) Sets the width of the stroke surrounding the popup.voidsetTitleColor(Color titleColor) Sets the color of the title.voidsetTitleField(String field) Sets the title field variable.voidsetTitleFontName(String titleFontName) Sets the name of the title font.voidsetTitleFontSize(int titleFontSize) Sets the size of the title font.voidsetTitleMargins(BalloonPopupMargins titleMargins) Sets the margins for the title.voidsetTitleWrap(boolean titleWrap) Sets the state of the title wrap parameter.voidsetTriangleHeight(int triangleHeight) Sets the height of the triangle at the bottom of the popup.voidsetTriangleWidth(int triangleWidth) Sets the width of the triangle at the bottom of the popup.Methods inherited from class com.massifmaps.styles.BillboardStyleBuilder
getAnimationStyle, getAttachAnchorPointX, getAttachAnchorPointY, getHorizontalOffset, getPlacementPriority, getVerticalOffset, isCausesOverlap, isHideIfOverlapped, isScaleWithDPI, setAnimationStyle, setAttachAnchorPoint, setAttachAnchorPointX, setAttachAnchorPointY, setCausesOverlap, setHideIfOverlapped, setHorizontalOffset, setPlacementPriority, setScaleWithDPI, setVerticalOffsetMethods inherited from class com.massifmaps.styles.StyleBuilder
equals, getColor, hashCode, setColor
-
Constructor Details
-
BalloonPopupStyleBuilder
public BalloonPopupStyleBuilder()Constructs a BalloonPopupStyleBuilder object with all parameters set to defaults.
-
-
Method Details
-
getCornerRadius
public int getCornerRadius()Returns the corner radius of the popup.- Returns:
- The corner radius of the popup in dp.
-
setCornerRadius
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.
-
getLeftColor
Returns the background color of the left part of the popup.- Returns:
- The background color of the left part of the popup.
-
setLeftColor
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.
-
getLeftImage
Returns the image of the left part of the popup.- Returns:
- The image of the left part of the popup.
-
setLeftImage
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.
-
getLeftMargins
Returns the margins of the left part of the popup.- Returns:
- The margins of the left part of the popup.
-
setLeftMargins
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.
-
getRightColor
Returns the background color of the right part of the popup.- Returns:
- The background color of the right part of the popup.
-
setRightColor
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.
-
getRightImage
Returns the image of the right part of the popup.- Returns:
- The image of the right part of the popup.
-
setRightImage
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.
-
getRightMargins
Returns the margins of the right part of the popup.- Returns:
- The margins of the right part of the popup.
-
setRightMargins
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.
-
getTitleColor
Returns the color of the title.- Returns:
- The color of the title.
-
setTitleColor
Sets the color of the title. The default is 0xFF000000.- Parameters:
titleColor- The new color for the title.
-
getTitleFontName
Returns the name of the title font.- Returns:
- The name of the title font.
-
setTitleFontName
Sets the name of the title font. Accepts a CSS-like list, the most preferred name
first, entries optionally tagged with the platform they are for
("android:Roboto, ios:Helvetica Neue, sans-serif"). A name the device has no font for
is skipped; generic names ("sans-serif", "serif", "monospace", "Arial", ...) map to the
platform font. The default is HelveticaNeue-Light.- Parameters:
titleFontName- The new name for the title font.
-
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.
-
setTitleField
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.
-
getTitleFontSize
public int getTitleFontSize()Returns the size of the title font.- Returns:
- The size of the title font.
-
setTitleFontSize
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.
-
getTitleMargins
Returns the margins of the title.- Returns:
- The margins of the title.
-
setTitleMargins
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.
-
isTitleWrap
public boolean isTitleWrap()Returns the state of the title wrap parameter.- Returns:
- True if long titles are wrapped, false if it is truncated.
-
setTitleWrap
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.
-
getDescriptionColor
Returns the color of the description.- Returns:
- The color of the description.
-
setDescriptionColor
Sets the color of the description. The default is 0xFF000000.- Parameters:
descColor- The new color for the description.
-
getDescriptionFontName
Returns the name of the description font.- Returns:
- The name of the description font.
-
setDescriptionFontName
Sets the name of the description font. Accepts a CSS-like list, the most preferred name
first, entries optionally tagged with the platform they are for
("android:Roboto, ios:Helvetica Neue, sans-serif"). A name the device has no font for
is skipped; generic names ("sans-serif", "serif", "monospace", "Arial", ...) map to the
platform font. The default is HelveticaNeue-Light.- Parameters:
descFontName- The new name for the description font.
-
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.
-
setDescriptionField
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.
-
getDescriptionFontSize
public int getDescriptionFontSize()Returns the size of the description font.- Returns:
- The size of the description font.
-
setDescriptionFontSize
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.
-
getDescriptionMargins
Returns the margins of the description.- Returns:
- The margins of the description.
-
setDescriptionMargins
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.
-
isDescriptionWrap
public boolean isDescriptionWrap()Returns the state of the description wrap parameter.- Returns:
- True if long descriptions are wrapped, false if it is truncated.
-
setDescriptionWrap
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.
-
getButtonMargins
Returns the margins for popup buttons.- Returns:
- The margins for popup buttons.
-
setButtonMargins
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.
-
getStrokeColor
Returns the color of the stroke surrounding the popup.- Returns:
- The color of the stroke surrounding the popup.
-
setStrokeColor
Sets the color of the stroke surrounding the popup. The default is 0xFF000000.- Parameters:
strokeColor- The new color of the stroke surrounding the popup.
-
getStrokeWidth
public int getStrokeWidth()Returns the width of the stroke surrounding the popup.- Returns:
- The width of the stroke surrounding the popup in dp.
-
setStrokeWidth
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.
-
getTriangleWidth
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.
-
setTriangleWidth
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.
-
getTriangleHeight
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.
-
setTriangleHeight
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.
-
buildStyle
Builds a new instance of the BalloonPopupStyle object using previously set parameters.- Overrides:
buildStylein classPopupStyleBuilder- Returns:
- A new BalloonPopupStyle object.
-