Creates a line symbolizer with the specified stroke.

@param strokeInfo the stroke
@return the symbolizer
499359
public static LineSymbolizerInfo createLineSymbolizer(StrokeInfo strokeInfo) {
		LineSymbolizerInfo symbolizerInfo = new LineSymbolizerInfo();
		symbolizerInfo.setStroke(strokeInfo);
		return symbolizerInfo;
	}
749994
def draw_line(
            self, x0:float, y0:float, x1:float, y1:float, *,
            stroke:Color,
            stroke_width:float=1,
            stroke_dash:typing.Sequence=None
            ) -> None:
        """"""
        pass
1287812
function(context, font, stroke) {
        context.font = font.font;
        context.fillStyle = font.fillStyle.toRGBA();
        if (stroke === true) {
            context.strokeStyle = font.strokeStyle.toRGBA();
            context.lineWidth = font.lineWidth;
        }
        context.textAlign = font.textAlign;
        context.textBaseline = font.textBaseline;
    }
596653
public void setStrokeExternalGraphicStrokePath( String externalGraphicPath ) throws MalformedURLException {
        if (strokeExternalGraphicStroke == null) {
            Graphic graphic = null;
            LineSymbolizerWrapper lineSymbolizerWrapper = adapt(LineSymbolizerWrapper.class);
            PolygonSymbolizerWrapper polygonSymbolizerWrapper = adapt(PolygonSymbolizerWrapper.class);
            if (lineSymbolizerWrapper != null) {
                graphic = lineSymbolizerWrapper.getStrokeGraphicStroke();
                if (graphic == null) {
                    graphic = sb.createGraphic();
                    lineSymbolizerWrapper.setStrokeGraphicStroke(graphic);
                }
            } else if (polygonSymbolizerWrapper != null) {
                graphic = polygonSymbolizerWrapper.getStrokeGraphicStroke();
                if (graphic == null) {
                    graphic = sb.createGraphic();
                    polygonSymbolizerWrapper.setStrokeGraphicStroke(graphic);
                }
            } else {
                return;
            }

            graphic.graphicalSymbols().clear();
            String urlStr = externalGraphicPath;
            if (!externalGraphicPath.startsWith("http:") && !externalGraphicPath.startsWith("file:")) { //$NON-NLS-1$ //$NON-NLS-2$
                urlStr = "file:" + externalGraphicPath; //$NON-NLS-1$
            }
            strokeExternalGraphicStroke = sb.createExternalGraphic(new URL(urlStr), getFormat(externalGraphicPath));
            graphic.graphicalSymbols().add(strokeExternalGraphicStroke);
        } else {
            setExternalGraphicPath(externalGraphicPath, strokeExternalGraphicStroke);
        }
    }
