Examples of ExternalGraphic


Examples of org.axsl.fo.fo.ExternalGraphic

    /**
     * Returns the ipd of the viewport for this area.
     * @return The ipd of the viewport for this area.
     */
    public int viewportIPD() {
        final ExternalGraphic eg = this.traitGeneratedBy();
        return eg.viewportIpd(this);
    }
View Full Code Here

Examples of org.foray.fotree.fo.obj.ExternalGraphic

        }
        case DECLARATIONS: {
            return new Declarations(parent, propertyList);
        }
        case EXTERNAL_GRAPHIC: {
            return new ExternalGraphic(parent, propertyList);
        }
        case FLOAT: {
            return new Float(parent, propertyList);
        }
        case FLOW: {
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

                }
                for( int i = 0; i < graphics.length; i++ ) {
                    if (graphics[i] != null) {
                        for( GraphicalSymbol gs : graphics[i].graphicalSymbols() ) {
                            if ((gs != null) && (gs instanceof ExternalGraphic)) {
                                ExternalGraphic externalGraphic = (ExternalGraphic) gs;
                                gList.add(externalGraphic);
                            }
                        }
                    }
                }
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

     */
    public static List<ExternalGraphic> externalGraphicsFromGraphic( Graphic graphic ) {
        List<ExternalGraphic> gList = new ArrayList<ExternalGraphic>();
        for( GraphicalSymbol gs : graphic.graphicalSymbols() ) {
            if ((gs != null) && (gs instanceof ExternalGraphic)) {
                ExternalGraphic externalGraphic = (ExternalGraphic) gs;
                gList.add(externalGraphic);
            }
        }
        return gList;
    }
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

        }

        PointSymbolizer pointSymbolizer = Utilities.pointSymbolizerFromRule(rule);
        Graphic graphic = SLDs.graphic(pointSymbolizer);
        graphic.graphicalSymbols().clear();
        ExternalGraphic exGraphic = sf.createExternalGraphic(externalGraphicsUrl, format);

        graphic.graphicalSymbols().add(exGraphic);
    }
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

     * @return the generated style.
     * @throws IOException
     */
    public static StyleWrapper createStyleFromGraphic( File graphicsPath ) throws IOException {
        String name = graphicsPath.getName();
        ExternalGraphic exGraphic = null;
        if (name.toLowerCase().endsWith(".png")) {
            exGraphic = sf.createExternalGraphic(graphicsPath.toURI().toURL(), "image/png");
        } else if (name.toLowerCase().endsWith(".svg")) {
            exGraphic = sf.createExternalGraphic(graphicsPath.toURI().toURL(), "image/svg+xml");
        } else if (name.toLowerCase().endsWith(".sld")) {
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

        public void visit( Graphic gr ) {
            List<GraphicalSymbol> graphicalSymbols = gr.graphicalSymbols();
            for( GraphicalSymbol graphicalSymbol : graphicalSymbols ) {
                if (graphicalSymbol instanceof ExternalGraphic) {
                    ExternalGraphic ext = (ExternalGraphic) graphicalSymbol;
                    ext.accept(this);
                }
            }
        }
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

            // if the point symbolizer uses an external graphic use it
            if ((symbolizer.getGraphic() != null)
                    && (symbolizer.getGraphic().getExternalGraphics() != null)
                    && (symbolizer.getGraphic().getExternalGraphics().length > 0)) {
                ExternalGraphic graphic = symbolizer.getGraphic()
                        .getExternalGraphics()[0];

                try {
                    if ("file".equals(graphic.getLocation().getProtocol())) {
                        // it is a local file, reference locally from "styles"
                        // directory
                        File file = new File(graphic.getLocation().getFile());
                        iconHref = RequestUtils.baseURL(mapContext.getRequest()
                                .getHttpServletRequest())
                                + "styles/" + file.getName();
                    } else if ("http".equals(graphic.getLocation()
                            .getProtocol())) {
                        iconHref = graphic.getLocation().toString();
                    } else {
                        // TODO: should we check for http:// and use it
                        // directly?
                        // other protocols?
                    }
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

        Graphic graphic = this.styleBuilder.createGraphic();
        graphic.graphicalSymbols().clear();
        if (styleJson.has(JSON_EXTERNAL_GRAPHIC)) {
            String externalGraphicUrl = validateURL(styleJson.getString(JSON_EXTERNAL_GRAPHIC));
            final String graphicFormat = getGraphicFormat(externalGraphicUrl, styleJson);
            final ExternalGraphic externalGraphic = this.styleBuilder.createExternalGraphic(externalGraphicUrl, graphicFormat);

            graphic.graphicalSymbols().add(externalGraphic);
        }

        if (styleJson.has(JSON_GRAPHIC_NAME)) {
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

        final List<GraphicalSymbol> graphicalSymbols = graphic.graphicalSymbols();

        assertEquals(1, graphicalSymbols.size());

        ExternalGraphic externalGraphic = (ExternalGraphic) graphicalSymbols.get(0);
        assertEquals("image/png", externalGraphic.getFormat());
        assertEquals(getFile("mark.png"), new File(externalGraphic.getLocation().toURI()));
    }
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.