/** * Returns a float in user units according to the specified parameters. * * @param length the length * @param attr the name of the attribute that represents the length * @param unitsType the coordinate system (OBJECT_BOUNDING_BOX | * USER_SPACE_ON_USE) * @param uctx the unit processor context */ public static float convertLength(String length, String attr, short unitsType, UnitProcessor.Context uctx) { switch (unitsType) { case OBJECT_BOUNDING_BOX: return UnitProcessor.svgOtherLengthToObjectBoundingBox (length, attr, uctx); case USER_SPACE_ON_USE: return UnitProcessor.svgOtherLengthToUserSpace(length, attr, uctx); default: throw new IllegalArgumentException("Invalid unit type"); } }
/** * Returns a float in user units according to the specified parameters. * * @param length the length * @param attr the name of the attribute that represents the length * @param unitsType the coordinate system (OBJECT_BOUNDING_BOX | * USER_SPACE_ON_USE) * @param uctx the unit processor context */ public static float convertLength(String length, String attr, short unitsType, UnitProcessor.Context uctx) { switch (unitsType) { case OBJECT_BOUNDING_BOX: return UnitProcessor.svgOtherLengthToObjectBoundingBox (length, attr, uctx); case USER_SPACE_ON_USE: return UnitProcessor.svgOtherLengthToUserSpace(length, attr, uctx); default: throw new IllegalArgumentException("Invalid unit type"); } }
/** * Returns a float in user units according to the specified parameters. * * @param length the length * @param attr the name of the attribute that represents the length * @param unitsType the coordinate system (OBJECT_BOUNDING_BOX | * USER_SPACE_ON_USE) * @param uctx the unit processor context */ public static float convertLength(String length, String attr, short unitsType, UnitProcessor.Context uctx) { switch (unitsType) { case OBJECT_BOUNDING_BOX: return UnitProcessor.svgOtherLengthToObjectBoundingBox (length, attr, uctx); case USER_SPACE_ON_USE: return UnitProcessor.svgOtherLengthToUserSpace(length, attr, uctx); default: throw new IllegalArgumentException("Invalid unit type"); } }