Examples of Graphic


Examples of org.geotools.styling.Graphic

        if (exGraphic == null) {
            throw new IOException("Style could not be created!");
        }

        Graphic gr = sf.createDefaultGraphic();
        gr.graphicalSymbols().clear();
        gr.graphicalSymbols().add(exGraphic);
        Expression size = ff.literal(20);
        gr.setSize(size);

        Rule rule = sf.createRule();
        PointSymbolizer pointSymbolizer = sf.createPointSymbolizer(gr, null);
        rule.symbolizers().add(pointSymbolizer);
View Full Code Here

Examples of org.geotools.styling.Graphic

                java.awt.Point off = new java.awt.Point((int) offset.getX(), -1 * (int) offset.getY());
                g.translate(off);
            }

            // rotation
            Graphic graphic = SLDs.graphic(pointSymbolizer);
            Double rotation = graphic.getRotation().evaluate(null, Double.class);
            Double gSize = graphic.getSize().evaluate(null, Double.class);
            if (gSize != null && rotation != null) {
                g.setTransform(AffineTransform.getRotateInstance(toRadians(rotation), gSize / 2, gSize / 2));
            }

            Color c = SLDs.pointStrokeColorWithAlpha(pointSymbolizer);
View Full Code Here

Examples of org.geotools.styling.Graphic

     */
    public void setExternalGraphicPath( String externalGraphicPath ) throws MalformedURLException {
        if (externalGraphic == null) {
            PointSymbolizerWrapper pointSymbolizerWrapper = adapt(PointSymbolizerWrapper.class);
            if (pointSymbolizerWrapper != null) {
                Graphic graphic = pointSymbolizerWrapper.getGraphic();
                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$
                }
                externalGraphic = sb.createExternalGraphic(new URL(urlStr), getFormat(externalGraphicPath));
                graphic.graphicalSymbols().add(externalGraphic);
            }
        }
        setExternalGraphicPath(externalGraphicPath, externalGraphic);
    }
View Full Code Here

Examples of org.geotools.styling.Graphic

     * @param externalGraphicPath the path to set.
     * @throws MalformedURLException
     */
    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);
        }
    }
View Full Code Here

Examples of org.geotools.styling.Graphic

     *
     * @param externalGraphicPath the path to set.
     * @throws MalformedURLException
     */
    public void setFillExternalGraphicFillPath( String externalGraphicPath ) throws MalformedURLException {
        Graphic graphic = null;
        PolygonSymbolizerWrapper polygonSymbolizerWrapper = adapt(PolygonSymbolizerWrapper.class);
        if (polygonSymbolizerWrapper != null) {
            graphic = polygonSymbolizerWrapper.getFillGraphicFill();
            if (graphic == null) {
                graphic = sf.createDefaultGraphic();
            }
            polygonSymbolizerWrapper.setFillGraphicFill(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$
        }
        if (fillExternalGraphicFill == null) {
            fillExternalGraphicFill = sb.createExternalGraphic(new URL(urlStr), getFormat(externalGraphicPath));
        } else {
            setExternalGraphicPath(externalGraphicPath, fillExternalGraphicFill);
        }
        graphic.graphicalSymbols().add(fillExternalGraphicFill);
    }
View Full Code Here

Examples of org.geotools.styling.Graphic

            String width = values[1];
            String size = values[2];

            try {
                polygonSymbolizerWrapper.setStrokeExternalGraphicStrokePath(url);
                Graphic graphicStroke = polygonSymbolizerWrapper.getStrokeGraphicStroke();
                graphicStroke.setSize(Utilities.ff.literal(size));
                graphicStroke.setGap(Utilities.ff.literal(width));
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }
            break;
        }
View Full Code Here

Examples of org.geotools.styling.Graphic

        StyleBuilder builder = new StyleBuilder();
        Mark mark = builder.createMark(StyleBuilder.MARK_SQUARE);
        mark.setStroke(builder.createStroke(Color.BLUE));
        mark.setFill(builder.createFill(Color.BLUE));
        Graphic graphic = builder.createGraphic(null,
                mark, null);
        graphic.setSize(builder.getFilterFactory().literal(5));
        Style style = builder.createStyle(builder.createPointSymbolizer(graphic));

        image = new Image(display, 16, 16);

        SWTGraphics graphics = new SWTGraphics(image, display);
View Full Code Here

Examples of org.geotools.styling.Graphic

                rule.accept(this);
            }
        }

        public void visit( Fill fill ) {
            Graphic graphicFill = fill.getGraphicFill();
            if (graphicFill != null) {
                graphicFill.accept(this);
            }
        }
View Full Code Here

Examples of org.geotools.styling.Graphic

                graphicFill.accept(this);
            }
        }

        public void visit( Stroke stroke ) {
            Graphic graphicFill = stroke.getGraphicFill();
            if (graphicFill != null) {
                graphicFill.accept(this);
            }
            Graphic graphicStroke = stroke.getGraphicStroke();
            if (graphicStroke != null) {
                graphicStroke.accept(this);
            }
        }
View Full Code Here

Examples of org.geotools.styling.Graphic

            } else
                throw new RuntimeException("visit(Symbolizer) unsupported");
        }

        public void visit( PointSymbolizer ps ) {
            Graphic graphic = ps.getGraphic();
            if (graphic != null) {
                graphic.accept(this);
            }
        }
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.