Examples of Style2D


Examples of org.geotools.renderer.style.Style2D

                    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);
                    writeStyle(style, feature.getID(), symbolizers[m]);
                } else {
                    Style2D style = styleFactory.createStyle(feature,
                            symbolizers[m], scaleRange);
                    writeStyle(style, feature.getID(), symbolizers[m]);
                }
            } else if (!vectorResult) {
                com.vividsolutions.jts.geom.Envelope envelope = this.mapContext
View Full Code Here

Examples of org.geotools.renderer.style.Style2D

                if (symbolizer instanceof RasterSymbolizer) {
                    throw new IllegalStateException(
                            "It is not legal to have a RasterSymbolizer here"
                            );
                } else {
                    Style2D style2d =
                        styleFactory.createStyle(sampleFeature, symbolizer, scaleRange);
                    LiteShape2 shape = getSampleShape(symbolizer, w, h);

                    if (style2d != null) {
                        shapePainter.paint(g2d, shape, style2d, scaleDenominator);
View Full Code Here

Examples of org.geotools.renderer.style.Style2D

                final Symbolizer symbolizer = symbolizers[sIdx];

                if (symbolizer instanceof RasterSymbolizer) {
                   throw new IllegalStateException("It is not legal to have a RasterSymbolizer here");
                } else {
                    Style2D style2d = styleFactory.createStyle(sampleFeature, symbolizer, scaleRange);
                    LiteShape2 shape = getSampleShape(symbolizer, w, h);

                    if (style2d != null) {
                        shapePainter.paint(graphics, shape, style2d, scaleDenominator);
                    }
View Full Code Here

Examples of org.geotools.renderer.style.Style2D

                width =1;
           
            float[] point=new float[6];
            shape.getPathIterator(null).currentSegment(point);
            SLDStyleFactory styleFactory=new SLDStyleFactory();
            Style2D tmp = styleFactory.createStyle(feature, pointSymbolizer, NumberRange.create(Double.MIN_VALUE, Double.MAX_VALUE));
            if( tmp instanceof MarkStyle2D ){
                MarkStyle2D style=(MarkStyle2D) tmp;
                Shape shape2 = style.getTransformedShape(point[0], point[1]);
View Full Code Here

Examples of org.geotools.renderer.style.Style2D

                if (symbolizer instanceof TextSymbolizer && drawMe.content instanceof Feature) {
                    labelCache.put(layerId, (TextSymbolizer) symbolizer, (Feature) drawMe.content,
                            shape, scaleRange);
                    paintCommands++;
                } else {
                    Style2D style = styleFactory.createStyle(drawMe.content,
                            symbolizer, scaleRange);
                   
                    // clip to the visible area + the size of the symbolizer (with some extra
                    // to make sure we get no artefacts from polygon new borders)
                    double size = RendererUtilities.getStyle2DSize(style);
View Full Code Here

Examples of org.geotools.renderer.style.Style2D

            AffineTransform newTransform = new AffineTransform(oldTransform);
            newTransform.concatenate(transform);
            graphics.setTransform(newTransform);

            // draw the label shield first, underneath the halo
            Style2D graphic = labelItem.getTextStyle().getGraphic();
            if (graphic != null) {
                // take into account the graphic margins, if any
                double offsetY = 0;
                double offsetX = 0;
                final int[] margin = labelItem.getGraphicMargin();
                if(margin != null) {
                    offsetX = margin[1] - margin[3];
                    offsetY = margin[2] - margin[0];
                }
                LiteShape2 tempShape = new LiteShape2(gf.createPoint(new Coordinate(labelBounds
                        .getWidth() / 2.0 + offsetX, -1.0 * labelBounds.getHeight() / 2.0 + offsetY)), null, null,
                        false, false);

                // resize graphic and transform it based on the position of the last line
                graphic = resizeGraphic(graphic);
                AffineTransform graphicTx = new AffineTransform(transform);
                LineInfo lastLine = lines.get(lines.size() - 1);
                graphicTx.translate(lastLine.x, lastLine.y);
                graphics.setTransform(graphicTx);
                shapePainter.paint(graphics, tempShape, graphic, graphic.getMaxScale());
            }
           
            // 0 is unfortunately an acceptable value if people only want to draw shields
            // (to leverage conflict resolution, priority when placing symbols)
            if(labelItem.getTextStyle().getFont().getSize() == 0)
View Full Code Here

Examples of org.geotools.renderer.style.Style2D

    @Override
    protected Expression rescaleGraphicSize(Graphic gr) {
        Expression size = gr.getSize();
        if(size == null || size == Expression.NIL) {
            PointSymbolizer symbolizer = sf.createPointSymbolizer(gr, null);
            Style2D style = ssf.createStyle(null, symbolizer, INFINITE_RANGE);
            if(style instanceof IconStyle2D) {
                IconStyle2D is = (IconStyle2D) style;
                size = ff.literal(is.getIcon().getIconHeight());
            } else if(style instanceof GraphicStyle2D) {
                GraphicStyle2D gs = (GraphicStyle2D) style;
View Full Code Here

Examples of org.geotools.renderer.style.Style2D

                if (symbolizer instanceof RasterSymbolizer) {
                    throw new IllegalStateException(
                            "It is not legal to have a RasterSymbolizer here"
                            );
                } else {
                    Style2D style2d =
                        styleFactory.createStyle(sampleFeature, symbolizer, scaleRange);
                    LiteShape2 shape = getSampleShape(symbolizer, w, h);

                    if (style2d != null) {
                        shapePainter.paint(g2d, shape, style2d, scaleDenominator);
View Full Code Here

Examples of org.geotools.renderer.style.Style2D

                if (symbolizer instanceof RasterSymbolizer) {
                    throw new IllegalStateException(
                            "It is not legal to have a RasterSymbolizer here");
                } else {
                    Style2D style2d = styleFactory.createStyle(sampleFeature, symbolizer,
                            scaleRange);
                    LiteShape2 shape = getSampleShape(symbolizer, w, h);

                    if (style2d != null) {
                        shapePainter.paint(graphics, shape, style2d, scaleDenominator);
View Full Code Here

Examples of org.geotools.renderer.style.Style2D

       
                                        symbolizer = pointSymbolizer;
                                    }
                                }
                               
                                Style2D style2d = styleFactory.createStyle(sample,
                                        symbolizer, scaleRange);
                                LiteShape2 shape = getSampleShape(symbolizer, w, h);
       
                                if (style2d != null) {
                                    shapePainter.paint(graphics, shape, style2d,
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.