511985
@Nullable
    public PointSymbolizer createPointSymbolizer(final PJsonObject styleJson) {

        if (this.allowNullSymbolizer && !(
                styleJson.has(JSON_EXTERNAL_GRAPHIC) || styleJson.has(JSON_GRAPHIC_NAME) ||
                        styleJson.has(JSON_POINT_RADIUS))) {
            return null;
        }

        Graphic graphic = this.styleBuilder.createGraphic();
        graphic.graphicalSymbols().clear();
        if (styleJson.has(JSON_EXTERNAL_GRAPHIC)) {
            String externalGraphicUrl = validateURL(styleJson.getString(JSON_EXTERNAL_GRAPHIC));

            try {
                final URI uri = URI.create(externalGraphicUrl);
                if (uri.getScheme().startsWith("http")) {
                    final ClientHttpRequest request = this.requestFactory.createRequest(uri, HttpMethod.GET);
                    externalGraphicUrl = request.getURI().toString();
                }
            } catch (IOException ignored) {
                // ignored
            }

            final String graphicFormat = getGraphicFormat(externalGraphicUrl, styleJson);
            ExternalGraphic externalGraphic = null;
            if (externalGraphicUrl.startsWith("data:")) {
                try {
                    externalGraphic = this.styleBuilder.createExternalGraphic(
                            new URL(null, externalGraphicUrl, new Handler()),
                            graphicFormat
                    );
                } catch (MalformedURLException e) {
                    // ignored
                }
            } else {
                externalGraphic =
                        this.styleBuilder.createExternalGraphic(externalGraphicUrl, graphicFormat);
            }
            if (externalGraphic != null) {
                graphic.graphicalSymbols().add(externalGraphic);
            }
        }

        if (styleJson.has(JSON_GRAPHIC_NAME)) {
            Expression graphicName =
                    parseProperty(styleJson.getString(JSON_GRAPHIC_NAME), input -> input);
            Fill fill = createFill(styleJson);
            Stroke stroke = createStroke(styleJson, false);

            final Mark mark = this.styleBuilder.createMark(graphicName, fill, stroke);
            graphic.graphicalSymbols().add(mark);
        }

        if (graphic.graphicalSymbols().isEmpty()) {
            Fill fill = createFill(styleJson);
            Stroke stroke = createStroke(styleJson, false);

            final Mark mark = this.styleBuilder.createMark(DEFAULT_POINT_MARK, fill, stroke);
            graphic.graphicalSymbols().add(mark);
        }

        graphic.setOpacity(
                parseExpression(null, styleJson, JSON_GRAPHIC_OPACITY, Double::parseDouble));

        if (!StringUtils.isEmpty(styleJson.optString(JSON_POINT_RADIUS))) {
            Expression size =
                    parseExpression(null, styleJson, JSON_POINT_RADIUS,
                                    (final String input) -> Double.parseDouble(input) * 2);
            graphic.setSize(size);
        } else if (!StringUtils.isEmpty(styleJson.optString(JSON_GRAPHIC_WIDTH))) {
            Expression size =
                    parseExpression(null, styleJson, JSON_GRAPHIC_WIDTH, Double::parseDouble);
            graphic.setSize(size);
        }

        if (!StringUtils.isEmpty(styleJson.optString(JSON_GRAPHIC_Y_OFFSET)) &&
                !StringUtils.isEmpty(styleJson.optString(JSON_GRAPHIC_X_OFFSET))) {
            Expression dy =
                    parseExpression(null, styleJson, JSON_GRAPHIC_Y_OFFSET, Double::parseDouble);
            Expression dx =
                    parseExpression(null, styleJson, JSON_GRAPHIC_X_OFFSET, Double::parseDouble);
            Displacement offset = this.styleBuilder.createDisplacement(dx, dy);
            graphic.setDisplacement(offset);
        }

        if (!StringUtils.isEmpty(styleJson.optString(JSON_ROTATION))) {
            final Expression rotation =
                    parseExpression(null, styleJson, JSON_ROTATION, Double::parseDouble);
            graphic.setRotation(rotation);
        }

        return this.styleBuilder.createPointSymbolizer(graphic);
    }
