/** * Creates a new AnimatableLengthValueFactory. */ public AnimatableLengthValueFactory() { parser.setLengthHandler(handler); }
/** * Creates a new AnimatableLengthValueFactory. */ public AnimatableLengthValueFactory() { parser.setLengthHandler(handler); }
/** * Creates a new AnimatableLengthValueFactory. */ public AnimatableLengthValueFactory() { parser.setLengthHandler(handler); }
/** * Parse a String value as a SVGLength. * * Initialize this length with the result * 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; } }
/** * Parse a String value as a SVGLength. * * Initialize this length with the result * 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; } }
/** * Parse a String value as a SVGLength. * * Initialize this length with the result * 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; } }
/** * Returns the specified coordinate with the specified direction * in user units. * * @param s the 'other' coordinate * @param attr the attribute name that represents the length * @param d the direction of the coordinate * @param ctx the context used to resolve relative value */ 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); }
/** * Returns the specified coordinate with the specified direction * in user units. * * @param s the 'other' coordinate * @param attr the attribute name that represents the length * @param d the direction of the coordinate * @param ctx the context used to resolve relative value */ 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); }
/** * Returns the specified coordinate with the specified direction * in user units. * * @param s the 'other' coordinate * @param attr the attribute name that represents the length * @param d the direction of the coordinate * @param ctx the context used to resolve relative value */ 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); }
/** * Returns the specified value with the specified direction in * objectBoundingBox units. * * @param s the value * @param attr the attribute name that represents the value * @param d the direction of the value * @param ctx the context used to resolve relative value */ 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); }
/** * Returns the specified value with the specified direction in * objectBoundingBox units. * * @param s the value * @param attr the attribute name that represents the value * @param d the direction of the value * @param ctx the context used to resolve relative value */ 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); }
/** * Returns the specified value with the specified direction in * objectBoundingBox units. * * @param s the value * @param attr the attribute name that represents the value * @param d the direction of the value * @param ctx the context used to resolve relative value */ 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); }