Package com.massifmaps.styles
Class BalloonPopupButtonStyleBuilder
java.lang.Object
com.massifmaps.styles.StyleBuilder
com.massifmaps.styles.BalloonPopupButtonStyleBuilder
A builder class for BalloonPopupButtonStyle.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a BalloonPopupButtonStyleBuilder object with all parameters set to defaults. -
Method Summary
Modifier and TypeMethodDescriptionBuilds a new instance of the BalloonPopupButtonStyle object using previously set parameters.intReturns the width of the button.
If this value is -1, then button width is calculated automatically based on button text.intReturns the corner radius of the button.Returns the color of the stroke surrounding the button.intReturns the width of the stroke surrounding the button.Returns the color of the text.Returns the name of the text font.intReturns the size of the text font.Returns the margins of the text.voidsetButtonWidth(int buttonWidth) Sets the width of the button.
The default is -1, which means that button width is calculated automatically based on button text.voidsetCornerRadius(int cornerRadius) Sets the corner radius of the button.voidsetStrokeColor(Color strokeColor) Sets the color of the stroke surrounding the button.voidsetStrokeWidth(int strokeWidth) Sets the width of the stroke surrounding the button.voidsetTextColor(Color textColor) Sets the color of the text.voidsetTextFontName(String textFontName) Sets the name of the text font.voidsetTextFontSize(int textFontSize) Sets the size of the text font.voidsetTextMargins(BalloonPopupMargins textMargins) Sets the margins for the text.Methods inherited from class com.massifmaps.styles.StyleBuilder
equals, getColor, hashCode, setColor
-
Constructor Details
-
BalloonPopupButtonStyleBuilder
public BalloonPopupButtonStyleBuilder()Constructs a BalloonPopupButtonStyleBuilder object with all parameters set to defaults.
-
-
Method Details
-
getButtonWidth
public int getButtonWidth()Returns the width of the button.
If this value is -1, then button width is calculated automatically based on button text.- Returns:
- The width of the button in dp.
-
setButtonWidth
public void setButtonWidth(int buttonWidth) Sets the width of the button.
The default is -1, which means that button width is calculated automatically based on button text.- Parameters:
buttonWidth- The button width in dp, or -1.
-
getCornerRadius
public int getCornerRadius()Returns the corner radius of the button.- Returns:
- The corner radius of the button in dp.
-
setCornerRadius
public void setCornerRadius(int cornerRadius) Sets the corner radius of the button. Bigger values mean rounder corners, 0 creates
a rectangular button. The default is 3.- Parameters:
cornerRadius- The new corner radius in dp.
-
getTextColor
Returns the color of the text.- Returns:
- The color of the text.
-
setTextColor
Sets the color of the text. The default is 0xFF000000.- Parameters:
textColor- The new color for the text.
-
getTextFontName
Returns the name of the text font.- Returns:
- The name of the text font.
-
setTextFontName
Sets the name of the text 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:
textFontName- The new name for the text font.
-
getTextFontSize
public int getTextFontSize()Returns the size of the text font.- Returns:
- The size of the text font.
-
setTextFontSize
public void setTextFontSize(int textFontSize) Sets the size of the text font. The default is 16.- Parameters:
textFontSize- The new size for the text font in pts.
-
getTextMargins
Returns the margins of the text.- Returns:
- The margins of the text.
-
setTextMargins
Sets the margins for the text. The margins will determine how much
empty space should surround the text. The default is BalloonPopupMargins(8, 4, 8, 8).- Parameters:
textMargins- The new margins for the text in dp.
-
getStrokeColor
Returns the color of the stroke surrounding the button.- Returns:
- The color of the stroke surrounding the button.
-
setStrokeColor
Sets the color of the stroke surrounding the button. The default is 0xFF000000.- Parameters:
strokeColor- The new color of the stroke surrounding the button.
-
getStrokeWidth
public int getStrokeWidth()Returns the width of the stroke surrounding the button.- Returns:
- The width of the stroke surrounding the button in dp.
-
setStrokeWidth
public void setStrokeWidth(int strokeWidth) Sets the width of the stroke surrounding the button. The default is 1.- Parameters:
strokeWidth- The new width of the stroke surrounding the button.
-
buildStyle
Builds a new instance of the BalloonPopupButtonStyle object using previously set parameters.- Returns:
- A new BalloonPopupButtonStyle object.
-