249597
private BufferedImage create_TICKMARKS_Image(final int WIDTH, final double FREE_AREA_ANGLE,
                                                                final double OFFSET, final double MIN_VALUE,
                                                                final double MAX_VALUE, final double ANGLE_STEP,
                                                                final int TICK_LABEL_PERIOD,
                                                                final int SCALE_DIVIDER_POWER, final boolean DRAW_TICKS,
                                                                final boolean DRAW_TICK_LABELS,
                                                                java.util.ArrayList<Section> tickmarkSections,
                                                                BufferedImage image) {
        if (WIDTH <= 0) {
            return null;
        }
        if (image == null) {
            image = UTIL.createImage(WIDTH, WIDTH, Transparency.TRANSLUCENT);
        }
        final Graphics2D G2 = image.createGraphics();
        G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        //G2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        //G2.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
        //G2.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
        //G2.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
        G2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
        G2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        final int IMAGE_WIDTH = image.getWidth();
        final int IMAGE_HEIGHT = image.getHeight();

        final Font STD_FONT = new Font("Verdana", 0, (int) (0.09 * WIDTH));
        final BasicStroke MEDIUM_STROKE = new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL);
        final BasicStroke THIN_STROKE = new BasicStroke(1.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL);
        final int TEXT_DISTANCE = (int) (0.17 * WIDTH);
        final int MED_LENGTH = (int) (0.05 * WIDTH);
        final int MAX_LENGTH = (int) (0.07 * WIDTH);

        final Color TEXT_COLOR = super.getBackgroundColor().LABEL_COLOR;
        final Color TICK_COLOR = super.getBackgroundColor().LABEL_COLOR;

        // Create the ticks itself
        final float RADIUS = IMAGE_WIDTH * 0.4f;
        final Point2D ALTIMETER_CENTER = new Point2D.Double(IMAGE_WIDTH / 2.0f, IMAGE_HEIGHT / 2.0f);

        // Draw ticks
        Point2D innerPoint;
        Point2D outerPoint;
        Point2D textPoint = null;
        Line2D tick;
        int counter = 0;
        int tickCounter = 0;

        G2.setFont(STD_FONT);

        double sinValue = 0;
        double cosValue = 0;

        double alpha; // angle for the tickmarks
        final double ALPHA_START = -OFFSET - (FREE_AREA_ANGLE / 2.0);
        float valueCounter; // value for the tickmarks

        for (alpha = ALPHA_START, valueCounter = 0; valueCounter <= 10; alpha -= ANGLE_STEP * 0.1, valueCounter += 0.1) {
            G2.setStroke(THIN_STROKE);
            sinValue = Math.sin(alpha);
            cosValue = Math.cos(alpha);

            // tickmark every 2 units
            if (counter % 2 == 0) {
                G2.setStroke(THIN_STROKE);
                innerPoint = new Point2D.Double(ALTIMETER_CENTER.getX() + (RADIUS - MED_LENGTH) * sinValue, ALTIMETER_CENTER.getY() + (RADIUS - MED_LENGTH) * cosValue);
                outerPoint = new Point2D.Double(ALTIMETER_CENTER.getX() + RADIUS * sinValue, ALTIMETER_CENTER.getY() + RADIUS * cosValue);
                // Draw ticks
                G2.setColor(TICK_COLOR);
                tick = new Line2D.Double(innerPoint.getX(), innerPoint.getY(), outerPoint.getX(), outerPoint.getY());
                G2.draw(tick);
            }

            // Different tickmark every 10 units
            if (counter == 10 || counter == 0) {
                G2.setColor(TEXT_COLOR);
                G2.setStroke(MEDIUM_STROKE);
                innerPoint = new Point2D.Double(ALTIMETER_CENTER.getX() + (RADIUS - MAX_LENGTH) * sinValue, ALTIMETER_CENTER.getY() + (RADIUS - MAX_LENGTH) * cosValue);
                outerPoint = new Point2D.Double(ALTIMETER_CENTER.getX() + RADIUS * sinValue, ALTIMETER_CENTER.getY() + RADIUS * cosValue);
                textPoint = new Point2D.Double(ALTIMETER_CENTER.getX() + (RADIUS - TEXT_DISTANCE + STD_FONT.getSize() / 2f) * sinValue, ALTIMETER_CENTER.getY() + (RADIUS - TEXT_DISTANCE + STD_FONT.getSize() / 2f) * cosValue + TEXT_DISTANCE / 2.5f);

                // Draw text
                final TextLayout TEXT_LAYOUT = new TextLayout(String.valueOf(Math.round(valueCounter)), G2.getFont(), RENDER_CONTEXT);

                final Rectangle2D TEXT_BOUNDARY = TEXT_LAYOUT.getBounds();

                // if gauge is full circle, avoid painting maxValue over minValue
                if (FREE_AREA_ANGLE == 0) {
                    if (Float.compare(valueCounter, 10) != 0) {
                        G2.drawString(String.valueOf(Math.round(valueCounter)), (int) (textPoint.getX() - TEXT_BOUNDARY.getWidth() / 2.0), (int) ((textPoint.getY() - TEXT_BOUNDARY.getHeight() / 2.0)));
                    }
                } else {
                    G2.drawString(String.valueOf(Math.round(valueCounter)), (int) (textPoint.getX() - TEXT_BOUNDARY.getWidth() / 2.0), (int) ((textPoint.getY() - TEXT_BOUNDARY.getHeight() / 2.0)));
                }
                counter = 0;
                tickCounter++;

                // Draw ticks
                G2.setColor(TICK_COLOR);
                tick = new Line2D.Double(innerPoint.getX(), innerPoint.getY(), outerPoint.getX(), outerPoint.getY());
                G2.draw(tick);
            }

            counter++;
        }

        G2.dispose();

        return image;
    }
