Package org.geotools.styling

Examples of org.geotools.styling.Mark


    }

    @Test
    public void testDynamicMark() throws CQLException {
        final PointSymbolizer symbolizer = grayCircle();
        final Mark mark = (Mark) symbolizer.getGraphic().graphicalSymbols().get(0);
        mark.setWellKnownName(toExpression("if_then_else(equalTo(field, 1), 'circle', 'square')"));
        final Style s = styleFromRules(catchAllRule(symbolizer));
        assertEquals("0.0.0=&0.0.0.name=circle", encode(s, fieldIs1));
        assertEquals("0.0.0=&0.0.0.name=square", encode(s, fieldIs2));
    }
View Full Code Here


             
        protected void processSymbolizer(SimpleFeature ft, Rule rule,
                Symbolizer symbolizer) throws IOException {
            super.processSymbolizer(ft, rule, symbolizer);
            if (symbolizer instanceof PointSymbolizer) {
                Mark mark = SLD.mark((PointSymbolizer) symbolizer);
                Graphic graphic = SLD.graphic((PointSymbolizer) symbolizer);
                if (graphic != null && mark != null) {
                    Object oSize = graphic.getSize().evaluate(null);
                    if (oSize != null)
                        size = Double.parseDouble(oSize.toString());
View Full Code Here

        protected void encodePointStyle(SimpleFeature feature, Style2D style,
                PointSymbolizer symbolizer) {
            start("IconStyle");

            if (style instanceof MarkStyle2D) {
                Mark mark = SLD.mark(symbolizer);

                if (mark != null) {
                    double opacity = ((Number)mark.getFill().getOpacity().evaluate(feature)).doubleValue();

                    if (Double.isNaN(opacity)) {
                        // default to full opacity
                        opacity = 1.0;
                    }

                    if (mark.getFill() != null) {
                        final Color color = (Color)mark.getFill().getColor().evaluate(feature, Color.class);
                        encodeColor(color, opacity);
                    }
                }
            }
View Full Code Here

            if ((pointSym.getGraphic() != null)
                    && (pointSym.getGraphic().getMarks() != null)) {
                Mark[] marks = pointSym.getGraphic().getMarks();

                if ((marks.length > 0) && (marks[0] != null)) {
                    Mark mark = marks[0];

                    int opacity = 255;

                    if (mark.getFill().getOpacity() != null) {
                        float op = getOpacity(mark.getFill().getOpacity());
                        opacity = (new Float(255 * op)).intValue();
                    }

                    Paint p = ((MarkStyle2D) style).getFill();

View Full Code Here

TOP

Related Classes of org.geotools.styling.Mark

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.