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

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


    if (parent == null)
    {
      return 400; // Normal
    }

    final CSSValue value = parent.getLayoutStyle().getValue(FontStyleKeys.FONT_WEIGHT);
    if (value instanceof CSSNumericValue == false)
    {
      throw new IllegalStateException("Parent was not resolved correctly");
    }
    CSSNumericValue nval = (CSSNumericValue) value;
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)
    {
      final CSSResourceValue cssResourceValue =
              (CSSResourceValue) value;
      final Resource resource = cssResourceValue.getValue();
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;
    }
    final CSSNumericValue nval = (CSSNumericValue) value;
View Full Code Here

                       final StyleKey key)
  {
    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final boolean rightToLeft = Direction.RTL.equals
        (layoutContext.getValue(TextStyleKeys.DIRECTION));
    final CSSValue blockProgression = layoutContext.getValue(TextStyleKeys.BLOCK_PROGRESSION);
    // this might be invalid ...
    if (BlockProgression.TB.equals(blockProgression))
    {
      if (rightToLeft)
      {
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 (LineHeight.NONE.equals(value))
    {
      // query the anchestor, if there's one ..
      handleNone(process, currentNode);
      return;
View Full Code Here

  private void handleNormal (final DocumentContext process,
                             final LayoutElement currentNode)
  {
    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final CSSValue value = layoutContext.getValue(FontStyleKeys.FONT_SIZE);
    final LayoutOutputMetaData metaData = process.getOutputMetaData();
    final int resolution = (int) metaData.getNumericFeatureValue(OutputProcessorFeature.DEVICE_RESOLUTION);
    final double fontSize = StyleSheetUtility.convertLengthToDouble(value, resolution);
    if (fontSize < 10)
    {
View Full Code Here

    final LayoutElement parent = currentNode.getParentLayoutElement();
    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    if (parent == null)
    {
      // fall back to normal;
      final CSSValue value = layoutContext.getValue(FontStyleKeys.FONT_SIZE);
      final LayoutOutputMetaData metaData = process.getOutputMetaData();
      final int resolution = (int) metaData.getNumericFeatureValue(OutputProcessorFeature.DEVICE_RESOLUTION);
      fontSize = StyleSheetUtility.convertLengthToDouble(value, resolution);
    }
    else
    {
      final CSSValue value = parent.getLayoutStyle().getValue(FontStyleKeys.FONT_SIZE);
      final LayoutOutputMetaData metaData = process.getOutputMetaData();
      final int resolution = (int) metaData.getNumericFeatureValue(OutputProcessorFeature.DEVICE_RESOLUTION);
      fontSize = StyleSheetUtility.convertLengthToDouble(value, resolution);
    }
    layoutContext.setValue(LineStyleKeys.LINE_HEIGHT, CSSNumericValue.createValue(CSSNumericType.PT, fontSize));
View Full Code Here

                      final StyleKey key)
  {
    // as this is an 'auto' handler, we can assume that 'auto' is the
    // current value
    final LayoutStyle layoutContext = currentNode.getLayoutStyle();
    final CSSValue value = layoutContext.getValue(FontStyleKeys.FONT_SIZE);

    final LayoutOutputMetaData metaData = process.getOutputMetaData();
    final int resolution = (int) metaData.getNumericFeatureValue(OutputProcessorFeature.DEVICE_RESOLUTION);
    final double fontSize = StyleSheetUtility.convertLengthToDouble(value, resolution);
    final double threshold = metaData.getNumericFeatureValue(OutputProcessorFeature.FONT_SMOOTH_THRESHOLD);
View Full Code Here

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

    if (value instanceof CSSColorValue)
    {
      return;
    }


    // it might as well be a RGB- or HSL- function.

    if (value instanceof CSSFunctionValue)
    {
      final CSSFunctionValue functionValue = (CSSFunctionValue) value;
      final StyleValueFunction function = FunctionFactory.getInstance().getStyleFunction
                      (functionValue.getFunctionName());
      if (function == null)
      {
        value = HtmlColors.BLACK;
      }
      else
      {
        try
        {
          value = function.evaluate(process, currentNode, functionValue);
        }
        catch (FunctionEvaluationException e)
        {
          value = HtmlColors.BLACK;
        }
      }

      if (value instanceof CSSColorValue)
      {
        style.setValue(key, value);
        return;
      }
    }


    if (value instanceof CSSConstant == false)
    {
      style.setValue(key, HtmlColors.BLACK);
      return;
    }
    if (CSSSystemColors.CURRENT_COLOR.equals(value))
    {
      style.setValue(key, getCurrentColor(currentNode));
      return;
    }

    final CSSValue c = ColorUtil.parseIdentColor(value.getCSSText());
    if (c != null)
    {
      style.setValue(key, c);
    }
    else
View Full Code Here

  {
    final LayoutElement parent = currentNode.getParentLayoutElement();
    if (parent != null)
    {
      final LayoutStyle layoutContext = parent.getLayoutStyle();
      final CSSValue value = layoutContext.getValue(ColorStyleKeys.COLOR);
      if (value instanceof CSSColorValue)
      {
        return (CSSColorValue) value;
      }
    }
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.