736079
public static SymbolizerTypeInfo createSymbolizer(LayerType type, FeatureStyleInfo featureStyle) {
		SymbolInfo symbol = featureStyle.getSymbol();
		SymbolizerTypeInfo symbolizer = null;
		StrokeInfo stroke = createStroke(featureStyle.getStrokeColor(), featureStyle.getStrokeWidth(),
				featureStyle.getStrokeOpacity(), featureStyle.getDashArray());
		FillInfo fill = createFill(featureStyle.getFillColor(), featureStyle.getFillOpacity());
		switch (type) {
			case GEOMETRY:
				break;
			case LINESTRING:
			case MULTILINESTRING:
				symbolizer = createLineSymbolizer(stroke);
					break;
			case MULTIPOINT:
			case POINT:
				GraphicInfo graphic;
				if (symbol.getCircle() != null) {
					MarkInfo circle = createMark(WKN_CIRCLE, fill, stroke);
					graphic = createGraphic(circle, (int) (2 * symbol.getCircle().getR()));
				} else if (symbol.getRect() != null) {
					MarkInfo rect = createMark(WKN_RECT, fill, stroke);
					graphic = createGraphic(rect, (int) symbol.getRect().getH());
				} else {
					ExternalGraphicInfo image = createExternalGraphic(symbol.getImage().getHref());
					graphic = createGraphic(image, symbol.getImage().getHeight());
				}
				symbolizer = createPointSymbolizer(graphic);
				break;
			case POLYGON:
			case MULTIPOLYGON:
				symbolizer = createPolygonSymbolizer(fill, stroke);
				break;
			default:
				throw new IllegalStateException("Unknown layer type " + type);
		}
		return symbolizer;
	}
1113776
function() {
      return [
        "stroke: ", (this.stroke ? this.stroke : 'none'), "; ",
        "stroke-width: ", (this.strokeWidth ? this.strokeWidth : '0'), "; ",
        "stroke-dasharray: ", (this.strokeDashArray ? this.strokeDashArray.join(' ') : "; "),
        "fill: ", (this.fill ? this.fill : 'none'), "; ",
        "opacity: ", (this.opacity ? this.opacity : '1'), ";"
      ].join("");
    }
592450
def line_cap_type(self):
        """"""
        key = self._data.get(b'strokeStyleLineCapType').enum
        return self.STROKE_STYLE_LINE_CAP_TYPES.get(key, str(key))
857110
public static RuleInfo createRule(String title, String name, SymbolizerTypeInfo symbolizer) {
		RuleInfo rule = new RuleInfo();
		rule.setTitle(title);
		rule.setName(name);
		rule.getSymbolizerList().add(symbolizer);
		return rule;
	}
