@Override public void scaleStrokeWidth(float scaleFactor, byte zoomLevel) { if (this.scaleRadius) { this.renderRadiusScaled.put(zoomLevel, this.radius * scaleFactor); if (this.stroke != null) { Paint paint = graphicFactory.createPaint(stroke); paint.setStrokeWidth(this.strokeWidth * scaleFactor); strokes.put(zoomLevel, paint); } } }
@Override public void scaleTextSize(float scaleFactor, byte zoomLevel) { Paint zlPaint = graphicFactory.createPaint(this.fill); zlPaint.setTextSize(this.fontSize * scaleFactor); this.fills.put(zoomLevel, zlPaint); Paint zlStroke = graphicFactory.createPaint(this.stroke); zlStroke.setTextSize(this.fontSize * scaleFactor); this.strokes.put(zoomLevel, zlStroke); } }
@Override public void scaleTextSize(float scaleFactor, byte zoomLevel) { Paint f = graphicFactory.createPaint(this.fill); f.setTextSize(this.fontSize * scaleFactor); this.fills.put(zoomLevel, f); Paint s = graphicFactory.createPaint(this.stroke); s.setTextSize(this.fontSize * scaleFactor); this.strokes.put(zoomLevel, s); this.dyScaled.put(zoomLevel, this.dy * scaleFactor); } }
@Override public void scaleStrokeWidth(float scaleFactor, byte zoomLevel) { if (this.stroke != null) { if (this.scale == Scale.NONE) { scaleFactor = 1; } Paint paint = graphicFactory.createPaint(this.stroke); paint.setStrokeWidth(this.strokeWidth * scaleFactor); this.strokes.put(zoomLevel, paint); } }
public Line(GraphicFactory graphicFactory, DisplayModel displayModel, String elementName, XmlPullParser pullParser, int level, String relativePathPrefix) throws IOException, XmlPullParserException { super(graphicFactory, displayModel); this.level = level; this.relativePathPrefix = relativePathPrefix; this.stroke = graphicFactory.createPaint(); this.stroke.setColor(Color.BLACK); this.stroke.setStyle(Style.STROKE); this.stroke.setStrokeCap(Cap.ROUND); this.stroke.setStrokeJoin(Join.ROUND); this.strokes = new HashMap<>(); this.dyScaled = new HashMap<>(); extractValues(graphicFactory, displayModel, elementName, pullParser); }
private static Paint createLineBack(GraphicFactory graphicFactory, DisplayModel displayModel) { Paint paint = graphicFactory.createPaint(); paint.setColor(Color.WHITE); paint.setStrokeWidth(4 * displayModel.getScaleFactor()); paint.setStyle(Style.STROKE); return paint; }
private static Paint createTextFront(GraphicFactory graphicFactory, DisplayModel displayModel) { Paint paint = graphicFactory.createPaint(); paint.setColor(Color.BLUE); paint.setTypeface(FontFamily.DEFAULT, FontStyle.BOLD); paint.setTextSize(12 * displayModel.getScaleFactor()); return paint; }
private static Paint createPaintFront(GraphicFactory graphicFactory, DisplayModel displayModel) { Paint paint = graphicFactory.createPaint(); paint.setColor(Color.RED); paint.setStrokeWidth(2 * displayModel.getScaleFactor()); paint.setStyle(Style.STROKE); return paint; }
private static Paint createPaintFront(GraphicFactory graphicFactory, DisplayModel displayModel) { Paint paint = graphicFactory.createPaint(); paint.setColor(Color.RED); paint.setTypeface(FontFamily.DEFAULT, FontStyle.BOLD); paint.setTextSize(25 * displayModel.getScaleFactor()); return paint; }
private static Paint createLineFront(GraphicFactory graphicFactory, DisplayModel displayModel) { Paint paint = graphicFactory.createPaint(); paint.setColor(Color.BLUE); paint.setStrokeWidth(2 * displayModel.getScaleFactor()); paint.setStyle(Style.STROKE); return paint; }
private Paint createScaleBarPaint(Color color, float strokeWidth, Style style) { Paint paint = this.graphicFactory.createPaint(); paint.setColor(color); paint.setStrokeWidth(strokeWidth * this.scale); paint.setStyle(style); paint.setStrokeCap(Cap.SQUARE); return paint; }
private static Paint createPaintBack(GraphicFactory graphicFactory, DisplayModel displayModel) { Paint paint = graphicFactory.createPaint(); paint.setColor(Color.WHITE); paint.setStrokeWidth(4 * displayModel.getScaleFactor()); paint.setStyle(Style.STROKE); return paint; }
private static Paint createPaintFront(GraphicFactory graphicFactory, DisplayModel displayModel) { Paint paint = graphicFactory.createPaint(); paint.setColor(Color.RED); paint.setTypeface(FontFamily.DEFAULT, FontStyle.BOLD); paint.setTextSize(12 * displayModel.getScaleFactor()); return paint; }
private Paint createTextPaint(Color color, float strokeWidth, Style style) { Paint paint = this.graphicFactory.createPaint(); paint.setColor(color); paint.setStrokeWidth(strokeWidth * this.scale); paint.setStyle(style); paint.setTypeface(FontFamily.DEFAULT, FontStyle.BOLD); paint.setTextSize(12 * this.scale); return paint; }
private static Paint createTextBack(GraphicFactory graphicFactory, DisplayModel displayModel) { Paint paint = graphicFactory.createPaint(); paint.setColor(Color.WHITE); paint.setTypeface(FontFamily.DEFAULT, FontStyle.BOLD); paint.setTextSize(12 * displayModel.getScaleFactor()); paint.setStrokeWidth(4 * displayModel.getScaleFactor()); paint.setStyle(Style.STROKE); return paint; }
private static Paint createPaintBack(GraphicFactory graphicFactory, DisplayModel displayModel) { Paint paint = graphicFactory.createPaint(); paint.setColor(Color.WHITE); paint.setTypeface(FontFamily.DEFAULT, FontStyle.BOLD); paint.setTextSize(25 * displayModel.getScaleFactor()); paint.setStrokeWidth(2 * displayModel.getScaleFactor()); paint.setStyle(Style.STROKE); return paint; }
private static Paint createPaintBack(GraphicFactory graphicFactory, DisplayModel displayModel) { Paint paint = graphicFactory.createPaint(); paint.setColor(Color.WHITE); paint.setTypeface(FontFamily.DEFAULT, FontStyle.BOLD); paint.setTextSize(12 * displayModel.getScaleFactor()); paint.setStrokeWidth(2 * displayModel.getScaleFactor()); paint.setStyle(Style.STROKE); return paint; }
@Test public void constructorTest() { Paint paintFill = GRAPHIC_FACTORY.createPaint(); Paint paintStroke = GRAPHIC_FACTORY.createPaint(); Polygon polygon = new Polygon(paintFill, paintStroke, GRAPHIC_FACTORY); Assert.assertTrue(polygon.getLatLongs().isEmpty()); Assert.assertEquals(paintFill, polygon.getPaintFill()); Assert.assertEquals(paintStroke, polygon.getPaintStroke()); }
@Test public void constructorTest() { Paint paintStroke = GRAPHIC_FACTORY.createPaint(); Polyline polyline = new Polyline(paintStroke, GRAPHIC_FACTORY); Assert.assertTrue(polyline.getLatLongs().isEmpty()); Assert.assertEquals(paintStroke, polyline.getPaintStroke()); }
@Test public void constructorTest() { LatLong latLong = new LatLong(0, 0); int radius = 3; Paint paintFill = GRAPHIC_FACTORY.createPaint(); Paint paintStroke = GRAPHIC_FACTORY.createPaint(); Circle circle = new Circle(latLong, radius, paintFill, paintStroke); Assert.assertEquals(latLong, circle.getPosition()); Assert.assertEquals(radius, circle.getRadius(), 0); Assert.assertEquals(paintFill, circle.getPaintFill()); Assert.assertEquals(paintStroke, circle.getPaintStroke()); verifyInvalidRadius(latLong, -1, paintFill, paintStroke); verifyInvalidRadius(latLong, Float.NaN, paintFill, paintStroke); }