Package org.jfree.layouting.input.style.values

Examples of org.jfree.layouting.input.style.values.CSSValue


    this.fontFamily = fontFamily;
  }

  public int getFontWeight()
  {
    final CSSValue val = style.getValue(FontStyleKeys.FONT_WEIGHT);
    if (val instanceof CSSNumericValue == false)
    {
      // this should not happen, shouldnt it?
      return 0;
    }
View Full Code Here


    return (int) nval.getValue();
  }

  public boolean isItalic()
  {
    final CSSValue value = style.getValue(FontStyleKeys.FONT_STYLE);
    return FontStyle.ITALIC.equals(value) ||
           FontStyle.OBLIQUE.equals(value);
  }
View Full Code Here

           FontStyle.OBLIQUE.equals(value);
  }

  public boolean isOblique()
  {
    final CSSValue value = style.getValue(FontStyleKeys.FONT_STYLE);
    return FontStyle.OBLIQUE.equals(value);
  }
View Full Code Here

    return FontVariant.SMALL_CAPS.equals(style.getValue(FontStyleKeys.FONT_VARIANT));
  }

  public boolean isAntiAliasing()
  {
    final CSSValue value = style.getValue(FontStyleKeys.X_FONT_SMOOTH_FLAG);
    return FontSmooth.ALWAYS.equals(value);
  }
View Full Code Here

        final Resource resource = cssResourceValue.getValue();
        return new ResourceContentToken(resource);
      }
      else if ("color".equals(type))
      {
        final CSSValue colorValue = ColorUtil.parseColor(strVal);
        if (colorValue == null)
        {
          throw new FunctionEvaluationException();
        }
        return new StaticTextToken (colorValue.getCSSText());
      }
      else
      {
        // auto-mode. We check for URLs, as this is required for images
        final CSSValue cssValue =
                FunctionUtilities.parseValue(layoutProcess, strVal);
        if (cssValue instanceof CSSResourceValue)
        {
          final CSSResourceValue cssResourceValue =
                  (CSSResourceValue) cssValue;
          final Resource resource = cssResourceValue.getValue();
          return new ResourceContentToken(resource);
        }
        else if (cssValue instanceof CSSStringValue)
        {
          final CSSStringValue sval = (CSSStringValue) cssValue;
          return new StaticTextToken (sval.getValue());
        }
        else
        {
          return new StaticTextToken (cssValue.getCSSText());
        }
      }
    }
    else if (value instanceof URL)
    {
View Full Code Here

   * @param unit
   * @return
   */
  public Map createValues(LexicalUnit unit)
  {
    final CSSValue topWidth = parseWidth(unit);
    if (topWidth == null)
    {
      return null;
    }

    unit = unit.getNextLexicalUnit();

    final CSSValue rightWidth;
    if (unit == null)
    {
      rightWidth = topWidth;
    }
    else
    {
      rightWidth = parseWidth(unit);
      if (rightWidth == null)
      {
        return null;
      }
      unit = unit.getNextLexicalUnit();
    }

    final CSSValue bottomWidth;
    if (unit == null)
    {
      bottomWidth = topWidth;
    }
    else
    {
      bottomWidth = parseWidth(unit);
      if (bottomWidth == null)
      {
        return null;
      }
      unit = unit.getNextLexicalUnit();
    }

    final CSSValue leftWidth;
    if (unit == null)
    {
      leftWidth = rightWidth;
    }
    else
View Full Code Here

  public void resolve(final LayoutProcess process,
                      final LayoutElement currentNode,
                      final StyleKey key)
  {
    final LayoutContext style = currentNode.getLayoutContext();
    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.getParent();
    if (parent != null)
    {
      final LayoutContext layoutContext = parent.getLayoutContext();
      final CSSValue value = layoutContext.getValue(ColorStyleKeys.COLOR);
      if (value instanceof CSSColorValue)
      {
        return (CSSColorValue) value;
      }
    }
View Full Code Here

  public void resolve (final LayoutProcess process,
                       final LayoutElement currentNode,
                       final StyleKey key)
  {
    final LayoutContext layoutContext = currentNode.getLayoutContext();
    final CSSValue value = layoutContext.getValue(key);
    if (LineHeight.NONE.equals(value))
    {
      // query the anchestor, if there's one ..
      handleNone(currentNode);
      return;
View Full Code Here

   * @param unit
   * @return
   */
  public Map createValues(LexicalUnit unit)
  {
    final CSSValue width = CSSValueFactory.createLengthValue(unit);
    if (width != null)
    {
      unit = unit.getNextLexicalUnit();
    }

    final CSSConstant style;
    if (unit != null)
    {
      style = (CSSConstant) lookupValue(unit);
      if (style != null)
      {
        unit = unit.getNextLexicalUnit();
      }
    }
    else
    {
      style = null;
    }

    final CSSValue color;
    if (unit != null)
    {
      color = ColorReadHandler.createColorValue(unit);
    }
    else
View Full Code Here

TOP

Related Classes of org.jfree.layouting.input.style.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.