Examples of CssParameter


Examples of org.geotools.sld.CssParameter

        //"fill" (color)
        //"fill-opacity"
        List params = node.getChildValues(CssParameter.class);

        for (Iterator itr = params.iterator(); itr.hasNext();) {
            CssParameter param = (CssParameter) itr.next();

            if ("fill".equals(param.getName())) {
                color = param.getExpression();
            }

            if ("fill-opacity".equals(param.getName())) {
                opacity = param.getExpression();
            }
        }

        Fill fill = styleFactory.createFill(color);
View Full Code Here

Examples of org.geotools.sld.CssParameter

     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
       
        CssParameter parameter = new CssParameter((String) node.getAttributeValue("name"));
        parameter.setExpression((Expression)value);
       
        return parameter;
    }
View Full Code Here

Examples of org.geotools.sld.CssParameter

        Expression lineCap = null;
        Expression dashArray = null;
        Expression dashOffset = null;

        for (Iterator i = node.getChildValues(CssParameter.class).iterator(); i.hasNext();) {
            CssParameter css = (CssParameter) i.next();
            Expression exp = css.getExpression();
            if (exp == null) {
                continue;
            }

            if ("stroke".equals(css.getName())) {
                color = exp;
            } else if ("stroke-opacity".equals(css.getName())) {
                opacity = exp;
            } else if ("stroke-width".equals(css.getName())) {
                width = exp;
            } else if ("stroke-linejoin".equals(css.getName())) {
                lineJoin = exp;
            } else if ("stroke-linecap".equals(css.getName())) {
                lineCap = exp;
            } else if ("stroke-dasharray".equals(css.getName())) {
                dashArray = exp;
            } else if ("stroke-dashoffset".equals(css.getName())) {
                dashOffset = exp;
            }
        }

        float[] dash = null;
View Full Code Here

Examples of org.geotools.sld.CssParameter

        throws Exception {
        Font font = styleFactory.getDefaultFont();
       
        boolean familyFound = false;
        for (Iterator i = node.getChildValues(CssParameter.class).iterator(); i.hasNext();) {
            CssParameter css = (CssParameter) i.next();

            Expression exp = css.getExpression();
            if (exp == null) {
                continue;
            }

            if ("font-family".equals(css.getName())) {
                if(!familyFound) {
                    font.getFamily().set(0, exp);
                    familyFound = true;
                } else {
                    font.getFamily().add(exp);
                }
            }

            if ("font-style".equals(css.getName())) {
                font.setStyle(exp);
            }

            if ("font-weight".equals(css.getName())) {
                font.setWeight(exp);
            }

            if ("font-size".equals(css.getName())) {
                font.setSize(exp);
            }
        }

        return font;
View Full Code Here

Examples of org.geotools.sld.CssParameter

        return CssParameter.class;
    }

    @Override
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
        CssParameter option = new CssParameter((String) node.getAttributeValue("name"));
        option.setExpression(filterFactory.literal(instance.getText()));
        return option;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.