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

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


      final boolean[] importantFlags = cssValues.getImportantValues();
      final CSSValue[] values = cssValues.getStyleValues();
      final StyleKey[] keys = cssValues.getPropertyKeysAsArray();
      for (int i = 0; i < values.length; i++)
      {
        final CSSValue cssValue = values[i];
        if (cssValue != null)
        {
          setPropertyValue(keys[i], cssValue, importantFlags[i]);
        }
      }
View Full Code Here


  }

  public static PageFormat getPageFormat(final CSSPageRule rule)
  {
    // This does not take any inheritance into account.
    final CSSValue sizeValue = rule.getPropertyCSSValue(PageStyleKeys.SIZE);
    if (sizeValue instanceof CSSValuePair == false)
    {
      // not a valid thing ..
      return null;
    }
    final CSSValuePair sizePair = (CSSValuePair) sizeValue;
    final CSSValue firstValue = sizePair.getFirstValue();
    final CSSValue secondValue = sizePair.getSecondValue();
    final double width = CSSValueResolverUtility.convertLengthToDouble(firstValue);
    final double height = CSSValueResolverUtility.convertLengthToDouble(secondValue);
    if (width == 0 || height == 0)
    {
      return null;
View Full Code Here

    return ((integerValue % 360) + 360) % 360;
  }

  public static CSSValue parseColor(String colorSpec)
  {
    final CSSValue color = parseIdentColor(colorSpec);
    if (color != null)
    {
      return color;
    }
    try
View Full Code Here

      flowContexts.push(fc);
      fc.addElement(MODEL_BLOCK_INSIDE, FLAG_AUTOGENERATED | TYPE_FLOW, layoutContext);
      contentGenerator.startedFlow(layoutContext);
    }

    final CSSValue displayRole = layoutContext.getValue(BoxStyleKeys.DISPLAY_ROLE);
    if (displayRole == DisplayRole.NONE || suspendCounter > 0)
    {
      // do something with that.
      suspendCounter += 1;
      contentGenerator.startedPassThrough(layoutContext);
View Full Code Here

  private void addToBlockLevelBox(final LayoutContext context)
      throws NormalizationException
  {
    final FlowContext fc = (FlowContext) flowContexts.peek();
    final CSSValue displayRole = context.getValue(BoxStyleKeys.DISPLAY_ROLE);
    if (DisplayRole.INLINE.equals(displayRole))
    {
      // special treatment for a inline box that is added to a block-parent
      // Generate the paragraph box ..
      if (reactivateSuspendedInlines(fc) == false)
      {
        // todo: check for possibly suspended inlines and reactivate them

        final StyleResolver styleResolver = layoutProcess.getStyleResolver();
        final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);
        final LayoutContext paragraphContext =
            styleResolver.createAnonymousContext(id, context);
        fc.addElement(MODEL_INLINE_INSIDE, FLAG_AUTOGENERATED | TYPE_PARAGRAPH, paragraphContext);
        contentGenerator.startedRootInline(paragraphContext);
      }

      // now add the element ..
      final CSSValue displayModel = context.getValue(BoxStyleKeys.DISPLAY_MODEL);
      if (DisplayModel.TABLE.equals(displayModel))
      {
        fc.addElement(MODEL_TABLE, TYPE_INLINE, context);
        contentGenerator.startedTable(context);
      }
      else if (DisplayModel.INLINE_INSIDE.equals(displayModel))
      {
        fc.addElement(MODEL_INLINE_INSIDE, TYPE_INLINE, context);
        contentGenerator.startedInline(context);
      }
      else
      {
        fc.addElement(MODEL_BLOCK_INSIDE, TYPE_BLOCK, context);
        contentGenerator.startedBlock(context);
      }
      return;
    }

    // Todo: need to check for run-in and compact as well..
    // Everything else is considered a block-level element and treated as such..
    final CSSValue displayModel = context.getValue(BoxStyleKeys.DISPLAY_MODEL);
    if (DisplayModel.TABLE.equals(displayModel))
    {
      fc.addElement(MODEL_TABLE, TYPE_TABLE, context);
      contentGenerator.startedTable(context);
    }
View Full Code Here

  private void addToInlineLevelBox(final LayoutContext context)
      throws NormalizationException
  {
    final FlowContext fc = (FlowContext) flowContexts.peek();
    final CSSValue displayRole = context.getValue(BoxStyleKeys.DISPLAY_ROLE);
    if (DisplayRole.INLINE.equals(displayRole))
    {
      // The current linebox is suspended and the boxes are added as if they
      // were direct childs of the current block-context.
      // now add the element ..
      final CSSValue displayModel = context.getValue(BoxStyleKeys.DISPLAY_MODEL);
      if (DisplayModel.TABLE.equals(displayModel))
      {
        fc.addElement(MODEL_TABLE, TYPE_TABLE, context);
        contentGenerator.startedTable(context);
      }
View Full Code Here

    }

    final int length = rawstyle.values.length;
    for (int i = 0; i < length; i++)
    {
      final CSSValue o = rawstyle.values[i];
      if (o != null)
      {
        values[i] = o;
      }
    }
View Full Code Here

      final StyleKey[] propertyKeys = rule.getPropertyKeysAsArray();
      final CSSValue[] values = new CSSValue[propertyKeys.length];
      for (int i = 0; i < values.length; i++)
      {
        final StyleKey key = propertyKeys[i];
        final CSSValue value = rule.getPropertyCSSValue(key);
        if (value == null)
        {
          continue;
        }
        if (ContentStyleKeys.CONTENT.equals(key) ||
View Full Code Here

      final CSSValueList list = (CSSValueList) value;
      final ArrayList retValus = new ArrayList();
      final int length = list.getLength();
      for (int i = 0; i < length; i++)
      {
        final CSSValue item = list.getItem(i);
        retValus.add(resolveValue(item, element));
      }
      return new CSSValueList(retValus);
    }
    else if (value instanceof CSSValuePair)
View Full Code Here

    {
      final CSSValueList list = (CSSValueList) value;
      final int length = list.getLength();
      for (int i = 0; i < length; i++)
      {
        final CSSValue item = list.getItem(i);
        if (containsAttrFunction(item))
        {
          return true;
        }
      }
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.