Package org.apache.batik.parser

Examples of org.apache.batik.parser.LengthParser


     * of the parsing of this value.
     * @param s String representation of a SVGlength.
     */
    protected void parse(String s){
        try {
            LengthParser lengthParser = new LengthParser();
            UnitProcessor.UnitResolver ur =
                new UnitProcessor.UnitResolver();
            lengthParser.setLengthHandler(ur);
            lengthParser.parse(s);
            unitType = ur.unit;
            value = ur.value;
        } catch (ParseException e) {
            unitType = SVG_LENGTHTYPE_UNKNOWN;
            value = 0;
View Full Code Here


    public static float svgToObjectBoundingBox(String s,
                                               String attr,
                                               short d,
                                               Context ctx)
        throws ParseException {
        LengthParser lengthParser = new LengthParser();
        UnitResolver ur = new UnitResolver();
        lengthParser.setLengthHandler(ur);
        lengthParser.parse(s);
        return svgToObjectBoundingBox(ur.value, ur.unit, d, ctx);
    }
View Full Code Here

     */
    public static float svgToUserSpace(String s,
                                       String attr,
                                       short d,
                                       Context ctx) throws ParseException {
        LengthParser lengthParser = new LengthParser();
        UnitResolver ur = new UnitResolver();
        lengthParser.setLengthHandler(ur);
        lengthParser.parse(s);
        return svgToUserSpace(ur.value, ur.unit, d, ctx);
    }
View Full Code Here

    public static float svgToObjectBoundingBox(String s,
                                               String attr,
                                               short d,
                                               Context ctx)
        throws ParseException {
        LengthParser lengthParser = new LengthParser();
        UnitResolver ur = new UnitResolver();
        lengthParser.setLengthHandler(ur);
        lengthParser.parse(s);
        return svgToObjectBoundingBox(ur.value, ur.unit, d, ctx);
    }
View Full Code Here

     */
    public static float svgToUserSpace(String s,
                                       String attr,
                                       short d,
                                       Context ctx) throws ParseException {
        LengthParser lengthParser = new LengthParser();
        UnitResolver ur = new UnitResolver();
        lengthParser.setLengthHandler(ur);
        lengthParser.parse(s);
        return svgToUserSpace(ur.value, ur.unit, d, ctx);
    }
View Full Code Here

    public static float svgToObjectBoundingBox(String s,
                                               String attr,
                                               short d,
                                               Context ctx)
        throws ParseException {
        LengthParser lengthParser = new LengthParser();
        UnitResolver ur = new UnitResolver();
        lengthParser.setLengthHandler(ur);
        lengthParser.parse(s);
        return svgToObjectBoundingBox(ur.value, ur.unit, d, ctx);
    }
View Full Code Here

     */
    public static float svgToUserSpace(String s,
                                       String attr,
                                       short d,
                                       Context ctx) throws ParseException {
        LengthParser lengthParser = new LengthParser();
        UnitResolver ur = new UnitResolver();
        lengthParser.setLengthHandler(ur);
        lengthParser.parse(s);
        return svgToUserSpace(ur.value, ur.unit, d, ctx);
    }
View Full Code Here

                return;
            }

            String s = getValueAsString();
            try {
                LengthParser lengthParser = new LengthParser();
                UnitProcessor.UnitResolver ur =
                    new UnitProcessor.UnitResolver();
                lengthParser.setLengthHandler(ur);
                lengthParser.parse(s);
                unitType = ur.unit;
                value = ur.value;
            } catch (ParseException e) {
                unitType = SVG_LENGTHTYPE_UNKNOWN;
                value = 0;
View Full Code Here

                return;
            }

            String s = getValueAsString();
            try {
                LengthParser lengthParser = new LengthParser();
                UnitProcessor.UnitResolver ur =
                    new UnitProcessor.UnitResolver();
                lengthParser.setLengthHandler(ur);
                lengthParser.parse(s);
                unitType = ur.unit;
                value = ur.value;
            } catch (ParseException e) {
                unitType = SVG_LENGTHTYPE_UNKNOWN;
                value = 0;
View Full Code Here

     * of the parsing of this value.
     * @param s String representation of a SVGlength.
     */
    protected void parse(String s){
        try {
            LengthParser lengthParser = new LengthParser();
            UnitProcessor.UnitResolver ur =
                new UnitProcessor.UnitResolver();
            lengthParser.setLengthHandler(ur);
            lengthParser.parse(s);
            unitType = ur.unit;
            value = ur.value;
        } catch (ParseException e) {
            unitType = SVG_LENGTHTYPE_UNKNOWN;
            value = 0;
View Full Code Here

TOP

Related Classes of org.apache.batik.parser.LengthParser

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.