Examples of TextSymbolizer


Examples of org.geotools.styling.TextSymbolizer

        return symbolizer;
    }

    protected static TextSymbolizer createTextSymbolizer() {
        TextSymbolizer symbolizer = styleBuilder.createTextSymbolizer();
        return symbolizer;
    }
View Full Code Here

Examples of org.geotools.styling.TextSymbolizer

            // LABEL PARAMETERS
        case LABELENABLE: {
            boolean doEnable = Boolean.parseBoolean(value);
            if (doEnable) {
                if (textSymbolizerWrapper == null) {
                    TextSymbolizer textSymbolizer = Utilities.createDefaultTextSymbolizer(SLD.POLYGON);
                    ruleWrapper.addSymbolizer(textSymbolizer, TextSymbolizerWrapper.class);
                    labelsParametersComposite.update(ruleWrapper);
                }
            } else {
                ruleWrapper.removeTextSymbolizersWrapper();
View Full Code Here

Examples of org.geotools.styling.TextSymbolizer

            // LABEL PARAMETERS
        case LABELENABLE: {
            boolean doEnable = Boolean.parseBoolean(value);
            if (doEnable) {
                if (textSymbolizerWrapper == null) {
                    TextSymbolizer textSymbolizer = Utilities.createDefaultTextSymbolizer(SLD.POINT);
                    ruleWrapper.addSymbolizer(textSymbolizer, TextSymbolizerWrapper.class);
                    labelsParametersComposite.update(ruleWrapper);
                }
            } else {
                ruleWrapper.removeTextSymbolizersWrapper();
View Full Code Here

Examples of org.geotools.styling.TextSymbolizer

     * (non-Javadoc)
     *
     * @see org.locationtech.udig.style.IStyleConfigurator#apply()
     */
    private void apply( int mask ) {
        TextSymbolizer textSymbolizer = (TextSymbolizer) getContent();
        if ((mask & LABEL) != 0) {
            applyLabel(textSymbolizer, getStyleBuilder());
        }
        if ((mask & FONTCOLOR) != 0) {
            applyLabel(textSymbolizer, getStyleBuilder());
View Full Code Here

Examples of org.geotools.styling.TextSymbolizer

        }
        this.labelPlacement = placement;
       
        Expression exp = (Expression) CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints()).
                property(this.labelType);
        TextSymbolizer text = build.createTextSymbolizer(fill, new Font[] {gtFont},
                null, exp, placement, null);
        if (SLD.isLine(this.schema)) {
            text.addToOptions("group", "yes"); //$NON-NLS-1$ //$NON-NLS-2$
        }
        text.addToOptions("spaceAround", "2"); //$NON-NLS-1$ //$NON-NLS-2$
        return text;
    }
View Full Code Here

Examples of org.geotools.styling.TextSymbolizer

                if (labelStyles.isEmpty()) {
                    encodeDefaultTextStyle();
                } else {
                    Iterator<TextSymbolizer> iter = labelStyles.iterator();
                    while (iter.hasNext()) {
                        TextSymbolizer sym = (TextSymbolizer) iter.next();
                        try {
                            TextStyle2D style = (TextStyle2D) styleFactory
                                .createStyle(feature, sym, scaleRange);
                            encodeTextStyle(feature, style, sym);
                        } catch (IllegalArgumentException iae) {
                            LOGGER.fine(iae.getMessage() + " for "
                                    + sym.toString());
                        }
                    }
                }

                // Lines
                if (!lineStyles.isEmpty()) {
                    Iterator<LineSymbolizer> iter = lineStyles.iterator();
                    while (iter.hasNext()) {
                        LineSymbolizer sym = (LineSymbolizer) iter.next();
                        try {
                            LineStyle2D style = (LineStyle2D) styleFactory
                                    .createStyle(feature, sym, scaleRange);
                            encodeLineStyle(feature, style, sym);
                        } catch (IllegalArgumentException iae) {
                            LOGGER.fine(iae.getMessage() + " for "
                                    + sym.toString());
                        }
                    }
                }

                // Polygons
                if (!polyStyles.isEmpty()) {
                    Iterator<PolygonSymbolizer> iter = polyStyles.iterator();
                    while (iter.hasNext()) {
                        PolygonSymbolizer sym = (PolygonSymbolizer) iter.next();
                        try {
                            PolygonStyle2D style = (PolygonStyle2D) styleFactory
                                    .createStyle(feature, sym, scaleRange);
                            // The last argument is forced outline
                            encodePolygonStyle(feature, style, sym, !lineStyles
                                    .isEmpty());
                        } catch (IllegalArgumentException iae) {
                            LOGGER.fine(iae.getMessage() + " for "
                                    + sym.toString());
                        }
                    }
                }

            } catch (Exception e) {
View Full Code Here

Examples of org.geotools.styling.TextSymbolizer

        for (int m = 0; m < length; m++) {
            LOGGER.finer(new StringBuffer("applying symbolizer ").append(
                    symbolizers[m]).toString());

            if (symbolizers[m] instanceof TextSymbolizer) {
                TextSymbolizer ts = (TextSymbolizer) symbolizers[m];
                Expression ex = ts.getLabel();
                featureLabel.append((String) ex.evaluate(feature, String.class)); // attach
                // the lable title

                Style2D style = styleFactory.createStyle(feature,
                        symbolizers[m], scaleRange);
View Full Code Here

Examples of org.geotools.styling.TextSymbolizer

            } else if (vectorResult) {
                // TODO: come back and sort out crs transformation
                // CoordinateReferenceSystem crs = findGeometryCS(feature,
                // symbolizers[m]);
                if (symbolizers[m] instanceof TextSymbolizer) {
                    TextSymbolizer ts = (TextSymbolizer) symbolizers[m];
                    Expression ex = ts.getLabel();
                    String value = (String) ex.evaluate(feature, String.class);
                    title.append(value);

                    Style2D style = styleFactory.createStyle(feature,
                            symbolizers[m], scaleRange);
View Full Code Here

Examples of org.geotools.styling.TextSymbolizer

            write(styleString.toString());
        } else if (style instanceof TextStyle2D
                && sym instanceof TextSymbolizer) {
            final StringBuffer styleString = new StringBuffer();
            TextSymbolizer textSym = (TextSymbolizer) sym;

            styleString.append("<LabelStyle><color>");

            if (textSym.getFill() != null) {
                int opacity = 255;

                if (textSym.getFill().getOpacity() != null) {
                    float op = getOpacity(textSym.getFill().getOpacity());
                    opacity = (new Float(255 * op)).intValue();
                }

                Paint p = ((TextStyle2D) style).getFill();

View Full Code Here

Examples of org.geotools.styling.TextSymbolizer

        Expression yDisplacement = builder.attributeExpression(Constants.Style.Grid.ATT_Y_DISPLACEMENT);
        Displacement displacement = builder.createDisplacement(xDisplacement, yDisplacement);
        Expression rotation = builder.attributeExpression(Constants.Style.Grid.ATT_ROTATION);

        PointPlacement text1Placement = builder.createPointPlacement(builder.createAnchorPoint(0, 0), displacement, rotation);
        final TextSymbolizer text1 = builder.createTextSymbolizer();
        text1.setFill(builder.createFill(color));
        text1.setLabelPlacement(text1Placement);
        final double opacity = 0.8;
        text1.setHalo(builder.createHalo(Color.white, opacity, 2));
        text1.setLabel(builder.attributeExpression(Constants.Style.Grid.ATT_LABEL));
        return text1;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.