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

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


  public void resolve(final DocumentContext process,
                      final LayoutElement currentNode,
                      final StyleKey key)
  {

    final CSSValue value = resolveValue(process, currentNode, key);
    if (value != null)
    {
      currentNode.getLayoutStyle().setValue(key, value);
    }
  }
View Full Code Here


  protected CSSValue resolveValue (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)
    {
      final CSSValue fallback = getFallback();
      if (fallback != null)
      {
        return fallback;
      }
      return null;
    }

    final CSSConstant constant = (CSSConstant) value;
    final CSSValue resolvedValue = lookupValue(constant);
    if (resolvedValue != null)
    {
//      layoutContext.setValue(key, resolvedValue);
      return resolvedValue;
    }

    final CSSValue fallback = getFallback();
    if (fallback != null)
    {
//      layoutContext.setValue(key, fallback);
      return fallback;
    }
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(PageStyleKeys.SIZE);

    String name = null;
    if (value instanceof CSSStringValue)
    {
      final CSSStringValue sval = (CSSStringValue) value;
      name = sval.getValue();
    }
    else if (value instanceof CSSConstant)
    {
      name = value.toString();
    }

    PageSize ps = null;
    if (name != null)
    {
      ps = PageSizeFactory.getInstance().getPageSizeByName(name);
    }

    if (ps == null)
    {
      ps = process.getOutputMetaData().getDefaultPageSize();
    }
    // if it is stll null, then the output target is not valid.
    // We will crash in that case ..
    final CSSValue page =
        new CSSValuePair(CSSNumericValue.createPtValue(ps.getWidth()),
            CSSNumericValue.createPtValue(ps.getHeight()));
    layoutContext.setValue(PageStyleKeys.SIZE, page);
  }
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;
    }
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)
    {
      super.resolve(process, currentNode, key);
    }
    else if (value instanceof CSSStringValue)
View Full Code Here

                       final LayoutElement currentNode,
                       final StyleKey key)
  {

    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final CSSValue displayModel = layoutContext.getValue(BoxStyleKeys.DISPLAY_MODEL);
    if (DisplayRole.NONE.equals(displayModel))
    {
      // skip ... the element will not be displayed ...
      layoutContext.setValue(PositioningStyleKeys.POSITION, Position.STATIC);
      return;
    }

    final CSSValue rawValue = layoutContext.getValue(key);
    if (rawValue instanceof CSSFunctionValue)
    {
      // OK; check for pending ..
      final CSSFunctionValue function = (CSSFunctionValue) rawValue;
      if ("running".equals(function.getFunctionName()))
View Full Code Here

                      final StyleKey key)
  {
    //Log.debug ("Processing: " + currentNode);
    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final LayoutOutputMetaData outputMetaData = process.getOutputMetaData();
    final CSSValue cssValue = layoutContext.getValue(key);
    if (cssValue instanceof CSSValueList)
    {

      final CSSValueList list = (CSSValueList) cssValue;
      for (int i = 0; i < list.getLength(); i++)
      {
        final CSSValue item = list.getItem(i);
        if (item instanceof CSSConstant)
        {
          final CSSConstant c = (CSSConstant) lookupValue((CSSConstant) item);
          final CSSValue family = outputMetaData.getNormalizedFontFamilyName(c);
          if (family != null)
          {
            layoutContext.setValue(key, family);
            return;
          }
          // Ignore, although this is not ok.
          DebugLog.log("Invalid state after setting predefined font family.");
        }
        else if (item instanceof CSSStringValue)
        {
          final CSSStringValue sval = (CSSStringValue) item;
          final CSSValue value = process.getOutputMetaData().getNormalizedFontFamilyName(sval);
          if (value != null)
          {
            layoutContext.setValue(key, value);
            return;
          }
View Full Code Here

      {
        final StyleKey[] propertyKeys = rule.getPropertyKeysAsArray();
        for (int i = 0; i < propertyKeys.length; i++)
        {
          final StyleKey key = propertyKeys[i];
          final CSSValue propertyCSSValue = rule.getPropertyCSSValue(key);
          if (propertyCSSValue != null)
          {
            target.setValue(key, propertyCSSValue);
          }
        }
        return;
      }

      final StyleKey[] propertyKeys = rule.getPropertyKeysAsArray();
      final CSSValue[] values = rule.getStyleValues();
      for (int i = 0; i < values.length; i++)
      {
        final StyleKey key = propertyKeys[i];
        final CSSValue value = rule.getPropertyCSSValue(key);
        if (ContentStyleKeys.CONTENT.equals(key) ||
            ContentStyleKeys.STRING_DEFINE.equals(key) ||
            ContentStyleKeys.STRING_SET.equals(key))
        {
          // dont resolve that one ..
          values[i] = value;
        }
        else
        {
          values[i] = resolveValue(value, element);
        }
      }

      for (int i = 0; i < values.length; i++)
      {
        final StyleKey key = propertyKeys[i];

        final CSSValue value = values[i];
        if (value != null)
        {
          target.setValue(key, 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);
    if (value instanceof CSSNumericValue == false)
    {
      // no limit ..
      return;
    }
View Full Code Here

      final CSSValueList list = (CSSValueList) value;
      final int length = list.getLength();
      final CSSValue[] retValus = new CSSValue[length];
      for (int i = 0; i < length; i++)
      {
        final CSSValue item = list.getItem(i);
        retValus[i] = resolveValue(item, element);
      }
      return new CSSValueList(retValus);
    }
    else if (value instanceof CSSValuePair)
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.