748676
private BufferedImage create_TICKMARKS_Image(final int WIDTH, final double FREE_AREA_ANGLE,
                                                                final double OFFSET, final double MIN_VALUE,
                                                                final double MAX_VALUE, final double ANGLE_STEP,
                                                                final int TICK_LABEL_PERIOD,
                                                                final int SCALE_DIVIDER_POWER, final boolean DRAW_TICKS,
                                                                final boolean DRAW_TICK_LABELS,
                                                                ArrayList<Section> tickmarkSections,
                                                                BufferedImage image) {
        if (WIDTH <= 0) {
            return null;
        }
        if (image == null) {
            image = UTIL.createImage(WIDTH, (int) (1.0 * WIDTH), Transparency.TRANSLUCENT);
        }
        final Graphics2D G2 = image.createGraphics();
        G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        G2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        G2.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
        G2.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
        G2.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
        G2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
        G2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        final int IMAGE_WIDTH = image.getWidth();
        final int IMAGE_HEIGHT = image.getHeight();

        final Font STD_FONT = new Font("Verdana", 0, (int) (0.04 * WIDTH));
        final Font PERCENTAGE_FONT = new Font("Verdana", 0, (int) (0.03 * WIDTH));
        final BasicStroke MEDIUM_STROKE = new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL);
        final BasicStroke THIN_STROKE = new BasicStroke(0.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL);
        final BasicStroke VERY_THIN_STROKE = new BasicStroke(0.1f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL);
        final int TEXT_DISTANCE = (int) (0.08 * WIDTH);
        final int MIN_LENGTH = (int) (0.0133333333 * WIDTH);
        final int MED_LENGTH = (int) (0.02 * WIDTH);
        final int MAX_LENGTH = (int) (0.04 * WIDTH);

        // Create the ticks itself
        final float RADIUS = IMAGE_WIDTH * 0.38f;
        final Point2D GAUGE_CENTER = new Point2D.Double(IMAGE_WIDTH / 2.0f, IMAGE_HEIGHT / 2.0f);

        // Draw ticks
        Point2D innerPoint;
        Point2D outerPoint;
        Point2D textPoint = null;
        Line2D tick;
        int counter = 0;
        int tickCounter = 0;
        float valueCounter = 90;
        boolean countUp = false;
        float valueStep = 1;

        G2.setFont(STD_FONT);

        boolean togglePercentage = false;
        double sinValue = 0;
        double cosValue = 0;

        final double STEP = (2.0 * Math.PI) / (360.0);

        for (double alpha = (2.0 * Math.PI); alpha >= STEP; alpha -= STEP) {
            G2.setStroke(THIN_STROKE);
            sinValue = Math.sin(alpha);
            cosValue = Math.cos(alpha);
            textPoint = new Point2D.Double(GAUGE_CENTER.getX() + (RADIUS - TEXT_DISTANCE) * sinValue, GAUGE_CENTER.getY() + (RADIUS - TEXT_DISTANCE) * cosValue);
            innerPoint = new Point2D.Double(GAUGE_CENTER.getX() + (RADIUS - MIN_LENGTH) * sinValue, GAUGE_CENTER.getY() + (RADIUS - MIN_LENGTH) * cosValue);
            outerPoint = new Point2D.Double(GAUGE_CENTER.getX() + RADIUS * sinValue, GAUGE_CENTER.getY() + RADIUS * cosValue);
            G2.setColor(super.getBackgroundColor().LABEL_COLOR);

            // Different tickmark every 5 units
            if (counter % 5 == 0) {
                G2.setColor(super.getBackgroundColor().LABEL_COLOR);
                G2.setStroke(THIN_STROKE);
                innerPoint = new Point2D.Double(GAUGE_CENTER.getX() + (RADIUS - MED_LENGTH) * sinValue, GAUGE_CENTER.getY() + (RADIUS - MED_LENGTH) * cosValue);
                outerPoint = new Point2D.Double(GAUGE_CENTER.getX() + RADIUS * sinValue, GAUGE_CENTER.getY() + RADIUS * cosValue);

                // Draw ticks
                tick = new Line2D.Double(innerPoint.getX(), innerPoint.getY(), outerPoint.getX(), outerPoint.getY());
                G2.draw(tick);
            }

            // Different tickmark every 45 units plus text
            if (counter == 45 || counter == 0) {
                G2.setColor(super.getBackgroundColor().LABEL_COLOR);
                G2.setStroke(MEDIUM_STROKE);
                innerPoint = new Point2D.Double(GAUGE_CENTER.getX() + (RADIUS - MAX_LENGTH) * sinValue, GAUGE_CENTER.getY() + (RADIUS - MAX_LENGTH) * cosValue);
                outerPoint = new Point2D.Double(GAUGE_CENTER.getX() + RADIUS * sinValue, GAUGE_CENTER.getY() + RADIUS * cosValue);

                // Draw outer text
                textPoint = new Point2D.Double(GAUGE_CENTER.getX() + (RADIUS - TEXT_DISTANCE) * sinValue, GAUGE_CENTER.getY() + (RADIUS - TEXT_DISTANCE) * cosValue);
                G2.setFont(STD_FONT);

                G2.fill(UTIL.rotateTextAroundCenter(G2, String.valueOf((int) valueCounter) + "\u00B0", (int) textPoint.getX(), (int) textPoint.getY(), (Math.PI - alpha)));

                if (togglePercentage) {
                    textPoint = new Point2D.Double(GAUGE_CENTER.getX() + (RADIUS - TEXT_DISTANCE * 2) * sinValue, GAUGE_CENTER.getY() + (RADIUS - TEXT_DISTANCE * 2) * cosValue);
                    G2.setFont(PERCENTAGE_FONT);

                    G2.fill(UTIL.rotateTextAroundCenter(G2, "100%", (int) textPoint.getX(), (int) textPoint.getY(), (Math.PI - alpha)));
                } else if (valueCounter == 0) {
                    textPoint = new java.awt.geom.Point2D.Double(GAUGE_CENTER.getX() + (RADIUS - TEXT_DISTANCE * 2) * sinValue, GAUGE_CENTER.getY() + (RADIUS - TEXT_DISTANCE * 2) * cosValue);
                    G2.setFont(PERCENTAGE_FONT);

                    G2.fill(UTIL.rotateTextAroundCenter(G2, "0%", (int) textPoint.getX(), (int) textPoint.getY(), (Math.PI - alpha)));
                } else {
                    textPoint = new Point2D.Double(GAUGE_CENTER.getX() + (RADIUS - TEXT_DISTANCE * 2) * sinValue, GAUGE_CENTER.getY() + (RADIUS - TEXT_DISTANCE * 2) * cosValue);
                    G2.setFont(PERCENTAGE_FONT);

                    G2.fill(UTIL.rotateTextAroundCenter(G2, "\u221E", (int) textPoint.getX(), (int) textPoint.getY(), (Math.PI - alpha)));
                }

                togglePercentage ^= true;

                counter = 0;
                tickCounter++;

                // Draw ticks
                tick = new Line2D.Double(innerPoint.getX(), innerPoint.getY(), outerPoint.getX(), outerPoint.getY());
                G2.draw(tick);
            }

            // Draw ticks
            G2.setStroke(VERY_THIN_STROKE);
            tick = new Line2D.Double(innerPoint.getX(), innerPoint.getY(), outerPoint.getX(), outerPoint.getY());
            G2.draw(tick);

            counter++;
            if (valueCounter == 0) {
                countUp = true;
            }
            if (valueCounter == 90) {
                countUp = false;
            }
            if (countUp) {
                valueCounter += valueStep;
            } else {
                valueCounter -= valueStep;
            }
        }

        G2.dispose();

        return image;
    }
