本文整理汇总了Java中org.mapsforge.core.graphics.Join类的典型用法代码示例。如果您正苦于以下问题:Java Join类的具体用法?Java Join怎么用?Java Join使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Join类属于org.mapsforge.core.graphics包,在下文中一共展示了Join类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPolyline
import org.mapsforge.core.graphics.Join; //导入依赖的package包/类
/**
* draws a connected series of line segments specified by a list of LatLongs.
*
* @param pointList
* @param color: the color of the polyline
* @param strokeWidth: the stroke width of the polyline
* @return Polyline
*/
public Polyline createPolyline(PointList pointList, int color, int strokeWidth) {
Paint paintStroke = AndroidGraphicFactory.INSTANCE.createPaint();
paintStroke.setStyle(Style.STROKE);
paintStroke.setStrokeJoin(Join.ROUND);
paintStroke.setStrokeCap(Cap.ROUND);
paintStroke.setColor(color);
// paintStroke.setDashPathEffect(new float[]{25, 25});
paintStroke.setStrokeWidth(strokeWidth);
// TODO: new mapsforge version wants an mapsforge-paint, not an android paint.
// This doesn't seem to support transparceny
//paintStroke.setAlpha(128);
Polyline line = new Polyline((Paint) paintStroke, AndroidGraphicFactory.INSTANCE);
List<LatLong> geoPoints = line.getLatLongs();
PointList tmp = pointList;
for (int i = 0; i < pointList.getSize(); i++) {
geoPoints.add(new LatLong(tmp.getLatitude(i), tmp.getLongitude(i)));
}
return line;
}