Package org.jfree.layouting.input.style

Examples of org.jfree.layouting.input.style.CSSStyleRule


    for (int i = 0; i < stylePropertyHandlers.size(); i++)
    {

      final PropertyReadHandler handler =
              (PropertyReadHandler) stylePropertyHandlers .get(i);
      final CSSStyleRule cssStyleRule = e.getStyle();
      cssStyleRule.setPropertyValueAsString(handler.getName(), handler.getResult());
    }
    for (int i = 0; i < attributeExpressionHandlers.size(); i++)
    {
      final AttributeExpressionReadHandler handler =
              (AttributeExpressionReadHandler) attributeExpressionHandlers .get(
View Full Code Here


    for (int i = 0; i < stylePropertyHandlers.size(); i++)
    {

      final PropertyReadHandler handler =
          (PropertyReadHandler) stylePropertyHandlers.get(i);
      final CSSStyleRule cssStyleRule = e.getStyle();
      cssStyleRule.setPropertyValueAsString(handler.getName(), handler.getResult());
    }
    for (int i = 0; i < attributeExpressionHandlers.size(); i++)
    {
      final AttributeExpressionReadHandler handler =
          (AttributeExpressionReadHandler) attributeExpressionHandlers.get(
View Full Code Here

      {
        targetRule = (CSSDeclarationRule) node.getStyle().clone();
      }
      catch (CloneNotSupportedException e)
      {
        targetRule = new CSSStyleRule(null, null);
      }
    }


    if (styleAttributeValue instanceof String)
    {
      // ugly, we have to parse that thing. Cant think of nothing
      // worse than that.
      final String styleText = (String) styleAttributeValue;
      try
      {
        final ReportContext reportContext = runtime.getReportContext();
        final ReportStructureRoot root = reportContext.getReportStructureRoot();
        final ResourceKey baseResource = root.getBaseResource();
        final ResourceManager resourceManager = root.getResourceManager();

        final byte[] bytes = styleText.getBytes("UTF-8");
        final ResourceKey key = resourceManager.createKey(bytes);
        final Resource resource = resourceManager.create
            (key, baseResource, StyleRule.class);

        final CSSDeclarationRule parsedRule =
            (CSSDeclarationRule) resource.getResource();
        mergeDeclarationRule(targetRule, parsedRule);
      }
      catch (Exception e)
      {
        // ignore ..
        e.printStackTrace();
      }
    }
    else if (styleAttributeValue instanceof CSSStyleRule)
    {
      final CSSStyleRule styleRule =
          (CSSStyleRule) styleAttributeValue;
      mergeDeclarationRule(targetRule, styleRule);
    }

    // ok, not lets fill in the stuff from the style expressions ..
View Full Code Here

   * @throws ClassCastException if the arguments' types prevent them from being
   *                            compared by this Comparator.
   */
  public int compare(final Object o1, final Object o2)
  {
    final CSSStyleRule r1 = (CSSStyleRule) o1;
    final CSSStyleRule r2 = (CSSStyleRule) o2;

    final CSSSelector selector1 = r1.getSelector();
    final CSSSelector selector2 = r2.getSelector();

    final SelectorWeight weight1 = selector1.getWeight();
    final SelectorWeight weight2 = selector2.getWeight();

    return weight1.compareTo(weight2);
View Full Code Here

    // sort ...
    Arrays.sort(activeStyleRules, new CSSStyleRuleComparator());
    SelectorWeight oldSelectorWeight = null;
    for (int i = 0; i < activeStyleRules.length; i++)
    {
      final CSSStyleRule activeStyleRule = activeStyleRules[i];
      final CSSSelector selector = activeStyleRule.getSelector();
      final SelectorWeight activeWeight = selector.getWeight();

      if (oldSelectorWeight != null)
      {
        if (oldSelectorWeight.compareTo(activeWeight) > 0)
View Full Code Here

   *                      exception.
   */
  public void startSelector(final SelectorList selectors)
      throws CSSException
  {
    styleRule = new CSSStyleRule(styleSheet, getParentRule());
  }
View Full Code Here

    for (int i = 0; i < length; i++)
    {
      final Selector selector = selectors.item(i);
      try
      {
        final CSSStyleRule rule = (CSSStyleRule) styleRule.clone();
        rule.setSelector((CSSSelector) selector);
        styleSheet.addRule(rule);
      }
      catch (CloneNotSupportedException e)
      {
        // should not happen
View Full Code Here

        counterRules.toArray(new CSSCounterRule[counterRules.size()]);

    styleRules.clear();
    for (int i = 0; i < activeStyleRules.length; i++)
    {
      final CSSStyleRule activeStyleRule = activeStyleRules[i];
      if (isPseudoElementRule(activeStyleRule) == false)
      {
        continue;
      }
      styleRules.add(activeStyleRule);
View Full Code Here

    for (int i = 0; i < rc; i++)
    {
      final StyleRule rule = styleSheet.getRule(i);
      if (rule instanceof CSSStyleRule)
      {
        final CSSStyleRule drule = (CSSStyleRule) rule;
        activeStyleRules.add(drule);
      }
    }
  }
View Full Code Here

  public boolean isMatchingPseudoElement(final LayoutElement element, final String pseudo)
  {
    for (int i = 0; i < activePseudoStyleRules.length; i++)
    {
      final CSSStyleRule activeStyleRule = activePseudoStyleRules[i];

      final CSSSelector selector = activeStyleRule.getSelector();
      final ConditionalSelector cs = (ConditionalSelector) selector;
      final Condition condition = cs.getCondition();

      final AttributeCondition ac = (AttributeCondition) condition;
      if (ObjectUtilities.equal(ac.getValue(), pseudo) == false)
View Full Code Here

TOP

Related Classes of org.jfree.layouting.input.style.CSSStyleRule

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.