Package org.jfree.layouting.input.style

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


    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


   * A datasource is assigned with this element is set to a default source,
   * which always returns null.
   */
  protected Element()
  {
    this.style = new CSSStyleRule(null, null);
    this.attributes = new AttributeMap();
    this.enabled = true;
    setNamespace(JFreeReportInfo.REPORT_NAMESPACE);
  }
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

        final InputSource source = new InputSource();
        source.setCharacterStream(new StringReader(selector));

        handler.initParseContext(source);
        handler.setStyleRule(new CSSStyleRule(null, null));
        parser.setDocumentHandler(handler);

        final SelectorList selectorList = parser.parseSelectors(source);
        CSSParserContext.getContext().destroy();
        return selectorList;
View Full Code Here

        final InputSource source = new InputSource();
        source.setCharacterStream(new StringReader(value));

        handler.initParseContext(source);
        handler.setStyleRule(new CSSStyleRule(null, null));
        parser.setDocumentHandler(handler);
        final LexicalUnit lu = parser.parsePropertyValue(source);
        handler.property(key.getName(), lu, false);
        final CSSStyleRule rule = (CSSStyleRule) handler.getStyleRule();

        CSSParserContext.getContext().destroy();

        return rule.getPropertyCSSValue(key);
      }
    }
    catch (Exception e)
    {
      e.printStackTrace();
View Full Code Here

                                  final String value,
                                  final ResourceManager resourceManager,
                                  final ResourceKey baseURL)
  {
    return parseStyles(namespaces, name, value, resourceManager,
        baseURL, new CSSStyleRule(null, null));
  }
View Full Code Here

        handler.initParseContext(source);
        handler.setStyleRule(baseRule);
        parser.setDocumentHandler(handler);
        final LexicalUnit lu = parser.parsePropertyValue(source);
        handler.property(name, lu, false);
        final CSSStyleRule rule = (CSSStyleRule) handler.getStyleRule();

        CSSParserContext.getContext().destroy();
        return rule;
      }
    }
View Full Code Here

      final InputSource inputSource = new InputSource();
      inputSource.setByteStream(data.getResourceAsStream(manager));

      handler.initParseContext(inputSource);
      handler.setStyleRule(new CSSStyleRule(null, null));
      parser.parseStyleDeclaration(inputSource);

      final DependencyCollector dependencies = handler.getDependencies();
      if (context != null)
      {
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

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

    styleRules.clear();
    for (int i = 0; i < activeStyleRules.length; i++)
    {
      CSSStyleRule activeStyleRule = activeStyleRules[i];
      if (isPseudoElementRule(activeStyleRule) == false)
      {
        continue;
      }
      styleRules.add(activeStyleRule);
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.