• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Term类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: push

import cz.vutbr.web.css.Term; //导入依赖的package包/类
public NodeData push(Declaration d) {
	
	Map<String,CSSProperty> properties = 
		new HashMap<String,CSSProperty>(COMMON_DECLARATION_SIZE);
	Map<String,Term<?>> terms = 
		new HashMap<String, Term<?>>(COMMON_DECLARATION_SIZE);
	
	boolean result = transformer.parseDeclaration(d, properties, terms);
	
	// in case of false do not insert anything
	if(!result) return this;
	
	for(String key: properties.keySet()) {
		Quadruple q = map.get(key);
		if(q==null) q = new Quadruple();
		q.curProp = properties.get(key);
		q.curValue = terms.get(key);
		// remove operator
		if(q.curValue!=null) q.curValue = q.curValue.setOperator(null);
		map.put(key, q);
	}
	return this;

}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:25,代码来源:SingleMapNodeData.java


示例2: concretize

import cz.vutbr.web.css.Term; //导入依赖的package包/类
public NodeData concretize() {
	
	for(String key: map.keySet()) {
		Quadruple q = map.get(key);
		// replace inherited with defaults
		if(q.inhProp!=null && q.inhProp.equalsInherit()) {
			q.inhProp = css.getDefaultProperty(key);
			Term<?> value = css.getDefaultValue(key);
			if(value!=null) q.inhValue = value;
		}
		
		// replace current with inherited or defaults
		if(q.curProp!=null && q.curProp.equalsInherit()) {
			if(q.inhProp==null) q.curProp = css.getDefaultProperty(key);
			else q.curProp = q.inhProp;
			
			if(q.inhValue==null) q.curValue = css.getDefaultValue(key);
			else q.curValue = q.inhValue;
		}
		map.put(key, q);
	}
	return this;
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:24,代码来源:SingleMapNodeData.java


示例3: genericTermLength

import cz.vutbr.web.css.Term; //导入依赖的package包/类
/**
 * Converts term into TermLength and stores values and types in maps
 * 
 * @param <T>
 *            CSSProperty
 * @param term
 *            Term to be parsed
 * @param propertyName
 *            How to store colorIdentificiton
 * @param lengthIdentification
 *            What to store under propertyName
 * @param properties
 *            Map to store property types
 * @param values
 *            Map to store property values
 * @return <code>true</code> in case of success, <code>false</code>
 *         otherwise
 */
protected <T extends CSSProperty> boolean genericTermLength(Term<?> term,
		String propertyName, T lengthIdentification, boolean sanify,
		Map<String, CSSProperty> properties, Map<String, Term<?>> values) {

       if (term instanceof TermInteger  && ((TermInteger) term).getUnit().equals(TermNumber.Unit.none)) {
           if (CSSFactory.getImplyPixelLength() || ((TermInteger) term).getValue() == 0) { //0 is always allowed with no units
               // convert to length with units of px
               TermLength tl = tf.createLength(((TermInteger) term).getValue(), TermNumber.Unit.px);
               return genericTerm(TermLength.class, tl, propertyName, lengthIdentification, sanify, properties, values);
           } else {
               return false;
           }
       }
       else if (term instanceof TermLength) { 
           return genericTerm(TermLength.class, term, propertyName, lengthIdentification, sanify, properties, values); 
       }

       return false;

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


示例4: push

import cz.vutbr.web.css.Term; //导入依赖的package包/类
public NodeData push(Declaration d) {
	
	Map<String,CSSProperty> properties = 
		new HashMap<String,CSSProperty>(COMMON_DECLARATION_SIZE);
	Map<String,Term<?>> terms = 
		new HashMap<String, Term<?>>(COMMON_DECLARATION_SIZE);
	
	boolean result = transformer.parseDeclaration(d, properties, terms);
	
	// in case of false do not insert anything
	if(!result) return this;
	
	this.propertiesOwn.putAll(properties);
	
	// remove operators from terms
	for(Entry<String,Term<?>> entry: terms.entrySet()) {
		entry.getValue().setOperator(null);
		valuesOwn.put(entry.getKey(), entry.getValue());
	}
	
	return this;
	
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:24,代码来源:QuadrupleMapNodeData.java


示例5: processQuotes

import cz.vutbr.web.css.Term; //导入依赖的package包/类
@SuppressWarnings("unused")
private boolean processQuotes(Declaration d,
		Map<String, CSSProperty> properties, Map<String, Term<?>> values) {

	if (d.size() == 1
			&& genericTermIdent(Quotes.class, d.get(0), ALLOW_INH,
					"quotes", properties)) {
		return true;
	} else {
		TermList list = tf.createList();
		for (Term<?> term : d.asList()) {
			if (term instanceof TermString)
				list.add(term);
			else
				return false;
		}

		// there are pairs of quotes
		if (!list.isEmpty() && list.size() % 2 == 0) {
			properties.put("quotes", Quotes.list_values);
			values.put("quotes", list);
			return true;
		}
		return false;
	}
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:27,代码来源:DeclarationTransformer.java


示例6: getFloatValue

import cz.vutbr.web.css.Term; //导入依赖的package包/类
private static float getFloatValue(Term<?> term)
{
    if (term instanceof TermNumber)
        return ((TermNumber) term).getValue().floatValue();
    else if (term instanceof TermInteger)
        return ((TermInteger) term).getValue().floatValue();
    else
        return 0;
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:10,代码来源:TermColorImpl.java


示例7: getValue

import cz.vutbr.web.css.Term; //导入依赖的package包/类
public Term<?> getValue(String name, boolean includeInherited) {
    
    Term<?> inherited = null;
    
    if(includeInherited) 
        inherited = valuesInh.get(name);

    Term<?> own = valuesOwn.get(name);
    if(own==null) return inherited;
    return own;
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:12,代码来源:QuadrupleMapNodeData.java


示例8: operation

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

	return genericTermIdent(BorderStyle.class, terms.get(i), AVOID_INH,
			names.get(i), properties);
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:8,代码来源:DeclarationTransformer.java


示例9: getValue

import cz.vutbr.web.css.Term; //导入依赖的package包/类
public Term<?> getValue(String name, boolean includeInherited) {
    
    Quadruple q = map.get(name);
    if(q==null) return null;
    
    if(includeInherited) {
        if(q.curValue!=null) return q.curValue;
        return q.inhValue;
    }
    
    return q.curValue;
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:13,代码来源:SingleMapNodeData.java


示例10: variant

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

	// we won't use multivalue functionallity
	int i = iteration.get();

	switch (v) {
	case COLOR:
		// process color
		return genericTermIdent(types.get(COLOR), terms.get(i),
				AVOID_INH, names.get(COLOR), properties)
				|| genericTermColor(terms.get(i), names.get(COLOR),
						OutlineColor.color, properties, values);
	case STYLE:
		// process style
		return genericTermIdent(types.get(STYLE), terms.get(i),
				AVOID_INH, names.get(STYLE), properties);
	case WIDTH:
		// process width
		return genericTermIdent(types.get(WIDTH), terms.get(i),
				AVOID_INH, names.get(WIDTH), properties)
				|| genericTermLength(terms.get(i), names
						.get(WIDTH), OutlineWidth.length, true,
						properties, values);
	default:
		return false;
	}
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:30,代码来源:DeclarationTransformer.java


示例11: processOutlineWidth

import cz.vutbr.web.css.Term; //导入依赖的package包/类
@SuppressWarnings("unused")
private boolean processOutlineWidth(Declaration d,
		Map<String, CSSProperty> properties, Map<String, Term<?>> values) {
	final Variator outline = new OutlineVariator();
	return outline.tryOneTermVariant(OutlineVariator.WIDTH, d, properties,
			values);
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:8,代码来源:DeclarationTransformer.java


示例12: genericTermIdent

import cz.vutbr.web.css.Term; //导入依赖的package包/类
/**
 * Converts TermIdent into value of CSSProperty for given class
 * 
 */
protected <T extends CSSProperty> boolean genericTermIdent(Class<T> type,
		Term<?> term, boolean avoidInherit, String propertyName,
		Map<String, CSSProperty> properties) {

	if (term instanceof TermIdent) {
		return genericProperty(type, (TermIdent) term, avoidInherit,
				properties, propertyName);
	}
	return false;
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:15,代码来源:DeclarationTransformer.java


示例13: stripSlash

import cz.vutbr.web.css.Term; //导入依赖的package包/类
private Term<?> stripSlash(Term<?> src)
{
    if (src.getOperator() == Operator.SLASH)
    {
        if (src instanceof TermLength)
            return tf.createLength((Float) src.getValue(), ((TermLength) src).getUnit());
        else if (src instanceof TermPercent)
            return tf.createPercent((Float) src.getValue());
        else
            return src;
    }
    else
        return src;
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:15,代码来源:DeclarationTransformer.java


示例14: genericOneIdentOrInteger

import cz.vutbr.web.css.Term; //导入依赖的package包/类
protected <T extends CSSProperty> boolean genericOneIdentOrInteger(
		Class<T> type, T integerIdentification, boolean sanify,
		Declaration d, Map<String, CSSProperty> properties,
		Map<String, Term<?>> values) {

	if (d.size() != 1)
		return false;

	return genericTermIdent(type, d.get(0), ALLOW_INH, d.getProperty(),
			properties)
			|| genericTerm(TermInteger.class, d.get(0), d.getProperty(),
					integerIdentification, sanify, properties, values);
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:14,代码来源:DeclarationTransformer.java


示例15: genericOneIdentOrIntegerOrNumber

import cz.vutbr.web.css.Term; //导入依赖的package包/类
protected <T extends CSSProperty> boolean genericOneIdentOrIntegerOrNumber(
        Class<T> type, T integerIdentification, T numberIdentification, boolean sanify,
        Declaration d, Map<String, CSSProperty> properties,
        Map<String, Term<?>> values) {

    if (d.size() != 1)
        return false;

    return genericTermIdent(type, d.get(0), ALLOW_INH, d.getProperty(), properties)
            || genericTerm(TermInteger.class, d.get(0), d.getProperty(),
                    integerIdentification, sanify, properties, values)
            || genericTerm(TermNumber.class, d.get(0), d.getProperty(),
                    numberIdentification, sanify, properties, values);
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:15,代码来源:DeclarationTransformer.java


示例16: genericOneIdentOrLength

import cz.vutbr.web.css.Term; //导入依赖的package包/类
protected <T extends CSSProperty> boolean genericOneIdentOrLength(
		Class<T> type, T lengthIdentification, boolean sanify,
		Declaration d, Map<String, CSSProperty> properties,
		Map<String, Term<?>> values) {

	if (d.size() != 1)
		return false;

	return genericTermIdent(type, d.get(0), ALLOW_INH, d.getProperty(),
			properties)
			|| genericTermLength(d.get(0), d.getProperty(),
					lengthIdentification, sanify, properties, values);
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:14,代码来源:DeclarationTransformer.java


示例17: genericOneIdentOrLengthOrPercent

import cz.vutbr.web.css.Term; //导入依赖的package包/类
protected <T extends Enum<T> & CSSProperty> boolean genericOneIdentOrLengthOrPercent(
		Class<T> type, T lengthIdentification, T percentIdentification,
		boolean sanify, Declaration d, Map<String, CSSProperty> properties,
		Map<String, Term<?>> values) {

	if (d.size() != 1)
		return false;

	return genericTermIdent(type, d.get(0), ALLOW_INH, d.getProperty(),
			properties)
			|| genericTermLength(d.get(0), d.getProperty(),
					lengthIdentification, sanify, properties, values)
			|| genericTerm(TermPercent.class, d.get(0), d.getProperty(),
					percentIdentification, sanify, properties, values);
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:16,代码来源:DeclarationTransformer.java


示例18: processBackground

import cz.vutbr.web.css.Term; //导入依赖的package包/类
@SuppressWarnings("unused")
private boolean processBackground(Declaration d,
		Map<String, CSSProperty> properties, Map<String, Term<?>> values) {
	Variator background = new BackgroundVariator();
	background.assignTermsFromDeclaration(d);
	background.assignDefaults(properties, values);
	return background.vary(properties, values);
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:9,代码来源:DeclarationTransformer.java


示例19: processBackgroundAttachement

import cz.vutbr.web.css.Term; //导入依赖的package包/类
@SuppressWarnings("unused")
private boolean processBackgroundAttachement(Declaration d,
		Map<String, CSSProperty> properties, Map<String, Term<?>> values) {
	final Variator background = new BackgroundVariator();
	return background.tryOneTermVariant(BackgroundVariator.ATTACHEMENT, d,
			properties, values);
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:8,代码来源:DeclarationTransformer.java


示例20: processBackgroundColor

import cz.vutbr.web.css.Term; //导入依赖的package包/类
@SuppressWarnings("unused")
private boolean processBackgroundColor(Declaration d,
		Map<String, CSSProperty> properties, Map<String, Term<?>> values) {
	final Variator background = new BackgroundVariator();
	return background.tryOneTermVariant(BackgroundVariator.COLOR, d,
			properties, values);
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:8,代码来源:DeclarationTransformer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ReflectionEquals类代码示例发布时间:2022-05-23
下一篇:
Java StringValue类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap