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

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


  }

  protected CSSColorValue getCurrentColor(final LayoutElement currentNode)
  {
    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final CSSValue value = layoutContext.getValue(ColorStyleKeys.COLOR);
    if (value instanceof CSSColorValue)
    {
      return (CSSColorValue) value;
    }
    else
View Full Code Here


  {
    final LayoutStyle layoutContext = element.getLayoutStyle();
    final ContentSpecification contentSpecification =
        (ContentSpecification) layoutContext.getValue(InternalStyleKeys.INTERNAL_CONTENT);

    final CSSValue value = layoutContext.getValue(key);
    if (value instanceof CSSConstant)
    {
      if (ContentValues.NONE.equals(value))
      {
        contentSpecification.setAllowContentProcessing(false);
        contentSpecification.setInhibitContent(false);
        contentSpecification.setContents(PSEUDO_CONTENT);
        return;
      }
      else if (ContentValues.INHIBIT.equals(value))
      {
        contentSpecification.setAllowContentProcessing(false);
        contentSpecification.setInhibitContent(true);
        contentSpecification.setContents(PSEUDO_CONTENT);
        return;
      }
      else if (ContentValues.NORMAL.equals(value))
      {
//        if (layoutContext.isPseudoElement())
//        {
//          if (isListMarker(element))
//          {
//            processListItem(process, element, contentSpecification);
//            return;
//          }
//          else
//          {
//            // a pseudo-element does not have content by default.
//            contentSpecification.setAllowContentProcessing(false);
//            contentSpecification.setInhibitContent(true);
//            contentSpecification.setContents(PSEUDO_CONTENT);
//            return;
//          }
//        }
      }
    }

    contentSpecification.setInhibitContent(false);
    contentSpecification.setAllowContentProcessing(true);
    contentSpecification.setContents(DEFAULT_CONTENT);

    if (value instanceof CSSAttrFunction)
    {
      final ContentToken token = evaluateFunction((CSSFunctionValue) value, process, element);
      if (token == null)
      {
        return;
      }
      contentSpecification.setContents(new ContentToken[]{token});
    }

    if (value instanceof CSSValueList == false)
    {
      return; // cant handle that one
    }

    final ArrayList tokens = new ArrayList();
    final CSSValueList list = (CSSValueList) value;
    final int size = list.getLength();
    for (int i = 0; i < size; i++)
    {
      final CSSValueList sequence = (CSSValueList) list.getItem(i);
      for (int j = 0; j < sequence.getLength(); j++)
      {
        final CSSValue content = sequence.getItem(j);
        final ContentToken token = createToken(process, element, content);
        if (token == null)
        {
          // ok, a failure. Skip to the next content spec ...
          tokens.clear();
View Full Code Here

  {
    contentSpecification.setAllowContentProcessing(false);
    contentSpecification.setInhibitContent(false);

    final LayoutStyle layoutContext = element.getLayoutStyle();
    final CSSValue value =
        layoutContext.getValue(ListStyleKeys.LIST_STYLE_IMAGE);
    if (value != null)
    {
      final ContentToken token = createToken(process, element, value);
      if (token != null)
View Full Code Here

  public static String resolveString(final DocumentContext layoutProcess,
                                     final LayoutElement layoutElement,
                                     final CSSValue value)
      throws FunctionEvaluationException
  {
    final CSSValue notAFunctionAnymore = resolveParameter(layoutProcess, layoutElement, value);
    if (notAFunctionAnymore instanceof CSSStringValue)
    {
      final CSSStringValue strVal = (CSSStringValue) notAFunctionAnymore;
      return strVal.getValue();
    }

    // Falling back to the Value itself ..

    final String retval = notAFunctionAnymore.getCSSText();
    if (retval == null)
    {
      throw new FunctionEvaluationException
          ("Value " + notAFunctionAnymore + " is invalid");
    }
View Full Code Here

      {
        final StyleKey key = keys[i];
        final Object value = style.getValue(key);
        if (inheritInstance.equals(value))
        {
          final CSSValue parentValue = parentStyle.getValue(key);
          if (parentValue == null)
          {
            style.setValue(key, initialStyle.getValue(key));
          }
          else
View Full Code Here

      {
        return FunctionUtilities.loadResource(layoutProcess, strVal);
      }
      else if ("color".equals(type))
      {
        final CSSValue colorValue = ColorUtil.parseColor(strVal);
        if (colorValue == null)
        {
          throw new FunctionEvaluationException();
        }
        return colorValue;
View Full Code Here

    for (int i = 0; i < handlers.length; i++)
    {
      final ResolveHandlerModule handler = handlers[i];
      final StyleKey key = handler.getKey();
      final CSSValue value = node.getLayoutStyle().getValue(key);

      final ResolveHandler autoValueHandler = handler.getAutoValueHandler();
      if (autoValueHandler != null)
      {
        if (value instanceof CSSAutoValue)
View Full Code Here

  public void resolve(final DocumentContext process,
                      final LayoutElement currentNode,
                      final StyleKey key)
  {
    final PageSize ps = process.getOutputMetaData().getDefaultPageSize();
    final CSSValue page =
        new CSSValuePair(CSSNumericValue.createPtValue(ps.getWidth()),
            CSSNumericValue.createPtValue(ps.getHeight()));
    currentNode.getLayoutStyle().setValue(PageStyleKeys.SIZE, page);
  }
View Full Code Here

   */
  public void resolve(final DocumentContext process,
                      final LayoutElement currentNode,
                      final StyleKey key)
  {
    final CSSValue value = currentNode.getLayoutStyle().getValue(key);
    if (value == null)
    {
      return;
    }
    if (value instanceof CSSValueList == false)
    {
      return;
    }

    final CSSValueList list = (CSSValueList) value;
    final int length = list.getLength();
    if (length == 0)
    {
      return;
    }

    for (int i = 0; i < length; i++)
    {
      final CSSValue item = list.getItem(i);
      if (item instanceof CSSConstant == false)
      {
        resolveInvalidItem(process, currentNode, key, i);
      }
      else
View Full Code Here

    final CSSValue[] params = function.getParameters();
    if (params.length != 1)
    {
      throw new FunctionEvaluationException();
    }
    final CSSValue value = FunctionUtilities.resolveParameter(layoutProcess, element, params[0]);
    if (value instanceof CSSResourceValue)
    {
      return value;
    }
    if (value instanceof CSSStringValue == false)
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.