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

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


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


                                 final LayoutElement element)
  {

    if (rawValue instanceof CSSNumericValue)
    {
      final CSSNumericValue nval = (CSSNumericValue) rawValue;
      return (int) nval.getValue();
    }
    if (rawValue instanceof CSSAttrFunction)
    {
      final CSSAttrFunction attrFunction = (CSSAttrFunction) rawValue;
      final String attrName = attrFunction.getName();
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

  {
  }

  public CSSValue createValue(final StyleKey name, LexicalUnit value)
  {
    final CSSNumericValue firstValue = CSSValueFactory.createLengthValue(value);
    if (firstValue == null)
    {
      return null;
    }
    value = value.getNextLexicalUnit();
    final CSSNumericValue secondValue;
    if (value == null)
    {
      secondValue = firstValue;
    }
    else
View Full Code Here

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

      final int parentFontWeight = queryParent(currentNode.getParent());
      fontWeight = Math.min (100, parentFontWeight - 100);
    }
    else if (value instanceof CSSNumericValue)
    {
      final CSSNumericValue nval = (CSSNumericValue) value;
      if (CSSNumericType.NUMBER.equals(nval.getType()) == false)
      {
        // preserve the parent's weight...
        fontWeight = queryParent(currentNode.getParent());
      }
      else
      {
        fontWeight = (int) nval.getValue();
      }
    }
    else
    {
      fontWeight = queryParent(currentNode.getParent());
View Full Code Here

    {
      return RenderLength.EMPTY;
    }
    else
    {
      final CSSNumericValue nval = (CSSNumericValue) widthValue;
      if (nval.getValue() < 0 && allowNegativeValues == true)
      {
        return RenderLength.convertToInternal(widthValue, boxContext, metaData);
      }
      else if (nval.getValue() > 0)
      {
        final RenderLength renderLength = RenderLength.convertToInternal(widthValue, boxContext, metaData);
        if (renderLength.getValue() > 0)
        {
          return renderLength;
View Full Code Here

                                               final LayoutContext layoutContext,
                                               final OutputProcessorMetaData metaData)
  {
    if (value instanceof CSSNumericValue)
    {
      final CSSNumericValue nval = (CSSNumericValue) value;
      if (nval.getType() == CSSNumericType.PERCENTAGE)
      {
        // Range is between 100.000 and 0
        return new RenderLength(StrictGeomUtility.toInternalValue
                (nval.getValue()), true);
      }
      if (nval.getType() == CSSNumericType.NUMBER)
      {
        // Range is between 100.000 and 0
        return new RenderLength(StrictGeomUtility.toInternalValue
                (nval.getValue()) * 100, true);
      }

      final CSSNumericValue cssNumericValue =
          CSSValueResolverUtility.convertLength(value, layoutContext, metaData);
      // the resulting nvalue is guaranteed to have the unit PT

      return new RenderLength(StrictGeomUtility.toInternalValue
                      (cssNumericValue.getValue()), false);
    }
    return RenderLength.EMPTY;
  }
View Full Code Here

                                 final LayoutElement element)
  {

    if (rawValue instanceof CSSNumericValue)
    {
      final CSSNumericValue nval = (CSSNumericValue) rawValue;
      return (int) nval.getValue();
    }
    if (rawValue instanceof CSSAttrFunction)
    {
      final CSSAttrFunction attrFunction = (CSSAttrFunction) rawValue;
      final String attrName = attrFunction.getName();
View Full Code Here

    {
      if (value == null)
      {
        return null;
      }
      final CSSNumericValue nval = CSSValueFactory.createLengthValue(value);
      if (nval != null)
      {
        list[index] = nval;
      }
      else if (value.getLexicalUnitType() == LexicalUnit.SAC_PERCENTAGE)
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.