Package org.opengis.style

Examples of org.opengis.style.Graphic


    public static Color pointFillWithAlpha( PointSymbolizer symbolizer ) {
        if (symbolizer == null) {
            return null;
        }

        Graphic graphic = symbolizer.getGraphic();
        if (graphic == null) {
            return null;
        }

        for( GraphicalSymbol gs : graphic.graphicalSymbols() ) {
            if ((gs != null) && (gs instanceof Mark)) {
                Mark mark = (Mark) gs;
                Fill fill = mark.getFill();
                if (fill != null) {
                    Color colour = color(fill.getColor());
View Full Code Here


    public static Color pointStrokeColorWithAlpha( PointSymbolizer symbolizer ) {
        if (symbolizer == null) {
            return null;
        }

        Graphic graphic = symbolizer.getGraphic();
        if (graphic == null) {
            return null;
        }

        for( GraphicalSymbol gs : graphic.graphicalSymbols() ) {
            if ((gs != null) && (gs instanceof Mark)) {
                Mark mark = (Mark) gs;
                Stroke stroke = mark.getStroke();
                if (stroke != null) {
                    Color colour = color(stroke);
View Full Code Here

        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));
        assertEquals(1, (int) mark.getStroke().getWidth().evaluate(null, Integer.class));
View Full Code Here

        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));
        assertEquals(1, (int) mark.getStroke().getWidth().evaluate(null, Integer.class));
View Full Code Here

        // check the dots
        ls = (LineSymbolizer) collector.symbolizers.get(1);
        assertTrue(Arrays.equals(new float[] { 5, 15 }, ls.getStroke().getDashArray()));
        assertEquals(7.5, ls.getStroke().getDashOffset().evaluate(null, Double.class), 0.0);
        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("#000033", mark.getStroke().getColor().evaluate(null, String.class));
        assertEquals(1, (int) mark.getStroke().getWidth().evaluate(null, Integer.class));
View Full Code Here

        Expression opacity = null;
        Expression size = null;
        Expression rotation = null;
        AnchorPoint anchor = null;
        Displacement disp = null;
        Graphic graphic = sf.graphic(symbols, opacity, size, rotation, anchor, disp);
       
        assertNotNull( graphic );
    }
View Full Code Here

    Expression rotation = null; // use default
    AnchorPoint anchor = null; // use default
    Displacement displacement = null; // use default
   
    // define a point symbolizer of a small circle
    Graphic circle = sf.graphic(symbols, opacity, size, rotation, anchor, displacement);
    PointSymbolizer pointSymbolizer = sf.pointSymbolizer("point", ff.property("the_geom"), null,
            null, circle);
    // styleFactoryExample end
}
View Full Code Here

    public static Color pointFillWithAlpha( PointSymbolizer symbolizer ) {
        if (symbolizer == null) {
            return null;
        }

        Graphic graphic = symbolizer.getGraphic();
        if (graphic == null) {
            return null;
        }

        for( GraphicalSymbol gs : graphic.graphicalSymbols() ) {
            if ((gs != null) && (gs instanceof Mark)) {
                Mark mark = (Mark) gs;
                Fill fill = mark.getFill();
                if (fill != null) {
                    Color colour = color(fill.getColor());
View Full Code Here

    public static Color pointStrokeColorWithAlpha( PointSymbolizer symbolizer ) {
        if (symbolizer == null) {
            return null;
        }

        Graphic graphic = symbolizer.getGraphic();
        if (graphic == null) {
            return null;
        }

        for( GraphicalSymbol gs : graphic.graphicalSymbols() ) {
            if ((gs != null) && (gs instanceof Mark)) {
                Mark mark = (Mark) gs;
                Stroke stroke = mark.getStroke();
                if (stroke != null) {
                    Color colour = color(stroke);
View Full Code Here

        Mark m = sfact.mark(
                ffact.literal("circle"),
                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);
       
View Full Code Here

TOP

Related Classes of org.opengis.style.Graphic

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.