Package org.geotools.styling

Examples of org.geotools.styling.Style


                if (monitor != null)
                    monitor.done();
                return adaptee.cast(getReadParameters());
            }
            if(adaptee.isAssignableFrom(Style.class)){
                Style style = style(monitor);
                if( style != null ){
                    return adaptee.cast( style(monitor));
                }
            }
            return super.resolve(adaptee, monitor);
View Full Code Here


       
        assertTrue(isTestStyle(destination, expectedName));
    }

    boolean isTestStyle( final ILayer destination, final String expectedName ) {
        Style style=(Style) destination.getStyleBlackboard().get("org.locationtech.udig.style.sld"); //$NON-NLS-1$
        String name = style.getName();
        return name.equals(expectedName);
    }
View Full Code Here

        Object value = context.getLayer().getStyleBlackboard().get(SLDContent.ID);
        if( value == null ) {
            return new HashSet<Range<Double>>();
        }
        if( value instanceof Style ){
            Style style = (Style) value;
            return MinMaxScaleCalculator.getValidScaleRanges(style);
        }
        else {
            System.out.println("Unexpected "+value.getClass()+" for "+SLDContent.ID+":"+value);           
            return new HashSet<Range<Double>>();
View Full Code Here

    @Test
    public void testDrawFeaturePolygon() throws Exception {
        Drawing d = Drawing.create();
        Display display = Display.getCurrent();
        StyleBuilder builder = new StyleBuilder();
        Style rule = builder.createStyle(builder.createPolygonSymbolizer(Color.RED, Color.BLUE, 1));

        image = new Image(display, 16, 16);

        SWTGraphics graphics = new SWTGraphics(image, display);
        graphics.getGraphics(GC.class).setAntialias(SWT.OFF);
View Full Code Here

        LineString line = factory.createLineString(new Coordinate[]{new Coordinate(0, 2),
                new Coordinate(15, 2)});

        StyleBuilder builder = new StyleBuilder();
        Style style = builder.createStyle(builder.createLineSymbolizer(Color.BLUE, 3));

        image = new Image(display, 16, 16);

        SWTGraphics graphics = new SWTGraphics(image, display);
        graphics.getGraphics(GC.class).setAntialias(SWT.OFF);
View Full Code Here

        mark.setStroke(builder.createStroke(Color.BLUE));
        mark.setFill(builder.createFill(Color.BLUE));
        Graphic graphic = builder.createGraphic(null,
                mark, null);
        graphic.setSize(builder.getFilterFactory().literal(5));
        Style style = builder.createStyle(builder.createPointSymbolizer(graphic));

        image = new Image(display, 16, 16);

        SWTGraphics graphics = new SWTGraphics(image, display);
        graphics.getGraphics(GC.class).setAntialias(SWT.OFF);
View Full Code Here

        }
//        if (adaptee.isAssignableFrom(IndexedShapefileDataStore.class)) {
//            return adaptee.cast(parent.getDS(monitor));
//        }
        if (adaptee.isAssignableFrom(Style.class)) {
            Style style = style(monitor);
            if (style != null) {
                return adaptee.cast(style(monitor));
            }
            // proceed to ask the super class, someone may
            // of written an IResolveAdapaterFactory providing us
View Full Code Here

        Style[] styles = SLDs.styles( sld );
        // Style[] styles = parser.readXML();
       
        // put the first one on
        if (styles != null && styles.length > 0) {
            Style style = SLDs.matchingStyle(styles, featureType);
            if (style == null) {
                style = styles[0];
            }
            makeGraphicsAbsolute(file, style);
            return style;
View Full Code Here

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

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

    List<FeatureTypeStyle> styles = new ArrayList<FeatureTypeStyle>();
    String layerTypeName = null;
    if (layer.getSchema() != null
        && layer.getSchema().getTypeName() != null) {
      layerTypeName = layer.getSchema().getTypeName();
    }
    for (FeatureTypeStyle style : sld.featureTypeStyles()) {
      Set<Name> names = style.featureTypeNames();
      if (names.size() == 0) {
        styles.add(style);
      } else {
        for (Name name : names) {
View Full Code Here

     * @param color the color of the style
     * @return a simple style to use in default cases.
     */
    public static Style createLineStyle( String typeName, Color color ) {
        StyleBuilder sb = new StyleBuilder();
        Style linestyle = sb.createStyle();

        LineSymbolizer line = sb.createLineSymbolizer(color);
        linestyle.addFeatureTypeStyle(sb.createFeatureTypeStyle(line));

        FeatureTypeStyle fts = linestyle.getFeatureTypeStyles()[0];
        fts.setName(Messages.Styling_name); //tag as simple
        fts.setFeatureTypeName(SLDs.GENERIC_FEATURE_TYPENAME);
        fts.setSemanticTypeIdentifiers(new String[] {"generic:geometry", "simple"}); //$NON-NLS-1$ //$NON-NLS-2$

        return linestyle;
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.