public class

LineStyleBuilder

extends StyleBuilder
java.lang.Object
   ↳ com.carto.styles.StyleBuilder
     ↳ com.carto.styles.LineStyleBuilder

Class Overview

A builder class for LineStyle.

Summary

Public Constructors
LineStyleBuilder()
Constructs a LineStyleBuilder object with all parameters set to defaults.
Public Methods
LineStyle buildStyle()
Builds a new instance of the LineStyle object using previously set parameters.
synchronized void delete()
Bitmap getBitmap()
Returns the bitmap of the line.
float getClickWidth()
Returns the width of the line used for click detection.
LineEndType getLineEndType()
Returns the end point type of the line.
LineJoinType getLineJoinType()
Returns the join type of the line.
float getStretchFactor()
Returns the stretch factor of the line.
float getWidth()
Returns the width of the line.
void setBitmap(Bitmap bitmap)
Sets the bitmap that will be used for drawing the line.
void setClickWidth(float clickWidth)
Sets the width for the line that will be used for click detection.
void setLineEndType(LineEndType lineEndType)
Sets the style in which the end points of the line will be drawn.
void setLineJoinType(LineJoinType lineJoinType)
Sets the style in which the line segments will be connected with each other.
void setStretchFactor(float stretchFactor)
Sets the relative stretching coefficient for the line.
void setWidth(float width)
Sets the width of line in screen density independent pixels (DP or DIP).
[Expand]
Inherited Methods
From class com.carto.styles.StyleBuilder
From class java.lang.Object

Public Constructors

public LineStyleBuilder ()

Constructs a LineStyleBuilder object with all parameters set to defaults.

Public Methods

public LineStyle buildStyle ()

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

Returns
  • A new LineStyle object.

public synchronized void delete ()

public Bitmap getBitmap ()

Returns the bitmap of the line.

Returns
  • The bitmap of the line.

public float getClickWidth ()

Returns the width of the line used for click detection.

Returns
  • The width of the line used for click detection.

public LineEndType getLineEndType ()

Returns the end point type of the line.

Returns
  • The end point type of the line.

public LineJoinType getLineJoinType ()

Returns the join type of the line.

Returns
  • The join type of the line.

public float getStretchFactor ()

Returns the stretch factor of the line.

Returns
  • The stretch factor of the line.

public float getWidth ()

Returns the width of the line.

Returns
  • The width of the line in dp.

public void setBitmap (Bitmap bitmap)

Sets the bitmap that will be used for drawing the line. The bitmap will be stretched
horizontally to match the width of the line and repeated vertically along the lengtht of the line.
The default is "default_line.png".

Parameters
bitmap The new bitmap for the line.

public void setClickWidth (float clickWidth)

Sets the width for the line that will be used for click detection.
Units are screen density independent pixels (DP or DIP). If set to -1 the click width will be
calculated automatically. The default is -1.

Parameters
clickWidth The new point size in dp.

public void setLineEndType (LineEndType lineEndType)

Sets the style in which the end points of the line will be drawn. The default is LineEndType::ROUND.

Parameters
lineEndType The new line end point type.

public void setLineJoinType (LineJoinType lineJoinType)

Sets the style in which the line segments will be connected with each other. The default is LineJoinType::MITER.

Parameters
lineJoinType The new line join type.

public void setStretchFactor (float stretchFactor)

Sets the relative stretching coefficient for the line. The bitmap of the line will be stretched
vertically by the stretch factor and then repeated along the length of the line. For example,
setting the stretch factor to 2.0 will stretch the bitmap vertically to double the original height
and reduces the number of times the bitmap gets repeated by half. The default is 1.0.

Parameters
stretchFactor The new relative stretching coefficient for the line.

public void setWidth (float width)

Sets the width of line in screen density independent pixels (DP or DIP). The default is 12.

Parameters
width The new line width in dp.