Package org.opengis.style

Examples of org.opengis.style.Rule


        assertNotNull("parsed xml", parsed);
        assertTrue("parsed xml into style", parsed.length > 0);

        Style style = parsed[0];
        assertNotNull(style);
        Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        LineSymbolizer lineSymbolize = (LineSymbolizer) rule.symbolizers().get(0);
        Stroke stroke = lineSymbolize.getStroke();

        Expression color = stroke.getColor();
        Color value = color.evaluate(null, Color.class);
        assertNotNull("color", value);
View Full Code Here


        assertNotNull("parsed xml", parsed);
        assertTrue("parsed xml into style", parsed.length > 0);

        Style style = parsed[0];
        assertNotNull(style);
        Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        LineSymbolizer lineSymbolize = (LineSymbolizer) rule.symbolizers().get(0);
        Stroke stroke = lineSymbolize.getStroke();

        Expression color = stroke.getColor();
        Color value = color.evaluate(null, Color.class);
        assertNotNull("color", value);
View Full Code Here

        assertNotNull("parsed xml", parsed);
        assertTrue("parsed xml into style", parsed.length > 0);

        Style style = parsed[0];
        assertNotNull(style);
        Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        TextSymbolizer textSymbolize = (TextSymbolizer) rule.symbolizers().get(0);
        LabelPlacement labelPlacement = textSymbolize.getLabelPlacement();

        assertNotNull(labelPlacement);
    }
View Full Code Here

        assertNotNull("parsed xml", parsed);
        assertTrue("parsed xml into style", parsed.length > 0);

        Style style = parsed[0];
        assertNotNull(style);
        Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        TextSymbolizer textSymbolize = (TextSymbolizer) rule.symbolizers().get(0);
        PointPlacement pointPlacement = (PointPlacement) textSymbolize.getLabelPlacement();

        assertNotNull(pointPlacement);
        assertNotNull(pointPlacement.getRotation());
    }
View Full Code Here

        assertNotNull("parsed xml", parsed);
        assertTrue("parsed xml into style", parsed.length > 0);

        Style style = parsed[0];
        assertNotNull(style);
        Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        List<? extends Symbolizer> symbolizers = rule.symbolizers();
        assertEquals(1, symbolizers.size());
        PointSymbolizer symbolize = (PointSymbolizer) symbolizers.get(0);
        Graphic graphic = symbolize.getGraphic();
        List<GraphicalSymbol> symbols = graphic.graphicalSymbols();
        assertEquals(1, symbols.size());
View Full Code Here

            assertNotNull("parsed xml", parsed);
            assertTrue("parsed xml into style", parsed.length > 0);

            Style style = parsed[0];
            assertNotNull(style);
            Rule rule = style.featureTypeStyles().get(0).rules().get(0);
            LineSymbolizer lineSymbolize = (LineSymbolizer) rule.symbolizers().get(0);
            Stroke stroke = lineSymbolize.getStroke();

            Expression color = stroke.getColor();
            Color value = color.evaluate(null, Color.class);
            assertNotNull("color", value);
View Full Code Here

        assertNotNull("style is null", style);
        assertNotNull("feature type styles are null", style.featureTypeStyles());
        assertTrue("more or less that one feature type style is available", style.featureTypeStyles().size() == 1);
        assertNotNull("rules are null", style.featureTypeStyles().get(0).rules());
        assertTrue("more or less that one rule is available", style.featureTypeStyles().get(0).rules().size() == 1);
        Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        assertNotNull("rule is null", rule);

        List<? extends Symbolizer> symbolizers = rule.symbolizers();
        assertNotNull("symbolizers are null", symbolizers);
        assertTrue("more or less that one symbolizer is available", symbolizers.size() == 1);
        PointSymbolizer pointSymbolizer = (PointSymbolizer) symbolizers.get(0);
        assertNotNull("point symbolizer is null", pointSymbolizer);
View Full Code Here

       
        FeatureTypeStyle fts = (FeatureTypeStyle) parse("example-featurestyle.xml");
        assertEquals("oceansea:Foundation", fts.getFeatureTypeName());
        assertEquals(1, fts.rules().size());
   
        Rule rule = fts.rules().get(0);
        assertEquals("main", rule.getName());
       
        assertEquals(1, rule.symbolizers().size());
       
        PolygonSymbolizer sym = (PolygonSymbolizer) rule.symbolizers().get(0);
        assertEquals(UomOgcMapping.PIXEL.getUnit(), sym.getUnitOfMeasure());
        assertEquals(SLD.toColor("#96C3F5"), sym.getFill().getColor().evaluate(null, Color.class));
       
    }
View Full Code Here

        </CoverageStyle>
        */
       
        FeatureTypeStyle cs = (FeatureTypeStyle) parse("example-coveragestyle.xml");
        assertEquals(1, cs.rules().size());
        Rule rule = cs.rules().get(0);
       
        assertEquals("ChannelSelection", rule.getName());
        assertEquals("Gray channel mapping", rule.getDescription().getTitle().toString());
        assertEquals(1, rule.symbolizers().size());
       
        RasterSymbolizer sym = (RasterSymbolizer) rule.symbolizers().get(0);
        assertEquals("Band.band1", sym.getChannelSelection().getGrayChannel().getChannelName());
    }
View Full Code Here

                sfact.fill(null, ffact.literal("#FF0000"), null),
                sfact.stroke(ffact.literal("#000000"), null, ffact.literal(1), null, null, null, null));
       
        Graphic g = sfact.graphic(Arrays.asList((GraphicalSymbol)m), Expression.NIL, Expression.NIL, Expression.NIL, null, null);
        Symbolizer symb = sfact.pointSymbolizer(null, ffact.property(null), null, null, g);
        Rule r = sfact.rule(null, null, null, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, Arrays.asList(symb), null);
        FeatureTypeStyle fts = sfact.featureTypeStyle(null, null, null, Collections.<Name> emptySet(), Collections.<SemanticType> emptySet(), Arrays.asList(r));
        Style s = sfact.style(null, null, true, Arrays.asList(fts), null);
       
        BufferedImage img = IconRenderer.renderIcon((org.geotools.styling.Style)s);
       
View Full Code Here

TOP

Related Classes of org.opengis.style.Rule

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.