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


Java BackgroundImage类代码示例

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


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

示例1: BackgroundVariator

import cz.vutbr.web.css.CSSProperty.BackgroundImage; //导入依赖的package包/类
public BackgroundVariator() {
	super(5);
	names.add("background-color");
	types.add(BackgroundColor.class);
	names.add("background-image");
	types.add(BackgroundImage.class);
	names.add("background-repeat");
	types.add(BackgroundRepeat.class);
	names.add("background-attachement");
	types.add(BackgroundAttachment.class);
	names.add("background-position");
	types.add(BackgroundPosition.class);
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:14,代码来源:DeclarationTransformer.java

示例2: BackgroundVariator

import cz.vutbr.web.css.CSSProperty.BackgroundImage; //导入依赖的package包/类
public BackgroundVariator() {
	super(5);
	names.add("background-color");
	types.add(BackgroundColor.class);
	names.add("background-image");
	types.add(BackgroundImage.class);
	names.add("background-repeat");
	types.add(BackgroundRepeat.class);
	names.add("background-attachment");
	types.add(BackgroundAttachment.class);
	names.add("background-position");
	types.add(BackgroundPosition.class);
}
 
开发者ID:chrimm,项目名称:cordovastudio,代码行数:14,代码来源:DeclarationTransformer.java

示例3: BackgroundVariator

import cz.vutbr.web.css.CSSProperty.BackgroundImage; //导入依赖的package包/类
public BackgroundVariator() {
	super(6);
	names.add("background-color");
	types.add(BackgroundColor.class);
	names.add("background-image");
	types.add(BackgroundImage.class);
	names.add("background-repeat");
	types.add(BackgroundRepeat.class);
	names.add("background-attachment");
	types.add(BackgroundAttachment.class);
	names.add("background-position");
	types.add(BackgroundPosition.class);
	names.add("background-size");
	types.add(BackgroundSize.class);
}
 
开发者ID:radkovo,项目名称:jStyleParser,代码行数:16,代码来源:DeclarationTransformerImpl.java

示例4: variant

import cz.vutbr.web.css.CSSProperty.BackgroundImage; //导入依赖的package包/类
@Override
protected boolean variant(int v, IntegerRef iteration,
		Map<String, CSSProperty> properties, Map<String, Term<?>> values) {

	// we will use multi value functionality in
	// POSITION branch
	int i = iteration.get();

	switch (v) {
	case COLOR:
		return genericTermIdent(types.get(COLOR), terms.get(i),
				AVOID_INH, names.get(COLOR), properties)
				|| genericTermColor(terms.get(i), names.get(COLOR),
						BackgroundColor.color, properties, values);
	case IMAGE:
		return genericTermIdent(types.get(IMAGE), terms.get(i),
				AVOID_INH, names.get(IMAGE), properties)
				|| genericTerm(TermURI.class, terms.get(i), names
						.get(IMAGE), BackgroundImage.uri, false,
						properties, values);
	case REPEAT:
		return genericTermIdent(types.get(REPEAT), terms.get(i),
				AVOID_INH, names.get(REPEAT), properties);
	case ATTACHEMENT:
		return genericTermIdent(types.get(ATTACHEMENT), terms.get(i),
				AVOID_INH, names.get(ATTACHEMENT), properties);
	case POSITION:

		final EnumSet<BackgroundPosition> allowedBackground = EnumSet
				.complementOf(EnumSet.of(
						BackgroundPosition.list_values,
						BackgroundPosition.INHERIT));

		// try this and next term, but consider terms size
		BackgroundPosition bp = null;
		Term<?>[] vv = {null, null}; //horizontal and vertical position
		for (; (i <= i + 1) && (i < terms.size()); i++) {
			Term<?> term = terms.get(i);
			if (term instanceof TermIdent) {
				bp = genericPropertyRaw(BackgroundPosition.class,
						allowedBackground, (TermIdent) term);
				if (bp != null)
					storeBackgroundPosition(vv, bp, term);
			} else if (term instanceof TermPercent) {
				storeBackgroundPosition(vv, null, term);
			} else if (term instanceof TermLength)
				storeBackgroundPosition(vv, null, term);
		}

		//create term list from the values, replace unspecified values by center
		TermList list = tf.createList(2);
              for (int j = 0; j < 2; j++)
                  if (vv[j] == null)
                      list.add(tf.createPercent(50.0f));
                  else
                      list.add(vv[j]);
              
		if (list.isEmpty())
			return false;
		// copy element if only one present
		else if (list.size() == 1)
			list.add(1, list.get(0));
		// if used two elements, inform master
		else if (list.size() == 2)
			iteration.inc();

		// store list
		properties.put(names.get(POSITION),
				BackgroundPosition.list_values);
		values.put(names.get(POSITION), list);
		return true;

	default:
		return false;
	}
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:77,代码来源:DeclarationTransformer.java

示例5: variant

import cz.vutbr.web.css.CSSProperty.BackgroundImage; //导入依赖的package包/类
@Override
protected boolean variant(int v, IntegerRef iteration,
		Map<String, CSSProperty> properties, Map<String, Term<?>> values) {

	// we will use multi value functionality in
	// POSITION branch
	int i = iteration.get();

	switch (v) {
	case COLOR:
		return genericTermIdent(types.get(COLOR), terms.get(i),
				AVOID_INH, names.get(COLOR), properties)
				|| genericTermColor(terms.get(i), names.get(COLOR),
						BackgroundColor.color, properties, values);
	case IMAGE:
		return genericTermIdent(types.get(IMAGE), terms.get(i),
				AVOID_INH, names.get(IMAGE), properties)
				|| genericTerm(TermURI.class, terms.get(i), names
						.get(IMAGE), BackgroundImage.uri, false,
						properties, values);
	case REPEAT:
		return genericTermIdent(types.get(REPEAT), terms.get(i),
				AVOID_INH, names.get(REPEAT), properties);
	case ATTACHMENT:
		return genericTermIdent(types.get(ATTACHMENT), terms.get(i),
				AVOID_INH, names.get(ATTACHMENT), properties);
	case POSITION:

		final EnumSet<BackgroundPosition> allowedBackground = EnumSet
				.complementOf(EnumSet.of(
						BackgroundPosition.list_values,
						BackgroundPosition.INHERIT));

		// try this and next term, but consider terms size
		BackgroundPosition bp = null;
		Term<?>[] vv = {null, null}; //horizontal and vertical position
		for (; (i <= i + 1) && (i < terms.size()); i++) {
			Term<?> term = terms.get(i);
			if (term instanceof TermIdent) {
				bp = genericPropertyRaw(BackgroundPosition.class,
						allowedBackground, (TermIdent) term);
				if (bp != null)
					storeBackgroundPosition(vv, bp, term);
			} else if (term instanceof TermPercent) {
				storeBackgroundPosition(vv, null, term);
			} else if (term instanceof TermLength)
				storeBackgroundPosition(vv, null, term);
		}

		//create term list from the values, replace unspecified values by center
		TermList list = tf.createList(2);
              for (int j = 0; j < 2; j++)
                  if (vv[j] == null)
                      list.add(tf.createPercent(50.0f));
                  else
                      list.add(vv[j]);
              
		if (list.isEmpty())
			return false;
		// copy element if only one present
		else if (list.size() == 1)
			list.add(1, list.get(0));
		// if used two elements, inform master
		else if (list.size() == 2)
			iteration.inc();

		// store list
		properties.put(names.get(POSITION),
				BackgroundPosition.list_values);
		values.put(names.get(POSITION), list);
		return true;

	default:
		return false;
	}
}
 
开发者ID:chrimm,项目名称:cordovastudio,代码行数:77,代码来源:DeclarationTransformer.java


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