Package org.jfree.layouting.input.style

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


    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(LayoutElement element, 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

  public CSSStyleRule[] getMatchingRules(LayoutElement element)
  {
    final ArrayList retvals = new ArrayList();
    for (int i = 0; i < activeStyleRules.length; i++)
    {
      final CSSStyleRule activeStyleRule = activeStyleRules[i];
      final CSSSelector selector = activeStyleRule.getSelector();
      if (selector == null)
      {
        continue;
      }
View Full Code Here

   *                      exception.
   */
  public void startSelector(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

    // 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

      {
        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

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.