Package com.adobe.dp.css

Examples of com.adobe.dp.css.CSSValueList


    this.styles = styles;
  }

  private String[] parseFamily(Object family) {
    if (family instanceof CSSValueList) {
      CSSValueList list = (CSSValueList) family;
      int len = list.getSeparator() == ',' ? list.length() : 1;
      String[] result = new String[len];
      for (int i = 0; i < len; i++) {
        CSSValue v = list.getSeparator() == ',' ? list.item(i) : list;
        result[i] = v.toString();
      }
      return result;
    } else if ((family instanceof CSSQuotedString) || (family instanceof CSSName)) {
      String[] result = { family.toString() };
View Full Code Here


      SelectorRule h1Rule = stylesheet.getRuleForSelector(h1Selector,
          true);
      h1Rule.set("color", new CSSName("gray"));
      CSSValue[] border = { new CSSLength(2, "px"), new CSSName("solid"),
          new CSSName("gray") };
      h1Rule.set("border-bottom", new CSSValueList(' ', border));
      h1Rule.set("text-align", new CSSName("right"));
      CSSValue[] margin = { new CSSLength(2, "em"),
          new CSSLength(8, "px"), new CSSLength(1, "em"),
          new CSSLength(0, "px") };
      h1Rule.set("margin", new CSSValueList(' ', margin));

      // style p element
      Selector pSelector = stylesheet.getSimpleSelector("p", null);
      SelectorRule pRule = stylesheet.getRuleForSelector(pSelector, true);
      pRule.set("margin", new CSSLength(0, "px"));
View Full Code Here

      SelectorRule h1Rule = stylesheet.getRuleForSelector(h1Selector,
          true);
      h1Rule.set("color", new CSSName("gray"));
      CSSValue[] border = { new CSSLength(2, "px"), new CSSName("solid"),
          new CSSName("gray") };
      h1Rule.set("border-bottom", new CSSValueList(' ', border));
      h1Rule.set("text-align", new CSSName("right"));
      CSSValue[] margin = { new CSSLength(2, "em"),
          new CSSLength(8, "px"), new CSSLength(1, "em"),
          new CSSLength(0, "px") };
      h1Rule.set("margin", new CSSValueList(' ', margin));
      h1Rule.set("font-family", new CSSQuotedString("Adobe Garamond Pro"));

      // style p element
      Selector pSelector = stylesheet.getSimpleSelector("p", null);
      SelectorRule pRule = stylesheet.getRuleForSelector(pSelector, true);
      pRule.set("margin", new CSSLength(0, "px"));
      pRule.set("text-indent", new CSSLength(1, "em"));
      pRule.set("text-align", new CSSName("justify"));
      h1Rule.set("font-family", new CSSQuotedString("Chaparral Pro"));

      // style bitmap class (JPEG image)
      Selector bitmapSelector = stylesheet.getSimpleSelector(null,
          "bitmap");
      SelectorRule bitmapRule = stylesheet.getRuleForSelector(
          bitmapSelector, true);
      bitmapRule.set("width", new CSSLength(80, "%"));
      bitmapRule.set("max-width", new CSSLength(553, "px"));

      // style container class (container for JPEG image)
      Selector containerSelector = stylesheet.getSimpleSelector("p",
          "container");
      SelectorRule containerRule = stylesheet.getRuleForSelector(
          containerSelector, true);
      containerRule.set("text-align", new CSSName("center"));
      containerRule.set("text-indent", new CSSLength(0, "px"));
      CSSValue[] padval = { new CSSLength(0.5, "em"), new CSSLength(0, "px") };
      containerRule.set("padding", new CSSValueList(' ', padval));

      // style svgimage class (embedded SVG)
      Selector svgimageSelector = stylesheet.getSimpleSelector(null,
          "svgimage");
      SelectorRule svgimageRule = stylesheet.getRuleForSelector(svgimageSelector, true);
      svgimageRule.set("width", new CSSLength(80, "%"));
      CSSValue[] padval1 = { new CSSLength(0.5, "em"), new CSSLength(10, "%") };
      svgimageRule.set("padding", new CSSValueList(' ', padval1));

      // style label1 class (text in embedded SVG)
      Selector label1Selector = stylesheet.getSimpleSelector(null,
          "label1");
      SelectorRule label1Rule = stylesheet.getRuleForSelector(label1Selector, true);
View Full Code Here

TOP

Related Classes of com.adobe.dp.css.CSSValueList

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.