当前位置: 首页>>代码示例>>Java>>正文


Java Traversal类代码示例

本文整理汇总了Java中cz.vutbr.web.domassign.Traversal的典型用法代码示例。如果您正苦于以下问题:Java Traversal类的具体用法?Java Traversal怎么用?Java Traversal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Traversal类属于cz.vutbr.web.domassign包,在下文中一共展示了Traversal类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: assignDOM

import cz.vutbr.web.domassign.Traversal; //导入依赖的package包/类
/**
 * Goes through a DOM tree and assigns the CSS declarations to the DOM elements.
 * The following style specifications are evaluated:
 * <ul>
 * <li>The style sheets included using the <code>link</code> and <code>style</code> tags.
 * <li>Inline styles specified using the <code>style</code> element attribute.
 * <li><strong>Proprietary extension:</strong> Default styles defined using the <code>XDefaultStyle</code>
 *     element attribute. These styles behave the same way as the inline styles but they have the lowest priority
 *     (the values are used only when not redefined by any other way)
 *  </ul>   
 * 
 * @param doc
 *            DOM tree
    * @param encoding
    *            The default encoding used for the referenced style sheets
 * @param base
 *            Base URL against which all files are searched
 * @param media
 *            Selected media for style sheet
 * @param useInheritance
 *            Whether inheritance will be used to determine values
 * @return Map between DOM element nodes and data structure containing CSS
 *         information
 */
public static final StyleMap assignDOM(Document doc, String encoding,
		URL base, String media, boolean useInheritance) {

	Pair pair = new Pair(base, media);

	Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding,
			(Object) pair, NodeFilter.SHOW_ELEMENT);

	StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet()
			.unlock();
	traversal.listTraversal(style);

	Analyzer analyzer = new Analyzer(style);
	return analyzer.evaluateDOM(doc, media, useInheritance);
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:40,代码来源:CSSFactory.java

示例2: assignDOM

import cz.vutbr.web.domassign.Traversal; //导入依赖的package包/类
/**
 * This is the same as {@link CSSFactory#assignDOM(Document, String, URL, MediaSpec, boolean)} 
 * with the possibility of specifying a custom network processor for obtaining data from URL
 * resources.
 * 
 * @param doc
 *            DOM tree
 * @param encoding
 *            The default encoding used for the referenced style sheets
 * @param network
 *            Custom network processor
 * @param base
 *            Base URL against which all files are searched
 * @param media
 *            Current media specification used for evaluating the media queries
 * @param useInheritance
 *            Whether inheritance will be used to determine values
 * @param matchCond
 *            The match condition to match the against.
 * @return Map between DOM element nodes and data structure containing CSS
 *         information
 */ 
public static final StyleMap assignDOM(Document doc, String encoding, NetworkProcessor network,
        URL base, MediaSpec media, boolean useInheritance, final MatchCondition matchCond) {

    SourceData pair = new SourceData(base, network, media);

    Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding,
            pair, NodeFilter.SHOW_ELEMENT);

    StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet()
            .unlock();
    traversal.listTraversal(style);

    Analyzer analyzer = new Analyzer(style);
    if (matchCond != null) {
        analyzer.registerMatchCondition(matchCond);
    }
    return analyzer.evaluateDOM(doc, media, useInheritance);
}
 
开发者ID:radkovo,项目名称:jStyleParser,代码行数:41,代码来源:CSSFactory.java

示例3: getUsedStyles

import cz.vutbr.web.domassign.Traversal; //导入依赖的package包/类
/**
 * Loads all the style sheets used from the specified DOM tree.
 * The following style specifications are evaluated:
 * <ul>
 * <li>The style sheets included using the <code>link</code> and <code>style</code> tags.
 * <li>Inline styles specified using the <code>style</code> element attribute.
 * <li><strong>Proprietary extension:</strong> Default styles defined using the <code>XDefaultStyle</code>
 *     element attribute. These styles behave the same way as the inline styles but they have the lowest priority
 *     (the values are used only when not redefined by any other way)
 *  </ul>   
 * 
 * @param doc
 *            DOM tree
 * @param encoding
 *            The default encoding used for the referenced style sheets
 * @param base
 *            Base URL against which all files are searched
 * @param media
 *            Selected media for style sheet
 * @return the rules of all the style sheets used in the document including the inline styles
 */
