Examples of ExternalGraphic


Examples of org.geotools.styling.ExternalGraphic

    }

    private static Style createPointStyle() {
        StyleFactory sf = CommonFactoryFinder.getStyleFactory();
        URL iconUrl = ScreenMapShapefileTest.class.getResource("icon.png");
        ExternalGraphic icon = sf.createExternalGraphic(iconUrl, "image/png");
        Graphic graphic = sf.createGraphic(new ExternalGraphic[] { icon }, null, null, null, null,
                null);
        PointSymbolizer symbolizer = sf.createPointSymbolizer(graphic, "the_geom");

        Rule rule = sf.createRule();
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

        legend.setRotation(0);
        legend.setOpacity(1);
        Style pStyle = RendererBaseTest.loadStyle(this, "externalGraphic.sld");
        URL url = StreamingRenderer.class.getResource("test-data/");
        StyleFactory sf = CommonFactoryFinder.getStyleFactory(null);
        ExternalGraphic eg = sf.createExternalGraphic(url + "icon64.png", "image/png");
        legend.addExternalGraphic(eg);
        BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = (Graphics2D) image.getGraphics();
        MathTransform transform = ProjectiveTransform.create(new AffineTransform());
        Decimator decimator = new Decimator(transform);
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

        assertSimpleStyle(collector);

        // check the symbolizer
        PolygonSymbolizer ps = (PolygonSymbolizer) collector.symbolizers.get(0);
        assertNull(ps.getStroke());
        ExternalGraphic eg = (ExternalGraphic) ps.getFill().getGraphicFill().graphicalSymbols()
                .get(0);
        assertEquals("colorblocks.png", eg.getOnlineResource().getLinkage().toString());
        assertEquals("image/png", eg.getFormat());
    }
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

        assertEquals(32, (int) graphic.getSize().evaluate(null, Integer.class));

        // check the mark
        List<GraphicalSymbol> symbols = graphic.graphicalSymbols();
        assertEquals(1, symbols.size());
        ExternalGraphic eg = (ExternalGraphic) symbols.get(0);
        assertEquals("image/png", eg.getFormat());
        assertEquals("smileyface.png", eg.getOnlineResource().getLinkage().toString());
    }
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

    public ExternalGraphic build() {
        if (unset) {
            return null;
        }
        ExternalGraphic externalGraphic;
        Collection<ColorReplacement> set = new HashSet<ColorReplacement>();
        for (ColorReplacementBuilder replacement : replacements) {
            set.add(replacement.build());
        }
        if (inline != null) {
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

    }
   
    public void testCreateDynamicExternalGraphics() throws Exception {
        URL url = StreamingRenderer.class.getResource("test-data/");
        PointSymbolizer symb = sf.createPointSymbolizer();
        ExternalGraphic eg = sf.createExternalGraphic(url + "${icon}", "image/png");
        symb.getGraphic().addExternalGraphic(eg);
       
        GraphicStyle2D gs = (GraphicStyle2D) sld.createStyle(feature, symb, range);
        // make sure the style has been recognized as dynamic
        SymbolizerKey key = new SymbolizerKey(symb, range);
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

    }
   
    public void testCreateDynamicExternalGraphicsVector() throws Exception {
        URL url = StreamingRenderer.class.getResource("test-data/");
        PointSymbolizer symb = sf.createPointSymbolizer();
        ExternalGraphic eg = sf.createExternalGraphic(url + "${icon}", "image/png");
        symb.getGraphic().addExternalGraphic(eg);
        sld.setVectorRenderingEnabled(true);
       
        GraphicStyle2D gs = (GraphicStyle2D) sld.createStyle(feature, symb, range);
        // make sure the style has been recognized as dynamic
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

    }
   
    public void testDefaultSizeExternalGraphic() throws Exception {
        URL url = StreamingRenderer.class.getResource("test-data/");
        PointSymbolizer symb = sf.createPointSymbolizer();
        ExternalGraphic eg = sf.createExternalGraphic(url + "icon64.png", "image/png");
        symb.getGraphic().addExternalGraphic(eg);
       
        GraphicStyle2D gs = (GraphicStyle2D) sld.createPointStyle(feature, symb, range);
        BufferedImage img = gs.getImage();
        assertEquals(64, img.getHeight());
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

   
    public void testCreateDynamicExternalFormat() throws Exception {
      feature.setAttribute("symb", "image/png");
        URL url = StreamingRenderer.class.getResource("test-data/");
        PointSymbolizer symb = sf.createPointSymbolizer();
        ExternalGraphic eg = sf.createExternalGraphic(url + "${icon}", "${symb}");
        symb.getGraphic().addExternalGraphic(eg);
       
        GraphicStyle2D gs = (GraphicStyle2D) sld.createStyle(feature, symb, range);
        // make sure the style has been recognized as dynamic
        SymbolizerKey key = new SymbolizerKey(symb, range);
View Full Code Here

Examples of org.geotools.styling.ExternalGraphic

    }

    public void testResizeExternalGraphic() throws Exception {
        URL url = StreamingRenderer.class.getResource("test-data/");
        PointSymbolizer symb = sf.createPointSymbolizer();
        ExternalGraphic eg = sf.createExternalGraphic(url + "icon64.png", "image/png");
        symb.getGraphic().graphicalSymbols().add(eg);
        symb.getGraphic().setSize(ff.literal(20));
       
        GraphicStyle2D gs = (GraphicStyle2D) sld.createPointStyle(feature, symb, range);
        BufferedImage img = gs.getImage();
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.