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

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


    if (value instanceof CSSFunctionValue == false)
    {
      return value;
    }

    final CSSFunctionValue functionValue = (CSSFunctionValue) value;

    final StyleValueFunction function =
        FunctionFactory.getInstance().getStyleFunction
            (functionValue.getFunctionName());
    if (function == null)
    {
      throw new FunctionEvaluationException
          ("Unsupported Function: " + functionValue);
    }
View Full Code Here


    final CSSValue rawValue = layoutContext.getValue(key);
    if (rawValue instanceof CSSFunctionValue)
    {
      // OK; check for pending ..
      final CSSFunctionValue function = (CSSFunctionValue) rawValue;
      if ("running".equals(function.getFunctionName()))
      {
        // The element will be inside a block-context (same behaviour as
        // for floats)
        layoutContext.setValue(BoxStyleKeys.DISPLAY_MODEL, DisplayModel.BLOCK_INSIDE);
        layoutContext.setValue(BoxStyleKeys.DISPLAY_ROLE, DisplayRole.BLOCK);
View Full Code Here

    }

    if (value instanceof CSSFunctionValue)
    {
      // thats plain and simple - resolve it directly.
      final CSSFunctionValue functionValue = (CSSFunctionValue) value;
      final String name = functionValue.getFunctionName().toLowerCase();
      final StyleValueFunction o = (StyleValueFunction) functions.get(name);
      if (o == null)
      {
        throw new FunctionEvaluationException("No such function registered: " + name);
      }
View Full Code Here

  public void testParseColorFunction()
  {
    StyleSheet s = new StyleSheet();
    CSSStyleRule rule = new CSSStyleRule(s, null);
    rule.setPropertyValueAsString(BorderStyleKeys.BACKGROUND_COLOR, "rgb(0,255,0)");
    final CSSFunctionValue value = (CSSFunctionValue) rule.getPropertyCSSValue(BorderStyleKeys.BACKGROUND_COLOR);
    assertEquals("rgb", value.getFunctionName());
    final CSSValue[] cssValues = value.getParameters();
    assertEquals("Parameter-count", 3, cssValues.length);
    assertEquals("Parameter1", "0", cssValues[0].toString());
    assertEquals("Parameter2", "255", cssValues[1].toString());
    assertEquals("Parameter3", "0", cssValues[2].toString());
  }
View Full Code Here

TOP

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

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.