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

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


    {
      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


    final CSSValue value = layoutContext.getValue(key);
    if ((value instanceof CSSNumericValue) == false)
    {
      return;
    }
    final CSSNumericValue nval = (CSSNumericValue) value;
    if (CSSNumericType.PERCENTAGE.equals(nval.getType()) == false)
    {
      return;
    }
    double percentage = nval.getValue();
    if (percentage < 0)
    {
      percentage = 0;
    }
    if (percentage > 100)
View Full Code Here

    {
      // fall back to normal ..
      handleNormal(currentNode);
      return;
    }
    final CSSNumericValue nval = (CSSNumericValue) value;

    if (CSSValueResolverUtility.isLengthValue(nval))
    {
      layoutContext.setValue(LineStyleKeys.LINE_HEIGHT, nval);
      return;
    }

    final double factor;
    if (nval.getType().equals(CSSNumericType.PERCENTAGE))
    {
      factor = nval.getValue() / 100d;
    }
    else if (nval.getType().equals(CSSNumericType.NUMBER))
    {
      factor = nval.getValue();
    }
    else
    {
      handleNormal(currentNode);
      return;
View Full Code Here

      layoutContext.setValue(TextStyleKeys.X_OPTIMUM_LETTER_SPACING, CSSNumericValue.ZERO_LENGTH);
      return;
    }

    final double width = StrictGeomUtility.toExternalValue(fm.getCharWidth(0x20));
    final CSSNumericValue percentageBase =
            CSSNumericValue.createValue(CSSNumericType.PT, width);
    final CSSNumericValue min = CSSValueResolverUtility.getLength
            (resolveValue(layoutContext, TextStyleKeys.X_MIN_LETTER_SPACING), percentageBase);
    final CSSNumericValue max = CSSValueResolverUtility.getLength
            (resolveValue(layoutContext, TextStyleKeys.X_MAX_LETTER_SPACING), percentageBase);
    final CSSNumericValue opt = CSSValueResolverUtility.getLength
            (resolveValue(layoutContext, TextStyleKeys.X_OPTIMUM_LETTER_SPACING), percentageBase);

    layoutContext.setValue(TextStyleKeys.X_MIN_LETTER_SPACING, min);
    layoutContext.setValue(TextStyleKeys.X_MAX_LETTER_SPACING, max);
    layoutContext.setValue(TextStyleKeys.X_OPTIMUM_LETTER_SPACING, opt);
View Full Code Here

      final CSSValue value = layoutContext.getValue(FontStyleKeys.FONT_FAMILY);
      DebugLog.log("FontFamily is " + value + " but has not been set?" + currentNode);
      return;
    }
    final double width = StrictGeomUtility.toExternalValue(fm.getCharWidth(0x20));
    final CSSNumericValue percentageBase =
            CSSNumericValue.createValue(CSSNumericType.PT, width);
    final CSSNumericValue min = CSSValueResolverUtility.getLength
            (resolveValue(layoutContext, TextStyleKeys.X_MIN_WORD_SPACING), percentageBase);
    final CSSNumericValue max = CSSValueResolverUtility.getLength
            (resolveValue(layoutContext, TextStyleKeys.X_MAX_WORD_SPACING), percentageBase);
    final CSSNumericValue opt = CSSValueResolverUtility.getLength
            (resolveValue(layoutContext, TextStyleKeys.X_OPTIMUM_WORD_SPACING), percentageBase);

    layoutContext.setValue(TextStyleKeys.X_MIN_WORD_SPACING, min);
    layoutContext.setValue(TextStyleKeys.X_MAX_WORD_SPACING, max);
    layoutContext.setValue(TextStyleKeys.X_OPTIMUM_WORD_SPACING, opt);
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

                CSSNumericValue.createPtValue(ps.getHeight()));
      }
    }
    else
    {
      final CSSNumericValue horizontalWidth = (CSSNumericValue) parseWidth(value);
      if (horizontalWidth == null)
      {
        return null;
      }

      value = value.getNextLexicalUnit();

      final CSSNumericValue verticalWidth;
      if (value == null)
      {
        verticalWidth = horizontalWidth;
      }
      else
View Full Code Here

    {
      // no limit ..
      return;
    }

    final CSSNumericValue size = CSSValueResolverUtility.convertLength
          (value, layoutContext, process.getOutputMetaData());

    layoutContext.setValue(key, size);
  }
View Full Code Here

    final CSSValue value = layoutContext.getValue(key);
    if (value instanceof CSSNumericValue == false)
    {
      return; // do nothing
    }
    final CSSNumericValue nval = (CSSNumericValue) value;
    if (CSSNumericType.NUMBER.equals(nval.getType()) == false)
    {
      return; // syntax error, do nothing
    }
    final LayoutElement parent = currentNode.getParent();
    if (parent == null)
    {
      return; // no parent to resolve against ...
    }

    final double adjustFactor = nval.getValue();
    final FontSpecification fontSpecification =
        currentNode.getLayoutContext().getFontSpecification();
    final FontMetrics fontMetrics =
        process.getOutputMetaData().getFontMetrics(fontSpecification);
    if (fontMetrics == null)
View Full Code Here

        layoutContext.setValue(key, CSSNumericValue.createValue(CSSNumericType.PT, fontSize));
      }
      return;
    }

    final CSSNumericValue nval = (CSSNumericValue) value;
    if (CSSValueResolverUtility.isAbsoluteValue(nval))
    {
      final CSSNumericValue fsize = CSSValueResolverUtility.convertLength
          (nval, currentNode.getLayoutContext(), process.getOutputMetaData());
      final double fontSize = fsize.getValue();
      fontSpecification.setFontSize(fontSize);
      layoutContext.setValue(key, CSSNumericValue.createValue(CSSNumericType.PT, fontSize));
    }
    // we encountered one of the relative values.
    else if (CSSNumericType.EM.equals(nval.getType()))
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.