public PathText(GraphicFactory graphicFactory, DisplayModel displayModel, String elementName, XmlPullParser pullParser) throws XmlPullParserException { super(graphicFactory, displayModel); this.fill = graphicFactory.createPaint(); this.fill.setColor(Color.BLACK); this.fill.setStyle(Style.FILL); this.fill.setTextAlign(Align.CENTER); this.fills = new HashMap<>(); this.rotate = true; this.repeat = true; this.stroke = graphicFactory.createPaint(); this.stroke.setColor(Color.BLACK); this.stroke.setStyle(Style.STROKE); this.stroke.setTextAlign(Align.CENTER); this.strokes = new HashMap<>(); this.dyScaled = new HashMap<>(); this.display = Display.IFSPACE; extractValues(graphicFactory, displayModel, elementName, pullParser); }
case BELOW: case ABOVE: this.stroke.setTextAlign(Align.CENTER); this.fill.setTextAlign(Align.CENTER); break; case BELOW_LEFT: case ABOVE_LEFT: case LEFT: this.stroke.setTextAlign(Align.RIGHT); this.fill.setTextAlign(Align.RIGHT); break; case BELOW_RIGHT: case ABOVE_RIGHT: case RIGHT: this.stroke.setTextAlign(Align.LEFT); this.fill.setTextAlign(Align.LEFT); break; default:
case BELOW: case ABOVE: this.stroke.setTextAlign(Align.CENTER); this.fill.setTextAlign(Align.CENTER); break; case BELOW_LEFT: case ABOVE_LEFT: case LEFT: this.stroke.setTextAlign(Align.RIGHT); this.fill.setTextAlign(Align.RIGHT); break; case BELOW_RIGHT: case ABOVE_RIGHT: case RIGHT: this.stroke.setTextAlign(Align.LEFT); this.fill.setTextAlign(Align.LEFT); break; default:
public PathText(GraphicFactory graphicFactory, DisplayModel displayModel, String elementName, XmlPullParser pullParser) throws XmlPullParserException { super(graphicFactory, displayModel); this.fill = graphicFactory.createPaint(); this.fill.setColor(Color.BLACK); this.fill.setStyle(Style.FILL); this.fill.setTextAlign(Align.CENTER); this.fills = new HashMap<>(); this.rotate = true; this.repeat = true; this.stroke = graphicFactory.createPaint(); this.stroke.setColor(Color.BLACK); this.stroke.setStyle(Style.STROKE); this.stroke.setTextAlign(Align.CENTER); this.strokes = new HashMap<>(); this.dyScaled = new HashMap<>(); this.display = Display.IFSPACE; extractValues(graphicFactory, displayModel, elementName, pullParser); }
@UiThread void showTextCircle(MapRequest address) { if (address != null && address.getNorth() > 0 && address.getEast() > 0) { Layers layers = mapView.getLayerManager().getLayers(); //this.mapViews.get(0).getLayerManager().getLayers() if (layers != null) { if (index >= 0 && index < layers.size()) layers.remove(index); float circleSize = 6 * this.mapView.getModel().displayModel.getScaleFactor(); Paint paint = Utils.createPaint(AndroidGraphicFactory.INSTANCE.createColor(Color.BLACK), 0, Style.FILL); //android.graphics.Paint.ANTI_ALIAS_FLAG); paint.setTextAlign(Align.LEFT); paint.setTextSize(25f); LatLong position = new LatLong(address.getNorth(), address.getEast()); StringBuilder fullAddress = new StringBuilder(); if (address.getCity() != null) fullAddress.append(address.getCity()).append(" "); if (address.getRegion() != null) fullAddress.append(address.getRegion()).append(" "); if (address.getAddress() != null) fullAddress.append(address.getAddress()).append(" "); Paint GREEN = Utils.createPaint(AndroidGraphicFactory.INSTANCE.createColor(Color.GREEN), 0, Style.FILL); TextCircle circle = new TextCircle(position, circleSize, fullAddress.toString(), paint, GREEN, null); circle.setOffsetX(10); layers.add(circle); index = layers.size() - 1; circle.requestRedraw(); this.mapView.getModel().mapViewPosition.setCenter(position); } } }
paint1 = AndroidGraphicFactory.INSTANCE.createPaint(); paint1.setStyle(Style.STROKE); paint1.setTextAlign(Align.CENTER); FontFamily fontFamily = FontFamily.DEFAULT; FontStyle fontStyle = FontStyle.BOLD; paint2 = AndroidGraphicFactory.INSTANCE.createPaint(); paint2.setStyle(Style.STROKE); paint2.setTextAlign(Align.CENTER); fontFamily = FontFamily.DEFAULT; fontStyle = FontStyle.BOLD; paint3 = AndroidGraphicFactory.INSTANCE.createPaint(); paint3.setStyle(Style.STROKE); paint3.setTextAlign(Align.CENTER); fontFamily = FontFamily.DEFAULT; fontStyle = FontStyle.BOLD;