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

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


  public void resolve (final LayoutProcess process,
                       final LayoutElement currentNode,
                       final StyleKey key)
  {
    final LayoutContext layoutContext = currentNode.getLayoutContext();
    final CSSValue rawValue = layoutContext.getValue(key);
    if (rawValue instanceof CSSValueList == false)
    {
      return;
    }
    final ArrayList quotes = new ArrayList();
    final CSSValueList list = (CSSValueList) rawValue;
    final int length = (list.getLength() % 2);
    for (int i = 0; i < length; i++)
    {
      final CSSValue openValue = list.getItem(i * 2);
      final CSSValue closeValue = list.getItem(i * 2 + 1);

      if (openValue instanceof CSSStringValue == false)
      {
        continue;
      }
View Full Code Here


   * @param unit
   * @return
   */
  public Map createValues(LexicalUnit unit)
  {
    final CSSValue width = widthReadHandler.parseWidth(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

   */
  public void resolve(final LayoutProcess process,
                      final LayoutElement currentNode,
                      final StyleKey key)
  {
    final CSSValue value = currentNode.getLayoutContext().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;
    }
    final BackgroundSpecification backgroundSpecification =
            currentNode.getLayoutContext().getBackgroundSpecification();

    for (int i = 0; i < length; i++)
    {
      final CSSValue item = list.getItem(i);

      if (item instanceof CSSValuePair == false)
      {
        backgroundSpecification.setBackgroundRepeat
                (i, EMPTY_BACKGROUND_REPEAT);
View Full Code Here

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

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

   */
  public void resolve (final LayoutProcess process,
                       final LayoutElement element,
                       final StyleKey key)
  {
    final CSSValue value = element.getLayoutContext().getValue(key);
    if (value instanceof CSSValueList == false)
    {
      return; // do nothing.
    }

    final CSSValueList valueList = (CSSValueList) value;
    for (int i = 0; i < valueList.getLength(); i++)
    {
      final CSSValue item = valueList.getItem(i);
      if (item instanceof CSSValuePair == false)
      {
        continue;
      }
      final CSSValuePair counter = (CSSValuePair) item;
      final CSSValue counterName = counter.getFirstValue();
      if (counterName instanceof CSSConstant == false)
      {
        continue;
      }

      final CSSValue counterValue = counter.getSecondValue();
      final int counterIntValue = parseCounterValue(counterValue, element);
      element.incrementCounter(counterName.getCSSText(), counterIntValue);
    }
  }
View Full Code Here

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

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

    final 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;
      }
    }

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

View Full Code Here

  public void resolve (final LayoutProcess process,
                       final LayoutElement element,
                       final StyleKey key)
  {
    final LayoutContext layoutContext = element.getLayoutContext();
    final CSSValue value = layoutContext.getValue(key);
    if (value instanceof CSSValueList == false)
    {
      return; // do nothing.
    }

    final CSSValueList valueList = (CSSValueList) value;
    for (int i = 0; i < valueList.getLength(); i++)
    {
      final CSSValue item = valueList.getItem(i);
      if (item instanceof CSSConstant == false)
      {
        continue;
      }
      element.setString
              (item.getCSSText(), element.getString(item.getCSSText()), true);
    }
  }
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

                       final StyleKey key)
  {
    final LayoutContext layoutContext = currentNode.getLayoutContext();
    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 LayoutProcess process,
                      final LayoutElement currentNode,
                      final StyleKey key)
  {
    final LayoutContext layoutContext = currentNode.getLayoutContext();
    final CSSValue value = layoutContext.getValue(key);
    if (value instanceof CSSStringValue)
    {
      // this is a sub-string alignment.
      return;
    }
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.