Package org.geotools.styling

Examples of org.geotools.styling.FeatureTypeStyle.rules()


            return false;
        }
        for( int i=0; i<featureTypeStyles.length; i++ ){
            FeatureTypeStyle featureTypeStyle = featureTypeStyles[i];
            if( featureTypeStyle == null ) continue;
            boolean removed = featureTypeStyle.rules().remove( rule );
            if( removed ){
                return true;
            }
        }
        return false;
View Full Code Here


        double maxScale = Double.MAX_VALUE;
        float opacity = 1.0f;
        if (style != null) {
            try {
                FeatureTypeStyle featureStyle = style.featureTypeStyles().get(0);               
                Rule rule = featureStyle.rules().get(0);
                minScale = rule.getMinScaleDenominator();
                maxScale = rule.getMaxScaleDenominator();
                if (rule.getSymbolizers()[0] instanceof RasterSymbolizer) {
                    RasterSymbolizer rs = (RasterSymbolizer) rule.getSymbolizers()[0];
                    opacity = getOpacity(rs);
View Full Code Here

        double maxScale = Double.MAX_VALUE;
        float opacity = 1.0f;
        if (style != null) {
            try {
                FeatureTypeStyle featureStyle = style.featureTypeStyles().get(0);               
                Rule rule = featureStyle.rules().get(0);
                minScale = rule.getMinScaleDenominator();
                maxScale = rule.getMaxScaleDenominator();
                if (rule.getSymbolizers()[0] instanceof RasterSymbolizer) {
                    RasterSymbolizer rs = (RasterSymbolizer) rule.getSymbolizers()[0];
                    opacity = getOpacity(rs);
View Full Code Here

    }

    private void assertStyleType(Class<?> expectedSymbolizerType, Style style) {
        assertNotNull(style);
        final FeatureTypeStyle featureTypeStyle = style.featureTypeStyles().get(0);
        final Rule rule = featureTypeStyle.rules().get(0);
        final Class<? extends Symbolizer> symbClass = rule.symbolizers().get(0).getClass();
        assertTrue("Expected: " + expectedSymbolizerType.getName() + " but was: " + symbClass,
                expectedSymbolizerType.isAssignableFrom(symbClass));
    }
}
View Full Code Here

        public StyleBuilder point() {
            Rule rule = styleFactory.createRule();
            rule.symbolizers().add(styleFactory.createPointSymbolizer());

            FeatureTypeStyle featureTypeStyle = styleFactory.createFeatureTypeStyle();
            featureTypeStyle.rules().add(rule);

            Style style = styleFactory.createStyle();
            style.featureTypeStyles().add(featureTypeStyle);

            try {
View Full Code Here

        assertEquals(1, style.featureTypeStyles().size());

        FeatureTypeStyle fts = style.featureTypeStyles().get(0);
        assertNotNull(fts);
        assertEquals(0, fts.featureTypeNames().size());
        assertEquals(1, fts.rules().size());

        Rule r = fts.rules().get(0);
        assertNotNull(r);
        assertNull(r.getName());
        assertEquals(1, r.symbolizers().size());
View Full Code Here

        FeatureTypeStyle fts = style.featureTypeStyles().get(0);
        assertNotNull(fts);
        assertEquals(0, fts.featureTypeNames().size());
        assertEquals(1, fts.rules().size());

        Rule r = fts.rules().get(0);
        assertNotNull(r);
        assertNull(r.getName());
        assertEquals(1, r.symbolizers().size());

        PointSymbolizer ps = (PointSymbolizer) r.symbolizers().get(0);
View Full Code Here

        Rule rule = sf.createRule();
        rule.symbolizers().add(symbolizer);

        FeatureTypeStyle fts = sf.createFeatureTypeStyle();
        fts.rules().add(rule);

        Style style = sf.createStyle();
        style.featureTypeStyles().add(fts);
        return style;
    }
View Full Code Here

  private static RasterSymbolizer extractRasterSymbolizer(StyledLayerDescriptor sld) {
    final UserLayer nl = (UserLayer) sld.getStyledLayers()[0];
    final Style style = nl.getUserStyles()[0];
    final FeatureTypeStyle fts = style.featureTypeStyles().get(0);
    final Rule rule = fts.rules().get(0);
    final RasterSymbolizer rs_1 = (RasterSymbolizer) rule.getSymbolizers()[0];
    return rs_1;
  }

  @org.junit.Test
View Full Code Here

        while ((f = (SimpleFeature) parser.parse()) != null) {
            FeatureTypeStyle style = (FeatureTypeStyle) f.getAttribute("Style");
            assertNotNull(style);

            Symbolizer[] syms = style.rules().get(0).getSymbolizers();
            assertEquals(3, syms.length);

            count++;
        }
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.