Package org.geotools.styling

Examples of org.geotools.styling.Style.accept()


        tb.pointPlacement().rotation(-45);
        Style style = rb.buildStyle();

        // round up the basic elements and check its simple
        StyleCollector collector = new StyleCollector();
        style.accept(collector);
        basicPointWithLabelAssertions(collector);

        TextSymbolizer ps = (TextSymbolizer) collector.symbolizers.get(1);
        assertEquals(ff.property("name"), ps.getLabel());
        assertEquals(Color.BLACK, ps.getFill().getColor().evaluate(null, Color.class));
View Full Code Here


                .graphic().size(16).mark().reset(mark);
        Style style = fts.buildStyle();
        // print(style);

        StyleCollector collector = new StyleCollector();
        style.accept(collector);
        assertEquals(1, collector.featureTypeStyles.size());
        assertEquals(3, collector.rules.size());
        assertEquals(3, collector.symbolizers.size());

        // check rules and styles
View Full Code Here

        Style style = new GraphicBuilder().size(size).mark().name("circle").fill()
                .color(new Color(0, 51, 204)).buildStyle();
        // print(style);

        StyleCollector collector = new StyleCollector();
        style.accept(collector);
        assertSimpleStyle(collector);

        // check the function is there were we expect it
        PointSymbolizer ps = (PointSymbolizer) collector.symbolizers.get(0);
        Graphic graphic = ps.getGraphic();
View Full Code Here

        Style style = stylereader.readXML()[0];

        OpacityFinder opacityFinder = new OpacityFinder(new Class[] { RasterSymbolizer.class });

        style.accept(opacityFinder);

        org.junit.Assert.assertTrue(opacityFinder.hasOpacity);
    }
   
    public void testColorMapOpacity() throws Exception {
View Full Code Here

        Style style = stylereader.readXML()[0];

        OpacityFinder opacityFinder = new OpacityFinder(new Class[] { RasterSymbolizer.class });

        style.accept(opacityFinder);

        org.junit.Assert.assertTrue(opacityFinder.hasOpacity);
    }
}
View Full Code Here

        // this code generates a Displacement.NULL inside, which in turn contains
        // ConstantExpression.NULL
        Style style = SLD.createPolygonStyle(Color.YELLOW, null, 0.0f);
        UomRescaleStyleVisitor visitor = new UomRescaleStyleVisitor(1);
        // used to throw an exception here
        style.accept(visitor);
    }

}
View Full Code Here

    public void testStyleDuplication() throws IllegalFilterException {
      //create a style
      Style oldStyle = sb.createStyle("FTSName", sf.createPolygonSymbolizer());
      oldStyle.getFeatureTypeStyles()[0].setSemanticTypeIdentifiers(new String[] {"simple", "generic:geometry"});
      //duplicate it
      oldStyle.accept(visitor);
      Style newStyle = (Style) visitor.getCopy();
     
      //compare it
      assertNotNull(newStyle);
    }
View Full Code Here

        Style style = sf.getDefaultStyle();
        style.addFeatureTypeStyle(fts);
        style.addFeatureTypeStyle(fts2);

        style.accept( visitor );       
        Style copy = (Style) visitor.getCopy();
       
        Style notEq = sf.getDefaultStyle();

        fts2 = fts2();
View Full Code Here

    public void testStyleDuplication() throws IllegalFilterException {
      //create a style
      Style oldStyle = sb.createStyle("FTSName", sf.createPolygonSymbolizer());
      oldStyle.getFeatureTypeStyles()[0].setSemanticTypeIdentifiers(new String[] {"simple", "generic:geometry"});
      //duplicate it
      oldStyle.accept(visitor);
      Style newStyle = (Style) visitor.getCopy();
     
      //compare it
      assertNotNull(newStyle);
      assertEquals(2, newStyle.getFeatureTypeStyles()[0].getSemanticTypeIdentifiers().length);
View Full Code Here

        Style style = sf.getDefaultStyle();
        style.addFeatureTypeStyle(fts);
        style.addFeatureTypeStyle(fts2);

        style.accept( visitor );       
        Style copy = (Style) visitor.getCopy();
       
        //assertClone(style, clone);
        assertEqualsContract( style, copy );
       
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.