Package org.pentaho.reporting.libraries.css.values

Examples of org.pentaho.reporting.libraries.css.values.CSSValue


    {
      final CSSValueList list = (CSSValueList) value;
      final int length = list.getLength();
      for (int i = 0; i < length; i++)
      {
        final CSSValue item = list.getItem(i);
        if (containsResolveableFunction(item))
        {
          return true;
        }
      }
View Full Code Here


      // invalid
      throw new IllegalArgumentException("This is not a valid key: " + key);
    }

    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final CSSValue borderStyle = layoutContext.getValue(borderStyleKey);
    if (BorderStyle.NONE.equals(borderStyle))
    {
      return CSSNumericValue.ZERO_LENGTH;
    }

    final CSSValue value = layoutContext.getValue(key);
    if (value instanceof CSSConstant)
    {
      return super.resolveValue(process, currentNode, key);
    }
    return value;
View Full Code Here

    layoutContext.setValue(TextStyleKeys.X_OPTIMUM_LETTER_SPACING, opt);
  }

  private CSSNumericValue resolveValue(final LayoutStyle style, final StyleKey key)
  {
    final CSSValue value = style.getValue(key);
    if (value instanceof CSSNumericValue == false)
    {
      // this also covers the valid 'normal' property.
      // it simply means, dont add extra space to the already existing spaces
      return CSSNumericValue.ZERO_LENGTH;
View Full Code Here

  public void resolve(final DocumentContext process,
                      final LayoutElement currentNode,
                      final StyleKey key)
  {
    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final CSSValue displayRole = layoutContext.getValue(BoxStyleKeys.DISPLAY_ROLE);
    final CSSValue floating;
    if (DisplayRole.NONE.equals(displayRole))
    {
      floating = Floating.NONE;
    }
    else
View Full Code Here

  public void resolve(final DocumentContext process,
                      final LayoutElement currentNode,
                      final StyleKey key)
  {
    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final CSSValue value = layoutContext.getValue(key);
    if (value instanceof CSSNumericValue == false)
    {
      return; // do nothing
    }
    final CSSNumericValue nval = (CSSNumericValue) value;
View Full Code Here

  public void resolve(final DocumentContext process,
                      final LayoutElement currentNode,
                      final StyleKey key)
  {
    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final CSSValue value = layoutContext.getValue(key);
    final LayoutElement parent = currentNode.getParentLayoutElement();

    if (value instanceof CSSNumericValue == false)
    {
      if (parent == null)
View Full Code Here

    // character.
    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final FontMetrics fm = process.getOutputMetaData().getFontMetrics(layoutContext);
    if (fm == null)
    {
      final CSSValue value = layoutContext.getValue(FontStyleKeys.FONT_FAMILY);
      DebugLog.log ("FontFamily is " + value + " but has not been set?" + currentNode);
      return;
    }
    final double width = FontStrictGeomUtility.toExternalValue(fm.getCharWidth(0x20));
    final CSSNumericValue percentageBase =
            CSSNumericValue.createValue(CSSNumericType.PT, width);
    final CSSNumericValue min = StyleSheetUtility.convertLength
            (resolveValue(layoutContext, TextStyleKeys.X_MIN_WORD_SPACING), percentageBase, currentNode);
    final CSSNumericValue max = StyleSheetUtility.convertLength
            (resolveValue(layoutContext, TextStyleKeys.X_MAX_WORD_SPACING), percentageBase, currentNode);
    final CSSValue opt = StyleSheetUtility.convertLength
            (resolveValue(layoutContext, TextStyleKeys.X_OPTIMUM_WORD_SPACING), percentageBase, currentNode);

    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

    layoutContext.setValue(TextStyleKeys.X_OPTIMUM_WORD_SPACING, opt);
  }

  private CSSNumericValue resolveValue (final LayoutStyle style, final StyleKey key)
  {
    final CSSValue value = style.getValue(key);
    if (value instanceof CSSNumericValue == false)
    {
      // this also covers the valid 'normal' property.
      // it simply means, dont add extra space to the already existing spaces
      return CSSNumericValue.ZERO_LENGTH;
View Full Code Here

  public void resolve(final DocumentContext process,
                      final LayoutElement currentNode,
                      final StyleKey key)
  {
    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final CSSValue value = layoutContext.getValue(ContentStyleKeys.MOVE_TO);

    // Maybe this is a 'normal'.
    if (MoveToValues.NORMAL.equals(value))
    {
      // todo: Some creepy special cases that require information about pseudo-elements.
View Full Code Here

  public void resolve(final DocumentContext process,
                      final LayoutElement currentNode,
                      final StyleKey key)
  {
    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final CSSValue value = layoutContext.getValue(key);
    if (value instanceof CSSConstant == false)
    {
      // fine, we're done here ...
      return;
    }
    final CSSConstant constant = (CSSConstant) value;
    // parent font size has been resolved already. Parent is the resolved font size of this element.


    final LayoutOutputMetaData metaData = process.getOutputMetaData();
    final int resolution = (int) metaData.getNumericFeatureValue(OutputProcessorFeature.DEVICE_RESOLUTION);
    final CSSValue fontSizeValue = currentNode.getLayoutStyle().getValue(FontStyleKeys.FONT_SIZE);
    final double fontSize = StyleSheetUtility.convertLengthToDouble(fontSizeValue, resolution);
    if (RelativeFontSize.LARGER.equals(value))
    {
      final double scaleFactor = getScaleLargerFactor(fontSize);
      layoutContext.setValue(key, CSSNumericValue.createValue(CSSNumericType.PERCENTAGE, scaleFactor));
    }
    else if (RelativeFontSize.SMALLER.equals(value))
    {
      final double scaleFactor = getScaleSmallerFactor(fontSize);
      layoutContext.setValue(key, CSSNumericValue.createValue(CSSNumericType.PERCENTAGE, scaleFactor));
    }

    final CSSValue resolvedValue = lookupValue(constant);
    if (resolvedValue != null)
    {
      layoutContext.setValue(key, resolvedValue);
      return;
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.css.values.CSSValue

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.