Package org.geotools.styling

Examples of org.geotools.styling.LineSymbolizer


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

        LineSymbolizer ls = (LineSymbolizer) collector.symbolizers.get(0);
        assertEquals(SI.METER, ls.getUnitOfMeasure());
    }
View Full Code Here


        }
        Stroke stroke = strokeBuilder.build();
        if (stroke == null) {
            stroke = Stroke.DEFAULT;
        }
        LineSymbolizer ls = sf.createLineSymbolizer(stroke, null);
        if (geometry != null) {
            ls.setGeometry(geometry);
        }
        if (uom != null) {
            ls.setUnitOfMeasure(uom);
        }
        if (parent == null) {
            reset();
        }
        return ls;
View Full Code Here

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

        // check the size
        LineSymbolizer ls = (LineSymbolizer) collector.symbolizers.get(0);
        assertEquals(3, (int) ls.getStroke().getWidth().evaluate(null, Integer.class));
        assertEquals(Color.BLACK, (Color) ls.getStroke().getColor().evaluate(null, Color.class));
    }
View Full Code Here

        assertEquals(2, collector.featureTypeStyles.size());
        assertEquals(2, collector.rules.size());
        assertEquals(2, collector.symbolizers.size());

        // check the first line
        LineSymbolizer ls = (LineSymbolizer) collector.symbolizers.get(0);
        assertEquals(5, (int) ls.getStroke().getWidth().evaluate(null, Integer.class));
        assertEquals("#333333", (String) ls.getStroke().getColor().evaluate(null, String.class));

        // check the second line
        ls = (LineSymbolizer) collector.symbolizers.get(1);
        assertEquals(3, (int) ls.getStroke().getWidth().evaluate(null, Integer.class));
        assertEquals("#6699FF", (String) ls.getStroke().getColor().evaluate(null, String.class));
    }
View Full Code Here

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

        // check the size
        LineSymbolizer ls = (LineSymbolizer) collector.symbolizers.get(0);
        assertEquals(3, (int) ls.getStroke().getWidth().evaluate(null, Integer.class));
        assertEquals(Color.BLUE, (Color) ls.getStroke().getColor().evaluate(null, Color.class));
        assertTrue(Arrays.equals(new float[] { 5, 2 }, ls.getStroke().getDashArray()));
    }
View Full Code Here

        assertEquals(1, collector.featureTypeStyles.size());
        assertEquals(2, collector.rules.size());
        assertEquals(2, collector.symbolizers.size());

        // check the simple line
        LineSymbolizer ls = (LineSymbolizer) collector.symbolizers.get(0);
        assertEquals(3, (int) ls.getStroke().getWidth().evaluate(null, Integer.class));
        assertEquals("#333333", (String) ls.getStroke().getColor().evaluate(null, String.class));

        // check the rail
        ls = (LineSymbolizer) collector.symbolizers.get(1);
        Graphic graphic = ls.getStroke().getGraphicStroke();
        List<GraphicalSymbol> symbols = graphic.graphicalSymbols();
        assertEquals(1, symbols.size());
        Mark mark = (Mark) symbols.get(0);
        assertEquals("shape://vertline", mark.getWellKnownName().evaluate(null));
        assertEquals("#333333", mark.getStroke().getColor().evaluate(null, String.class));
View Full Code Here

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

        // check the dots
        LineSymbolizer ls = (LineSymbolizer) collector.symbolizers.get(0);
        assertTrue(Arrays.equals(new float[] { 4, 6 }, ls.getStroke().getDashArray()));
        Graphic graphic = ls.getStroke().getGraphicStroke();
        List<GraphicalSymbol> symbols = graphic.graphicalSymbols();
        assertEquals(1, symbols.size());
        Mark mark = (Mark) symbols.get(0);
        assertEquals("circle", mark.getWellKnownName().evaluate(null));
        assertEquals("#333333", mark.getStroke().getColor().evaluate(null, String.class));
View Full Code Here

    return style;
  }

  private LineSymbolizer linesym(StyleFactory sFac)
      throws IllegalFilterException {
    LineSymbolizer linesym = sFac.createLineSymbolizer();
    Stroke myStroke = sFac.getDefaultStroke();
    myStroke.setColor(filterFactory.literal("#0000ff"));
    myStroke
        .setWidth(filterFactory.literal(new Integer(5)));
    LOGGER.fine("got new Stroke " + myStroke);
    linesym.setStroke(myStroke);
    return linesym;
  }
View Full Code Here

    rulep.setSymbolizers(new Symbolizer[] { pointsym });
    FeatureTypeStyle ftsP = sFac.createFeatureTypeStyle();
    ftsP.setRules(new Rule[] { rulep });
    ftsP.setFeatureTypeName("querytest");

    LineSymbolizer linesym = sFac.createLineSymbolizer();
    linesym.setGeometryPropertyName("line");

    Stroke myStroke = sFac.getDefaultStroke();
    myStroke.setColor(filterFactory.literal("#0000ff"));
    myStroke
        .setWidth(filterFactory.literal(new Integer(3)));
    LOGGER.info("got new Stroke " + myStroke);
    linesym.setStroke(myStroke);

    Rule rule2 = sFac.createRule();
    rule2.setSymbolizers(new Symbolizer[] { linesym });
    FeatureTypeStyle ftsL = sFac.createFeatureTypeStyle();
    ftsL.setRules(new Rule[] { rule2 });
View Full Code Here

        /*
         * Setting the geometryPropertyName arg to null signals that we want to
         * draw the default geomettry of features
         */
        LineSymbolizer sym = styleFactory.createLineSymbolizer(stroke, null);

        Rule rule = styleFactory.createRule();
        rule.symbolizers().add(sym);
        FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle(new Rule[]{rule});
        Style style = styleFactory.createStyle();
View Full Code Here

TOP

Related Classes of org.geotools.styling.LineSymbolizer

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.