1014079
@VisibleForTesting
    protected TextSymbolizer createTextSymbolizer(final PJsonObject styleJson) {
        final TextSymbolizer textSymbolizer = this.styleBuilder.createTextSymbolizer();

        // make sure that labels are also rendered if a part of the text would be outside
        // the view context, see http://docs.geoserver.org/stable/en/user/styling/sld-reference/labeling
        // .html#partials
        textSymbolizer.getOptions().put("partials", "true");

        if (styleJson.has(JSON_LABEL)) {
            final Expression label =
                    parseExpression(null, styleJson, JSON_LABEL,
                                    (final String labelValue) -> labelValue.replace("${", "")
                                            .replace("}", ""));

            textSymbolizer.setLabel(label);
        } else {
            return null;
        }

        textSymbolizer.setFont(createFont(textSymbolizer.getFont(), styleJson));

        if (styleJson.has(JSON_LABEL_ANCHOR_POINT_X) ||
                styleJson.has(JSON_LABEL_ANCHOR_POINT_Y) ||
                styleJson.has(JSON_LABEL_ALIGN) ||
                styleJson.has(JSON_LABEL_X_OFFSET) ||
                styleJson.has(JSON_LABEL_Y_OFFSET) ||
                styleJson.has(JSON_LABEL_ROTATION) ||
                styleJson.has(JSON_LABEL_PERPENDICULAR_OFFSET)) {
            textSymbolizer.setLabelPlacement(createLabelPlacement(styleJson));
        }

        if (!StringUtils.isEmpty(styleJson.optString(JSON_HALO_RADIUS)) ||
                !StringUtils.isEmpty(styleJson.optString(JSON_HALO_COLOR)) ||
                !StringUtils.isEmpty(styleJson.optString(JSON_HALO_OPACITY)) ||
                !StringUtils.isEmpty(styleJson.optString(JSON_LABEL_OUTLINE_WIDTH)) ||
                !StringUtils.isEmpty(styleJson.optString(JSON_LABEL_OUTLINE_COLOR))) {
            textSymbolizer.setHalo(createHalo(styleJson));
        }

        if (!StringUtils.isEmpty(styleJson.optString(JSON_FONT_COLOR)) ||
                !StringUtils.isEmpty(styleJson.optString(JSON_FONT_OPACITY))) {
            textSymbolizer.setFill(addFill(
                    styleJson.optString(JSON_FONT_COLOR, "black"),
                    styleJson.optString(JSON_FONT_OPACITY, "1.0")));
        }

        this.addVendorOptions(JSON_LABEL_ALLOW_OVERRUNS, styleJson, textSymbolizer);
        this.addVendorOptions(JSON_LABEL_AUTO_WRAP, styleJson, textSymbolizer);
        this.addVendorOptions(JSON_LABEL_CONFLICT_RESOLUTION, styleJson, textSymbolizer);
        this.addVendorOptions(JSON_LABEL_FOLLOW_LINE, styleJson, textSymbolizer);
        this.addVendorOptions(JSON_LABEL_GOODNESS_OF_FIT, styleJson, textSymbolizer);
        this.addVendorOptions(JSON_LABEL_GROUP, styleJson, textSymbolizer);
        this.addVendorOptions(JSON_LABEL_MAX_DISPLACEMENT, styleJson, textSymbolizer);
        this.addVendorOptions(JSON_LABEL_SPACE_AROUND, styleJson, textSymbolizer);

        return textSymbolizer;
    }
