当前位置: 首页>>代码示例>>Java>>正文


Java Join类代码示例

本文整理汇总了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;
}
 
开发者ID:junjunguo,项目名称:PocketMaps,代码行数:30,代码来源:MapHandler.java


注:本文中的org.mapsforge.core.graphics.Join类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。