public static final StyleSheet getUsedStyles(Document doc, String encoding, URL base, String media)
{
    Pair pair = new Pair(base, media);

    Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding,
            (Object) pair, NodeFilter.SHOW_ELEMENT);

    StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet().unlock();
    traversal.listTraversal(style);
    return style;
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:33,代码来源:CSSFactory.java

示例4: getUsedStyles

import cz.vutbr.web.domassign.Traversal; //导入依赖的package包/类
/**
 * Loads all the style sheets used from the specified DOM tree.
 * The following style specifications are evaluated:
 * <ul>
 * <li>The style sheets included using the <code>link</code> and <code>style</code> tags.
 * <li>Inline styles specified using the <code>style</code> element attribute.
 * <li><strong>Proprietary extension:</strong> Default styles defined using the <code>XDefaultStyle</code>
 * element attribute. These styles behave the same way as the inline styles but they have the lowest priority
 * (the values are used only when not redefined by any other way)
 * </ul>
 *
 * @param doc      DOM tree
 * @param encoding The default encoding used for the referenced style sheets
 * @param base     Base URL against which all files are searched
 * @param media    Selected media for style sheet
 * @return the rules of all the style sheets used in the document including the inline styles
 */
public static final StyleSheet getUsedStyles(XmlDocument doc, String encoding, URL base, MediaSpec media) {
    Pair pair = new Pair(base, media);

    Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding, (Object) pair);

    StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet().unlock();
    traversal.listTraversal(style);
    return style;
}
 
开发者ID:chrimm,项目名称:cordovastudio,代码行数:27,代码来源:CSSFactory.java

示例5: assignDOM

import cz.vutbr.web.domassign.Traversal; //导入依赖的package包/类
/**
 * Goes through a DOM tree and assigns the CSS declarations to the DOM elements.
 * The following style specifications are evaluated:
 * <ul>
 * <li>The style sheets included using the <code>link</code> and <code>style</code> tags.
 * <li>Inline styles specified using the <code>style</code> element attribute.
 * <li><strong>Proprietary extension:</strong> Default styles defined using the <code>XDefaultStyle</code>
 * element attribute. These styles behave the same way as the inline styles but they have the lowest priority
 * (the values are used only when not redefined by any other way)
 * </ul>
 *
 * @param doc            DOM tree
 * @param encoding       The default encoding used for the referenced style sheets
 * @param base           Base URL against which all files are searched
 * @param media          Current media specification used for evaluating the media queries
 * @param useInheritance Whether inheritance will be used to determine values
 * @return Map between DOM element nodes and data structure containing CSS
 * information
 */
public static final StyleMap assignDOM(XmlDocument doc, String encoding,
                                       URL base, MediaSpec media, boolean useInheritance) {

    Pair pair = new Pair(base, media);

    Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding, (Object) pair);

    StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet()
            .unlock();
    traversal.listTraversal(style);

    Analyzer analyzer = new Analyzer(style);
    return analyzer.evaluateDOM(doc, media, useInheritance);
}
 
开发者ID:chrimm,项目名称:cordovastudio,代码行数:34,代码来源:CSSFactory.java

示例6: getUsedStyles

import cz.vutbr.web.domassign.Traversal; //导入依赖的package包/类
/**
 * Loads all the style sheets used from the specified DOM tree.
 * The following style specifications are evaluated:
 * <ul>
 * <li>The style sheets included using the <code>link</code> and <code>style</code> tags.
 * <li>Inline styles specified using the <code>style</code> element attribute.
 * <li><strong>Proprietary extension:</strong> Default styles defined using the <code>XDefaultStyle</code>
 *     element attribute. These styles behave the same way as the inline styles but they have the lowest priority
 *     (the values are used only when not redefined by any other way)
 *  </ul>   
 * 
 * @param doc
 *            DOM tree
 * @param encoding
 *            The default encoding used for the referenced style sheets
 * @param base
 *            Base URL against which all files are searched
 * @param media
 *            Selected media for style sheet
 * @return the rules of all the style sheets used in the document including the inline styles
 */
public static final StyleSheet getUsedStyles(Document doc, String encoding, URL base, MediaSpec media, NetworkProcessor network)
{
    SourceData pair = new SourceData(base, network, media);

    Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding,
            pair, NodeFilter.SHOW_ELEMENT);

    StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet().unlock();
    traversal.listTraversal(style);
    return style;
}
 
开发者ID:radkovo,项目名称:jStyleParser,代码行数:33,代码来源:CSSFactory.java


注:本文中的cz.vutbr.web.domassign.Traversal类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。