Examples of ImmutableFloat


Examples of org.apache.batik.css.value.ImmutableFloat

     * @param lu The SAC lexical unit used to create the value.
     */
    protected ImmutableValue createColorValue(LexicalUnit lu) {
  switch (lu.getLexicalUnitType()) {
  case LexicalUnit.SAC_INTEGER:
      return new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER,
              lu.getIntegerValue());
  case LexicalUnit.SAC_REAL:
      return new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER,
              lu.getFloatValue());
  case LexicalUnit.SAC_PERCENTAGE:
      return new ImmutableFloat(CSSPrimitiveValue.CSS_PERCENTAGE,
              lu.getFloatValue());
  default:
      throw CSSDOMExceptionFactory.createDOMException
    (DOMException.INVALID_ACCESS_ERR,
     "invalid.lexical.unit",
View Full Code Here

Examples of org.apache.batik.css.value.ImmutableFloat

                double vpw = context.getViewportWidth(element);
                double vph = context.getViewportHeight(element);
                double vpr = Math.sqrt(vpw * vpw + vph * vph);
                double p = value.getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE);
                float val = (float)(p * vpr / 100);
                ImmutableValue iv = new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER, val);
                styleDeclaration.setPropertyCSSValue(getPropertyName(),
                                                     new CSSOMReadOnlyValue(iv),
                                                     priority,
                                                     origin);
            } catch (IllegalStateException e) {
View Full Code Here

Examples of org.apache.batik.css.value.ImmutableFloat

   * Creates a value from a lexical unit.
   */
  public ImmutableValue createValue(LexicalUnit lu) throws DOMException {
      switch (lu.getLexicalUnitType()) {
      case LexicalUnit.SAC_INTEGER:
    return new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER,
            lu.getIntegerValue());
      case LexicalUnit.SAC_REAL:
    return new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER,
            lu.getFloatValue());
      default:
                throw CSSDOMExceptionFactory.createDOMException
                    (DOMException.INVALID_ACCESS_ERR,
                     "invalid.lexical.unit",
View Full Code Here

Examples of org.apache.batik.css.value.ImmutableFloat

  public ImmutableValue createFloatValue(short unitType,
                                               float floatValue)
      throws DOMException {
      switch (unitType) {
      case CSSPrimitiveValue.CSS_NUMBER:
    return new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER,
                                          floatValue);
      default:
                throw CSSDOMExceptionFactory.createDOMException
                    (DOMException.INVALID_ACCESS_ERR,
                     "invalid.unit.type",
View Full Code Here

Examples of org.apache.batik.css.value.ImmutableFloat

            throw CSSDOMExceptionFactory.createDOMException
                (DOMException.INVALID_ACCESS_ERR,
                 "invalid.unit",
                 new Object[] { new Integer(unitType), getPropertyName() });
  }
  return new ImmutableFloat(unitType, floatValue);
    }
View Full Code Here

Examples of org.apache.batik.css.value.ImmutableFloat

     * @param lu The SAC lexical unit used to create the value.
     */
    protected ImmutableValue createColorValue(LexicalUnit lu) {
  switch (lu.getLexicalUnitType()) {
  case LexicalUnit.SAC_INTEGER:
      return new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER,
              lu.getIntegerValue());
  case LexicalUnit.SAC_REAL:
      return new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER,
              lu.getFloatValue());
  case LexicalUnit.SAC_PERCENTAGE:
      return new ImmutableFloat(CSSPrimitiveValue.CSS_PERCENTAGE,
              lu.getFloatValue());
  default:
      throw CSSDOMExceptionFactory.createDOMException
    (DOMException.INVALID_ACCESS_ERR,
     "invalid.lexical.unit",
View Full Code Here

Examples of org.apache.batik.css.value.ImmutableFloat

     */
    public ImmutableValue createFloatValue(short unitType, float floatValue)
  throws DOMException {
  switch (unitType) {
  case CSSPrimitiveValue.CSS_NUMBER:
      return new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER,
                                      floatValue);
  default:
      return super.createFloatValue(unitType, floatValue);
 
    }
View Full Code Here

Examples of org.apache.batik.css.value.ImmutableFloat

    public ImmutableValue createValue(LexicalUnit lu) throws DOMException {
  switch (lu.getLexicalUnitType()) {
  case LexicalUnit.SAC_INHERIT:
      return INHERIT;
  case  LexicalUnit.SAC_INTEGER:
      return new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER,
              lu.getIntegerValue());
  case  LexicalUnit.SAC_REAL:
      return new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER,
              lu.getFloatValue());
  default:
            throw CSSDOMExceptionFactory.createDOMException
                (DOMException.INVALID_ACCESS_ERR,
                 "invalid.lexical.unit",
View Full Code Here

Examples of org.apache.batik.css.value.ImmutableFloat

     * @param floatValue  The new float value.
     */
    public ImmutableValue createFloatValue(short unitType, float floatValue)
  throws DOMException {
  if (unitType == CSSPrimitiveValue.CSS_NUMBER) {
      return new ImmutableFloat(unitType, floatValue);
  }
  throw CSSDOMExceptionFactory.createDOMException
      (DOMException.INVALID_ACCESS_ERR,
       "invalid.unit",
       new Object[] { new Integer(unitType) });
View Full Code Here

Examples of org.apache.batik.css.value.ImmutableFloat

     */
    public ImmutableValue createFloatValue(short unitType, float floatValue)
  throws DOMException {
  switch (unitType) {
  case CSSPrimitiveValue.CSS_NUMBER:
      return new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER,
                                      floatValue);
  default:
      return super.createFloatValue(unitType, floatValue);
 
    }
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.