Package org.geotools.styling

Examples of org.geotools.styling.PointSymbolizer


        sld.createPointStyle(null, symb,range);
       
    }
   
    public void testCreateIncompletePointStyle() {
        PointSymbolizer symb;
        Mark myMark;
        //full symbolizer
        symb = sf.createPointSymbolizer();
        myMark = sf.createMark();
       
        symb.getGraphic().addMark(myMark);
       
        sld.createPointStyle(null, symb,range);
    }
View Full Code Here


       
        sld.createPointStyle(null, symb,range);
    }
   
    public void testCreateDynamicMark() throws Exception {
        PointSymbolizer symb = sf.createPointSymbolizer();
        Mark myMark = sf.createMark();
        final String ttfUrl = "ttf://Serif#${symb}";
        myMark.setWellKnownName(ff.literal(ttfUrl));
        symb.getGraphic().addMark(myMark);
       
        MarkStyle2D ms = (MarkStyle2D) sld.createStyle(feature, symb, range);
        assertNotNull(ms.getShape());
        // make sure the style has been recognized as dynamic
        SymbolizerKey key = new SymbolizerKey(symb, range);
View Full Code Here

        assertTrue(pi.isDone());
    }
   
    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);
        assertTrue(sld.dynamicSymbolizers.containsKey(key));
View Full Code Here

        // different ways they have been loaded
    }
   
    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
        SymbolizerKey key = new SymbolizerKey(symb, range);
View Full Code Here

        assertEquals(expected.getWidth(), gs.getImage().getWidth());
    }
   
    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());
        assertEquals(64, img.getWidth());
View Full Code Here

    }
   
    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);
        assertTrue(sld.dynamicSymbolizers.containsKey(key));
View Full Code Here

        // different ways they have been loaded
    }

    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();
        assertEquals(20, img.getHeight());
        assertEquals(20, img.getWidth());
View Full Code Here

        TexturePaint paint = (TexturePaint) ps.getFill();
        assertEquals(20, paint.getImage().getWidth());
    }
   
    public void testDefaultSizeMark() throws Exception {
        PointSymbolizer symb = sf.createPointSymbolizer();
        Mark myMark = sf.createMark();
        myMark.setWellKnownName(ff.literal("square"));
        symb.getGraphic().addMark(myMark);
       
        MarkStyle2D ms = (MarkStyle2D) sld.createPointStyle(feature, symb, range);
        assertEquals(16.0, ms.getSize());
    }
View Full Code Here

     }
   
    public void testMarkSizeCalculation() throws Exception {
        assertFalse(MarkStyle2D.isMaxMarkSizeEnabled());
       
         PointSymbolizer symb = sf.createPointSymbolizer();
         Mark myMark = sf.createMark();
         myMark.setWellKnownName(ff.literal("square"));
         symb.getGraphic().graphicalSymbols().add(myMark);
         MarkStyle2D ms = (MarkStyle2D) sld.createPointStyle(feature, symb, range);
         assertFalse(MarkStyle2D.isMaxMarkSizeEnabled());
       
         MarkStyle2D.setMaxMarkSizeEnabled(true);
         ms = (MarkStyle2D) sld.createPointStyle(feature, symb, range);
View Full Code Here

         assertTrue(MarkStyle2D.isMaxMarkSizeEnabled());
     }
   
   
     public void testFallbackGraphicMark() throws Exception {
         PointSymbolizer symb = sf.createPointSymbolizer();
         ExternalGraphic eg = sf.createExternalGraphic("http://foo.com/invalid_or_missing_image_url", null);
         symb.getGraphic().graphicalSymbols().add(eg);
        
         Style2D icon = sld.createPointStyle(feature, symb, range);
         assertNotNull(icon);
     }
View Full Code Here

TOP

Related Classes of org.geotools.styling.PointSymbolizer

Copyright © 2018 www.massapicom. 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.