Package org.geotools.styling

Examples of org.geotools.styling.Style


    /**
     * Does nothing.
     */
    public void save( IMemento momento, Object value ) {
        Style style = (Style) value;

        // store the feature type name
        momento.putString(fTypeName, style.getFeatureTypeStyles()[0].getFeatureTypeName());
    }
View Full Code Here


     *
     * @param schema
     * @return
     */
    private static Style createDefaultStyle( SimpleFeatureType schema ) {
        Style style = builder.createStyle();

        SelectionStyleContent ssc = new SelectionStyleContent();
        if (schema == null)
            return null;
        GeometryDescriptor geom = schema.getGeometryDescriptor();
View Full Code Here

    @Test
    public void testDefault(){
        StyleBuilder styleBuilder = new StyleBuilder();
        SLDContentManager manager = new SLDContentManager();
       
        Style style = manager.getStyle();
        assertNotNull( "empty style created", style );
       
        assertTrue( style.featureTypeStyles().isEmpty() );
        assertNotNull( manager.getDefaultFeatureTypeStyle() );
        assertFalse( style.featureTypeStyles().isEmpty() );       
       
       
    }
View Full Code Here

        StyleBlackboard blackboard = (StyleBlackboard) layer.getStyleBlackboard();
        if (blackboard == null) {
            return null;
        }

        Style sld = (Style) blackboard.lookup(Style.class);
        if (sld == null) {
            return null;
        }

        List<FeatureTypeStyle> styles = new ArrayList<FeatureTypeStyle>();
        for( FeatureTypeStyle style : sld.getFeatureTypeStyles() ) {
            if (style.getFeatureTypeName() == null
                    || style.getFeatureTypeName().equals(SLDs.GENERIC_FEATURE_TYPENAME)) {
                styles.add(style);
            } else {
                if (layer.getSchema() != null && layer.getSchema().getTypeName() != null) {
View Full Code Here

    public BufferedImage generateStyledIcon( Layer layer ) {
        StyleBlackboard blackboard = layer.getStyleBlackboard();
        if (blackboard == null)
            return null;

        Style sld = (Style) blackboard.lookup(Style.class); // or
        // blackboard.get(
        // "org.locationtech.udig.style.sld"
        // );
        if (sld != null) {
            Rule rule = getRule(sld);
View Full Code Here

                if (index >= 0) {
                    colour = map.getColorPalette().getColors(letters.length)[index];
                    l.setDefaultColor(colour);
                }
                // set layer default colours here
                Style style = (Style) l.getStyleBlackboard().get(SLDContent.ID);

                if (style != null) {
                    SLDs.setLineColour(style, colour);
                    SLDs.setPointColour(style, colour);
                    SLDs.setPolyColour(style, colour);
View Full Code Here

        featureSource = layer.getResource(SimpleFeatureStore.class, new SubProgressMonitor(monitor, 0));
        if (featureSource == null) {
            featureSource = layer.getResource(SimpleFeatureSource.class, new SubProgressMonitor(monitor,
                    0));
        }
        Style style = getStyle(styleBlackboard, featureSource);
        layers = new Layer[1];
        CoordinateReferenceSystem layerCRS = layer.getCRS();
        SimpleFeatureType schema = featureSource.getSchema();
       
        // Original Query provided by Layer.getFilter() as adjusted by selection and edit filter
View Full Code Here

    }

    protected Style getStyle( StyleBlackboard styleBlackboard,
            FeatureSource<SimpleFeatureType, SimpleFeature> featureSource ) {
        // pull style information off the blackboard
        Style style = (Style) styleBlackboard.lookup(Style.class);
        IPreferenceStore store = ProjectPlugin.getPlugin().getPreferenceStore();
        boolean transparency = store.getBoolean(PreferenceConstants.P_TRANSPARENCY);
        try {
            if (!transparency) {
                if (style != null) {
                    DuplicatingStyleVisitor duplicator = new DuplicatingStyleVisitor();
                    style.accept(duplicator);
                    style = (Style) duplicator.getCopy();
                    style = removeTransparency(style);
                }
            }
        } catch (Throwable e) {
View Full Code Here

   
    SimpleFeature[] features=UDIGTestUtil.createTestFeatures("testType", new Geometry[]{poly1, poly2},new String[]{}//$NON-NLS-1$
        DefaultEngineeringCRS.CARTESIAN_2D);
    map=MapTests.createNonDynamicMapAndRenderer(MapTests.createGeoResource(features, true), new Dimension(w,h));
    StyleBuilder sb=new StyleBuilder();
    Style style=sb.createStyle(features[0].getName().getLocalPart(), sb.createPolygonSymbolizer(Color.BLACK,Color.BLACK, 1));
    SLDContent.apply(map.getLayersInternal().get(0), style, null);
        List<IRenderer> renderers = map.getRenderManagerInternal().getRenderers();
        for( IRenderer renderer : renderers ) {
            ((Renderer)renderer).eSetDeliver(false);
        }
View Full Code Here

    public boolean canStyle( String styleID, Object value ) {
        return value != null && value instanceof Style;
    }

    public Set<Range<Double>> getValidScaleRanges() {
        Style style = (Style) context.getLayer().getStyleBlackboard().get(
                "org.locationtech.udig.style.sld");
        return MinMaxScaleCalculator.getValidScaleRanges(style);
    }
View Full Code Here

TOP

Related Classes of org.geotools.styling.Style

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.