本文整理匯總了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;
}