congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
UnitProcessor.svgToUserSpace
Code IndexAdd Tabnine to your IDE (free)

How to use
svgToUserSpace
method
in
org.apache.batik.parser.UnitProcessor

Best Java code snippets using org.apache.batik.parser.UnitProcessor.svgToUserSpace (Showing top 17 results out of 315)

origin: org.apache.xmlgraphics/batik-parser

  return svgToUserSpace(value, type, d, ctx);
default:
  throw new IllegalArgumentException("Length has unknown type");
origin: avianey/androidsvgdrawable-plugin

private float svgLengthInPixels(SVGLength length, UnitProcessor.Context context) {
  return UnitProcessor.svgToUserSpace(length.getValueAsString(), "px", UnitProcessor.OTHER_LENGTH, context);
}
origin: fr.avianey.apache-xmlgraphics/batik

  return svgToUserSpace(value, type, d, ctx);
default:
  throw new IllegalArgumentException("Length has unknown type");
origin: apache/batik

  return svgToUserSpace(value, type, d, ctx);
default:
  throw new IllegalArgumentException("Length has unknown type");
origin: org.apache.xmlgraphics/batik-anim

/**
 * <b>DOM</b>: Implements {@link SVGLength#getValue()}.
 */
public float getValue() {
  revalidate();
  try {
    return UnitProcessor.svgToUserSpace(value, unitType,
                      direction, context);
  } catch (IllegalArgumentException ex) {
    // XXX Should we throw an exception here when the length
    //     type is unknown?
    return 0f;
  }
}
origin: fr.avianey.androidsvgdrawable/core

private float svgLengthInPixels(SVGLength length, UnitProcessor.Context context) {
  return UnitProcessor.svgToUserSpace(length.getValueAsString(), "px", UnitProcessor.OTHER_LENGTH, context);
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * <b>DOM</b>: Implements {@link SVGLength#getValue()}.
 */
public float getValue() {
  revalidate();
  try {
    return UnitProcessor.svgToUserSpace(value, unitType,
                      direction, context);
  } catch (IllegalArgumentException ex) {
    // XXX Should we throw an exception here when the length
    //     type is unknown?
    return 0f;
  }
}
origin: apache/batik

/**
 * <b>DOM</b>: Implements {@link SVGLength#getValue()}.
 */
public float getValue() {
  revalidate();
  try {
    return UnitProcessor.svgToUserSpace(value, unitType,
                      direction, context);
  } catch (IllegalArgumentException ex) {
    // XXX Should we throw an exception here when the length
    //     type is unknown?
    return 0f;
  }
}
origin: apache/batik

/**
 * Converts the given SVG length into user units.
 * @param v the SVG length value
 * @param type the SVG length units (one of the
 *             {@link SVGLength}.SVG_LENGTH_* constants)
 * @param pcInterp how to interpretet percentage values (one of the
 *             {@link SVGContext}.PERCENTAGE_* constants)
 * @return the SVG value in user units
 */
public float svgToUserSpace(float v, short type, short pcInterp) {
  if (unitContext == null) {
    unitContext = new UnitContext();
  }
  if (pcInterp == PERCENTAGE_FONT_SIZE
      && type == SVGLength.SVG_LENGTHTYPE_PERCENTAGE) {
    // XXX
    return 0f;
  } else {
    return UnitProcessor.svgToUserSpace(v, type, (short) (3 - pcInterp),
                      unitContext);
  }
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Converts the given SVG length into user units.
 * @param v the SVG length value
 * @param type the SVG length units (one of the
 *             {@link SVGLength}.SVG_LENGTH_* constants)
 * @param pcInterp how to interpretet percentage values (one of the
 *             {@link SVGContext}.PERCENTAGE_* constants)
 * @return the SVG value in user units
 */
public float svgToUserSpace(float v, short type, short pcInterp) {
  if (unitContext == null) {
    unitContext = new UnitContext();
  }
  if (pcInterp == PERCENTAGE_FONT_SIZE
      && type == SVGLength.SVG_LENGTHTYPE_PERCENTAGE) {
    // XXX
    return 0f;
  } else {
    return UnitProcessor.svgToUserSpace(v, type, (short) (3 - pcInterp),
                      unitContext);
  }
}
origin: org.apache.xmlgraphics/batik-anim

/**
 * Converts the given SVG length into user units.
 * @param v the SVG length value
 * @param type the SVG length units (one of the
 *             {@link SVGLength}.SVG_LENGTH_* constants)
 * @param pcInterp how to interpretet percentage values (one of the
 *             {@link SVGContext}.PERCENTAGE_* constants)
 * @return the SVG value in user units
 */
public float svgToUserSpace(float v, short type, short pcInterp) {
  if (unitContext == null) {
    unitContext = new UnitContext();
  }
  if (pcInterp == PERCENTAGE_FONT_SIZE
      && type == SVGLength.SVG_LENGTHTYPE_PERCENTAGE) {
    // XXX
    return 0f;
  } else {
    return UnitProcessor.svgToUserSpace(v, type, (short) (3 - pcInterp),
                      unitContext);
  }
}
origin: org.apache.xmlgraphics/batik-bridge

/**
 * 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) {
  try {
    return org.apache.batik.parser.UnitProcessor.
      svgToUserSpace(s, attr, d, ctx);
  } catch (ParseException pEx ) {
    throw new BridgeException
      (getBridgeContext(ctx), ctx.getElement(),
       pEx, ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED,
       new Object[] {attr, s, pEx, });
  }
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * 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) {
  try {
    return org.apache.batik.parser.UnitProcessor.
      svgToUserSpace(s, attr, d, ctx);
  } catch (ParseException pEx ) {
    throw new BridgeException
      (getBridgeContext(ctx), ctx.getElement(),
       pEx, ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED,
       new Object[] {attr, s, pEx, });
  }
}
origin: apache/batik

/**
 * 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) {
  try {
    return org.apache.batik.parser.UnitProcessor.
      svgToUserSpace(s, attr, d, ctx);
  } catch (ParseException pEx ) {
    throw new BridgeException
      (getBridgeContext(ctx), ctx.getElement(),
       pEx, ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED,
       new Object[] {attr, s, pEx, });
  }
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * 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);
}
origin: org.apache.xmlgraphics/batik-parser

/**
 * 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);
}
origin: apache/batik

/**
 * 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);
}
org.apache.batik.parserUnitProcessorsvgToUserSpace

Javadoc

Converts the specified value of the specified type and direction to user units.

Popular methods of UnitProcessor

  • svgToObjectBoundingBox
    Returns the specified value with the specified direction in objectBoundingBox units.
  • emsToPixels
    Converts ems units to user units.
  • exsToPixels
    Converts exs units to user units.
  • percentagesToPixels
    Converts percentages to user units.
  • pixelsToEms
    Converts user units to ems units.
  • pixelsToExs
    Converts user units to exs units.
  • pixelsToPercentages
    Converts user units to percentages relative to the viewport.
  • userSpaceToSVG
    Converts the specified value of the specified type and direction to SVG units.

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JFileChooser (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now