本文整理汇总了Java中org.mapsforge.core.graphics.Paint.setStrokeWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Paint.setStrokeWidth方法的具体用法?Java Paint.setStrokeWidth怎么用?Java Paint.setStrokeWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mapsforge.core.graphics.Paint
的用法示例。
在下文中一共展示了Paint.setStrokeWidth方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPolyline
import org.mapsforge.core.graphics.Paint; //导入方法依赖的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;
}
示例2: createPolyline
import org.mapsforge.core.graphics.Paint; //导入方法依赖的package包/类
/**
* Draws a polyline on the map view.
* @param coordinates
* @param color
* @param strokeWidth
* @return identifier for the object.
*/
public int createPolyline(List<LatLong> coordinates, Color color, float strokeWidth) {
Paint paintStroke = mGraphicFactory.createPaint();
paintStroke.setStyle(Style.STROKE);
paintStroke.setColor(color);
paintStroke.setStrokeWidth(strokeWidth);
Polyline pl = new Polyline(paintStroke,mGraphicFactory);
pl.getLatLongs().addAll(coordinates);
MapView mapView = (MapView) getNativeView();
mapView.getLayerManager().getLayers().add(pl);
mLayers.put(Integer.toString(pl.hashCode()), pl);
mapView.getLayerManager().redrawLayers();
return pl.hashCode();
}
示例3: createPolygon
import org.mapsforge.core.graphics.Paint; //导入方法依赖的package包/类
/**
* Draws a polygon on the map view.
* @param coordinates
* @param fillColor
* @param strokeColor
* @param strokeWidth
* @return identifier for the object.
*/
public int createPolygon(List<LatLong> coordinates, Color fillColor, Color strokeColor, float strokeWidth) {
Paint paintFill = mGraphicFactory.createPaint();
paintFill.setStyle(Style.FILL);
paintFill.setColor(fillColor);
Paint paintStroke = mGraphicFactory.createPaint();
paintStroke.setStyle(Style.STROKE);
paintStroke.setColor(strokeColor);
paintStroke.setStrokeWidth(strokeWidth);
Polygon pg = new Polygon(paintFill, paintStroke, mGraphicFactory);
pg.getLatLongs().addAll(coordinates);
MapView mapView = (MapView) getNativeView();
mapView.getLayerManager().getLayers().add(pg);
mLayers.put(Integer.toString(pg.hashCode()), pg);
mapView.getLayerManager().redrawLayers();
return pg.hashCode();
}
示例4: createCircle
import org.mapsforge.core.graphics.Paint; //导入方法依赖的package包/类
/**
* Draws a circle on the map view.
* @param latLong
* @param radius Note: The radius is in meters!
* @param fillColor
* @param strokeColor
* @param strokeWidth
* @return identifier for the object.
*/
public int createCircle(LatLong latLong, float radius, Color fillColor, Color strokeColor, float strokeWidth) {
Paint paintFill = mGraphicFactory.createPaint();
paintFill.setColor(fillColor);
paintFill.setStyle(Style.FILL);
Paint paintStroke = mGraphicFactory.createPaint();
paintStroke.setColor(strokeColor);
paintStroke.setStrokeWidth(strokeWidth);
paintStroke.setStyle(Style.STROKE);
Circle c = new Circle(latLong, radius, paintFill, paintStroke);
MapView mapView = (MapView) getNativeView();
mapView.getLayerManager().getLayers().add(c);
mLayers.put(Integer.toString(c.hashCode()), c);
mapView.getLayerManager().redrawLayers();
return c.hashCode();
}
示例5: createPaint
import org.mapsforge.core.graphics.Paint; //导入方法依赖的package包/类
public static Paint createPaint(final int color, final int strokeWidth, final Style style) {
final Paint paint = AndroidGraphicFactory.INSTANCE.createPaint();
paint.setColor(color);
paint.setStrokeWidth(strokeWidth);
paint.setStyle(style);
return paint;
}
示例6: getPaint
import org.mapsforge.core.graphics.Paint; //导入方法依赖的package包/类
protected static Paint getPaint(int color, int strokeWidth, Style style) {
Paint paint = GRAPHIC_FACTORY.createPaint();
paint.setColor(color);
paint.setStrokeWidth(strokeWidth);
paint.setStyle(style);
return paint;
}
示例7: getPaint
import org.mapsforge.core.graphics.Paint; //导入方法依赖的package包/类
private static Paint getPaint(int color, int strokeWidth, Style style) {
Paint paint = GRAPHIC_FACTORY.createPaint();
paint.setColor(color);
paint.setStrokeWidth(strokeWidth);
paint.setStyle(style);
return paint;
}
示例8: getPaintStroke
import org.mapsforge.core.graphics.Paint; //导入方法依赖的package包/类
public synchronized Paint getPaintStroke(LatLong from, LatLong to) {
Paint paint = AndroidGraphicFactory.INSTANCE.createPaint();
paint.setStrokeWidth(16);
paint.setStyle(Style.STROKE);
int alt = to == null? 0: ((TrackGpxParser.TrackPoint)to).getAltitude();
switch (alt % 3) {
case 0: paint.setColor(AndroidGraphicFactory.INSTANCE.createColor(Color.GREEN)); break;
case 1: paint.setColor(AndroidGraphicFactory.INSTANCE.createColor(Color.RED)); break;
default: paint.setColor(AndroidGraphicFactory.INSTANCE.createColor(Color.BLUE)); break;
}
return paint;
}
示例9: createPaint
import org.mapsforge.core.graphics.Paint; //导入方法依赖的package包/类
static Paint createPaint(int color, int strokeWidth, Style style) {
Paint paint = AndroidGraphicFactory.INSTANCE.createPaint();
paint.setColor(color);
paint.setStrokeWidth(strokeWidth);
paint.setStyle(style);
return paint;
}
示例10: getPaint
import org.mapsforge.core.graphics.Paint; //导入方法依赖的package包/类
private static Paint getPaint(int color, int strokeWidth, Style style) {
Paint paint = GRAPHIC_FACTORY.createPaint();
paint.setColor(color);
paint.setStrokeWidth(strokeWidth);
paint.setStyle(style);
return paint;
}