Package org.jfree.layouting.input.style.values

Examples of org.jfree.layouting.input.style.values.CSSNumericValue


  {
    if (value instanceof CSSNumericValue == false)
    {
      return false;
    }
    final CSSNumericValue nval = (CSSNumericValue) value;
    return nval.getType().equals(type);
  }
View Full Code Here


    if (value instanceof CSSNumericValue == false)
    {
      return null;
    }

    final CSSNumericValue nval = (CSSNumericValue) value;
    if (isNumericType(CSSNumericType.PERCENTAGE, nval))
    {
      if (percentageBase == null)
      {
        return null;
      }

      final double percentage = nval.getValue();
      return CSSNumericValue.createValue(percentageBase.getType(),
          percentageBase.getValue() * percentage / 100.0d);
    }

    return nval;
View Full Code Here

  public static double getNumericValue(final CSSValue value,
                                       final double defaultValue)
  {
    if (value instanceof CSSNumericValue)
    {
      final CSSNumericValue nval = (CSSNumericValue) value;
      if (CSSNumericType.NUMBER.equals(nval.getType()))
      {
        return nval.getValue();
      }
    }
    return defaultValue;
  }
View Full Code Here


  public static CSSValue parseValue (final LayoutProcess process,
                                     final String text)
  {
    final CSSNumericValue val = convertToNumber(text);
    if (val != null)
    {
      return val;
    }
View Full Code Here

  }

  public static CSSNumericValue parseNumberValue (final String text, final String type)
          throws FunctionEvaluationException
  {
    final CSSNumericValue val = convertToNumber(text, getUnitType(type));
    if (val != null)
    {
      return val;
    }
    throw new FunctionEvaluationException("Unable to convert to number.");
View Full Code Here

  }

  public static CSSNumericValue parseNumberValue (final String text)
          throws FunctionEvaluationException
  {
    final CSSNumericValue val = convertToNumber(text);
    if (val != null)
    {
      return val;
    }
    throw new FunctionEvaluationException("Unable to convert to number.");
View Full Code Here

        contentList.add(new CSSStringValue(CSSStringType.STRING,
                parameters.getStringValue()));
      }
      else if (CSSValueFactory.isNumericValue(parameters))
      {
        final CSSNumericValue numericValue =
                CSSValueFactory.createNumericValue(parameters);
        if (numericValue == null)
        {
          return null;
        }
        contentList.add(numericValue);
      }
      else if (CSSValueFactory.isLengthValue(parameters))
      {
        final CSSNumericValue lengthValue =
                CSSValueFactory.createLengthValue(parameters);
        if (lengthValue == null)
        {
          return null;
        }
View Full Code Here

    if (val instanceof CSSNumericValue == false)
    {
      // this should not happen, shouldnt it?
      return 0;
    }
    final CSSNumericValue nval = (CSSNumericValue) val;
    return (int) nval.getValue();
  }
View Full Code Here

    if (value instanceof String)
    {
      final String strVal = (String) value;
      if ("length".equals(type))
      {
        final CSSNumericValue cssNumericValue =
                FunctionUtilities.parseNumberValue(strVal);
        return new StaticTextToken (cssNumericValue.getCSSText());
      }
      else if ("url".equals(type))
      {
        final CSSResourceValue cssResourceValue =
                FunctionUtilities.loadResource(layoutProcess, strVal);
View Full Code Here

  public double getScaleLargerFactor(final double parentSize)
  {
    for (int i = 0; i < predefinedSizes.length; i++)
    {
      final CSSNumericValue size = predefinedSizes[i];
      if (parentSize < size.getValue())
      {
        return predefinedScalingFactors[i];
      }
    }
    return predefinedScalingFactors[6];
View Full Code Here

TOP

Related Classes of org.jfree.layouting.input.style.values.CSSNumericValue

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.