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

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


   * @param unit
   * @return
   */
  public Map createValues(LexicalUnit unit)
  {
    CSSValue optimum = parseSingleSpacingValue(unit);
    if (optimum == null)
    {
      return null;
    }
    unit = unit.getNextLexicalUnit();

    CSSValue minimum = parseSingleSpacingValue(unit);
    if (minimum != null)
    {
      unit = unit.getNextLexicalUnit();
    }

    CSSValue maximum = parseSingleSpacingValue(unit);
    final Map map = new HashMap();
    map.put(getMinimumKey(), minimum);
    map.put(TextStyleKeys.X_MAX_LETTER_SPACING, maximum);
    map.put(TextStyleKeys.X_OPTIMUM_LETTER_SPACING, optimum);
    return map;
View Full Code Here


  }

  public CSSValue createValue(StyleKey name, LexicalUnit value)
  {

    CSSValue cssvalue = null;
    if (value.getLexicalUnitType() == LexicalUnit.SAC_PERCENTAGE)
    {
      cssvalue = CSSNumericValue.createValue(CSSNumericType.PERCENTAGE, value.getFloatValue());
    }
    else
View Full Code Here

    addValue(LineGridProgression.TEXT_HEIGHT);
  }

  protected CSSValue lookupValue(final LexicalUnit value)
  {
    CSSValue length = CSSValueFactory.createLengthValue(value);
    if (length != null)
    {
      return length;
    }
    return super.lookupValue(value);
View Full Code Here

      map.put(TextStyleKeys.TEXT_OVERFLOW_ELLIPSIS, CSSInheritValue.getInstance());
      return map;
    }


    CSSValue mode = modeReadHandler.createValue(null, unit);
    if (mode != null)
    {
      unit = unit.getNextLexicalUnit();
    }
    CSSValue ellipsis;
    if (unit != null)
    {
      ellipsis = ellipsisReadHandler.createValue(null, unit);
    }
    else
View Full Code Here

  public Map createValues(LexicalUnit unit)
  {
    // http://cheeaun.phoenity.com/weblog/2005/06/whitespace-and-generated-content.html
    // is a good overview about the whitespace stuff ..

    CSSValue whitespace;
    CSSValue textWrap;
    if (unit.getLexicalUnitType() == LexicalUnit.SAC_INHERIT)
    {
      whitespace = CSSInheritValue.getInstance();
      textWrap = CSSInheritValue.getInstance();
    }
View Full Code Here

    addValue(FontSmooth.NEVER);
  }

  protected CSSValue lookupValue(final LexicalUnit value)
  {
    final CSSValue cssValue = super.lookupValue(value);
    if (cssValue != null)
    {
      return cssValue;
    }

    final CSSValue number = CSSValueFactory.createNumericValue(value);
    if (number != null)
    {
      return number;
    }
    return CSSValueFactory.createLengthValue(value);
View Full Code Here

  {
    if (value.getLexicalUnitType() == LexicalUnit.SAC_PERCENTAGE)
    {
      return CSSNumericValue.createValue(CSSNumericType.PERCENTAGE, value.getFloatValue());
    }
    CSSValue constant = super.lookupValue(value);
    if (constant != null)
    {
      return constant;
    }
    return CSSValueFactory.createLengthValue(value);
View Full Code Here

   * @param unit
   * @return
   */
  public Map createValues(LexicalUnit unit)
  {
    CSSValue style = styleReadHandler.createValue(null, unit);
    if (style != null)
    {
      unit = unit.getNextLexicalUnit();
    }
    CSSValue position;
    if (unit != null)
    {
      position = positionReadHandler.createValue(null, unit);
    }
    else
View Full Code Here

   */
  public Map createValues(LexicalUnit unit)
  {
    // todo we ignore the font-family system font styles for now.

    CSSValue fontStyle = styleReadHandler.createValue(null, unit);
    if (fontStyle != null)
    {
      unit = unit.getNextLexicalUnit();
      if (unit == null)
      {
        return null;
      }
    }
    CSSValue fontVariant = variantReadHandler.createValue(null, unit);
    if (fontVariant != null)
    {
      unit = unit.getNextLexicalUnit();
      if (unit == null)
      {
        return null;
      }
    }
    CSSValue fontWeight = weightReadHandler.createValue(null, unit);
    if (fontWeight != null)
    {
      unit = unit.getNextLexicalUnit();
      if (unit == null)
      {
        return null;
      }
    }

    CSSValue fontSize = sizeReadHandler.createValue(null, unit);
    if (fontSize == null)
    {
      return null; // required value is missing
    }

    unit = unit.getNextLexicalUnit();
    if (unit == null)
    {
      return null; // font family missing
    }

    CSSValue lineHeight = null;
    if (unit.getLexicalUnitType() == LexicalUnit.SAC_OPERATOR_SLASH)
    {
      unit = unit.getNextLexicalUnit();
      if (unit == null)
      {
        return null;
      }

      lineHeight = lineHeightReadHandler.createValue(null, unit);
      if (lineHeight == null)
      {
        return null; // required sequence missing
      }
      unit = unit.getNextLexicalUnit();
      if (unit == null)
      {
        return null;
      }
    }

    CSSValue fontFamily = fontFamilyReadHandler.createValue(null, unit);
    if (fontFamily == null)
    {
      return null; // font family is required!
    }

View Full Code Here

    map.put(TextStyleKeys.TEXT_OVERLINE_STYLE, TextDecorationStyle.NONE);
    map.put(TextStyleKeys.TEXT_LINE_THROUGH_STYLE, TextDecorationStyle.NONE);

    while (unit != null)
    {
      CSSValue constant = lookupValue(unit);
      if (constant == null)
      {
        return null;
      }
      if (constant.getCSSText().equals("none"))
      {
        map.put(TextStyleKeys.TEXT_UNDERLINE_STYLE, TextDecorationStyle.NONE);
        map.put(TextStyleKeys.TEXT_OVERLINE_STYLE, TextDecorationStyle.NONE);
        map.put(TextStyleKeys.TEXT_LINE_THROUGH_STYLE, TextDecorationStyle.NONE);
        return map;
      }
      if (constant.getCSSText().equals("blink"))
      {
        map.put(TextStyleKeys.TEXT_BLINK, new CSSConstant("blink"));
      }
      else if (constant.getCSSText().equals("underline"))
      {
        map.put(TextStyleKeys.TEXT_UNDERLINE_STYLE, TextDecorationStyle.SOLID);
      }
      else if (constant.getCSSText().equals("overline"))
      {
        map.put(TextStyleKeys.TEXT_OVERLINE_STYLE, TextDecorationStyle.SOLID);
      }
      else if (constant.getCSSText().equals("line-through"))
      {
        map.put(TextStyleKeys.TEXT_LINE_THROUGH_STYLE, TextDecorationStyle.SOLID);
      }
      unit = unit.getNextLexicalUnit();
    }
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.