146694
public static InlineLabel newInlineLabel (String text, String... styles)
    {
        return setStyleNames(new InlineLabel(text), styles);
    }
505557
private BufferedImage create_TICKMARKS_Image(final int WIDTH) {
        if (WIDTH <= 0) {
            return null;
        }

        final BufferedImage IMAGE = UTIL.createImage(WIDTH, WIDTH, Transparency.TRANSLUCENT);
        final Graphics2D G2 = IMAGE.createGraphics();
        G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        G2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
        G2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        G2.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
        G2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        G2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
        G2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
        final int IMAGE_WIDTH = IMAGE.getWidth();

        final AffineTransform OLD_TRANSFORM = G2.getTransform();

        final BasicStroke THIN_STROKE = new BasicStroke(0.01f * IMAGE_WIDTH, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL);
        final Font FONT = new Font("Verdana", 0, (int) (0.0747663551f * IMAGE_WIDTH));
        final float TEXT_DISTANCE = 0.1f * IMAGE_WIDTH;
        final float MIN_LENGTH = 0.02f * IMAGE_WIDTH;
        final float MED_LENGTH = 0.04f * IMAGE_WIDTH;

        // Create the watch itself
        final float RADIUS = IMAGE_WIDTH * 0.37f;
        CENTER.setLocation(IMAGE_WIDTH / 2.0f, IMAGE_WIDTH / 2.0f);

        // Draw ticks
        Point2D innerPoint = new Point2D.Double();
        Point2D outerPoint = new Point2D.Double();
        Point2D textPoint = new Point2D.Double();
        Line2D tick;
        int tickCounterFull = 0;
        int tickCounterHalf = 0;
        int counter = 0;

        double sinValue = 0;
        double cosValue = 0;

        final double STEP = (2.0 * Math.PI) / (20.0);

        if (isTickmarkColorFromThemeEnabled()) {
            G2.setColor(getBackgroundColor().LABEL_COLOR);
        } else {
            G2.setColor(getTickmarkColor());
        }

        for (double alpha = 2.0 * Math.PI; alpha >= 0; alpha -= STEP) {
            G2.setStroke(THIN_STROKE);
            sinValue = Math.sin(alpha);
            cosValue = Math.cos(alpha);

            if (tickCounterHalf == 1) {
                G2.setStroke(THIN_STROKE);
                innerPoint.setLocation(CENTER.getX() + (RADIUS - MIN_LENGTH) * sinValue, CENTER.getY() + (RADIUS - MIN_LENGTH) * cosValue);
                outerPoint.setLocation(CENTER.getX() + RADIUS * sinValue, CENTER.getY() + RADIUS * cosValue);
                // Draw ticks
                tick = new Line2D.Double(innerPoint.getX(), innerPoint.getY(), outerPoint.getX(), outerPoint.getY());
                G2.draw(tick);

                tickCounterHalf = 0;
            }

            // Different tickmark every 15 units
            if (tickCounterFull == 2) {
                G2.setStroke(THIN_STROKE);
                innerPoint.setLocation(CENTER.getX() + (RADIUS - MED_LENGTH) * sinValue, CENTER.getY() + (RADIUS - MED_LENGTH) * cosValue);
                outerPoint.setLocation(CENTER.getX() + RADIUS * sinValue, CENTER.getY() + RADIUS * cosValue);

                // Draw ticks
                tick = new Line2D.Double(innerPoint.getX(), innerPoint.getY(), outerPoint.getX(), outerPoint.getY());
                G2.draw(tick);

                tickCounterFull = 0;
            }

            // Draw text
            G2.setFont(FONT);
            textPoint.setLocation(CENTER.getX() + (RADIUS - TEXT_DISTANCE) * sinValue, CENTER.getY() + (RADIUS - TEXT_DISTANCE) * cosValue);
            if (counter != 20 && counter % 2 == 0) {
                G2.rotate(Math.toRadians(0), CENTER.getX(), CENTER.getY());
                G2.fill(UTIL.rotateTextAroundCenter(G2, String.valueOf(counter / 2), (int) textPoint.getX(), (int) textPoint.getY(), (2 * Math.PI - alpha)));
            }

            G2.setTransform(OLD_TRANSFORM);

            tickCounterHalf++;
            tickCounterFull++;

            counter++;
        }

        G2.dispose();

        return IMAGE;
    }
1025490
public Stroke getStroke() {
		Stroke theStroke = stroke;
		if (theStroke == null) {
			theStroke = new BasicStroke(strokeWidth);
			stroke = theStroke;
		}
		return theStroke;
	}
1117777
public String lineProtocol() {
    StringBuilder sb = new StringBuilder();

    for (Point point : this.points) {
      sb.append(point.lineProtocol(this.precision)).append("\n");
    }
    return sb.toString();
  }
76059
public static LineSymbolizer lineSymbolizerFromRule( Rule rule ) {
        List<Symbolizer> symbolizers = rule.symbolizers();
        LineSymbolizer lineSymbolizer = null;
        for( Symbolizer symbolizer : symbolizers ) {
            if (symbolizer instanceof LineSymbolizer) {
                lineSymbolizer = (LineSymbolizer) symbolizer;
                break;
            }
        }
        if (lineSymbolizer == null) {
            throw new IllegalArgumentException();
        }
        return lineSymbolizer;
    }