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


Java CSSValue.CSS_INHERIT属性代码示例

本文整理汇总了Java中org.w3c.dom.css.CSSValue.CSS_INHERIT属性的典型用法代码示例。如果您正苦于以下问题:Java CSSValue.CSS_INHERIT属性的具体用法?Java CSSValue.CSS_INHERIT怎么用?Java CSSValue.CSS_INHERIT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.w3c.dom.css.CSSValue的用法示例。


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

示例1: computeValue

/**
 * Computes a CSS {@link Value} and performance inheritance if the
 * specified value is 'inherit'.
 */
protected Value computeValue(CSSStylableElement elt, String pn,
                             Value v) {
    ValueManager[] vms = cssEngine.getValueManagers();
    int idx = cssEngine.getPropertyIndex(pn);
    if (idx != -1) {
        if (v.getCssValueType() == CSSValue.CSS_INHERIT) {
            elt = CSSEngine.getParentCSSStylableElement(elt);
            if (elt != null) {
                return cssEngine.getComputedStyle(elt, null, idx);
            }
            return vms[idx].getDefaultValue();
        }
        v = vms[idx].computeValue(elt, null, cssEngine, idx,
                                  dummyStyleMap, v);
    }
    return v;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:21,代码来源:SVGAnimationEngine.java

示例2: buildDeclarations

@Override
public List buildDeclarations(CSSName cssName, List values, int origin, boolean important,
		boolean inheritAllowed) {
	checkValueCount(cssName, 1, values.size());
	CSSPrimitiveValue value = (CSSPrimitiveValue) values.get(0);
	checkInheritAllowed(value, inheritAllowed);
	if (value.getCssValueType() != CSSValue.CSS_INHERIT) {
		checkIdentOrURIType(cssName, value);

		if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
			IdentValue ident = checkIdent(cssName, value);
			checkValidity(cssName, ALLOWED, ident);
		}
	}
	return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:16,代码来源:GenericURIWithNone.java

示例3: buildDeclarations

@Override
public List buildDeclarations(
           CSSName cssName, List values, int origin, boolean important, boolean inheritAllowed) {
       checkValueCount(cssName, 1, values.size());
       PropertyValue value = (PropertyValue)values.get(0);
       checkInheritAllowed(value, inheritAllowed);
       if (value.getCssValueType() != CSSValue.CSS_INHERIT) {
           checkIdentLengthOrPercentType(cssName, value);

           if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
               IdentValue ident = checkIdent(cssName, value);
               checkValidity(cssName, getAllowed(), ident);
           } else if (! isNegativeValuesAllowed() && value.getFloatValue() < 0.0f) {
               throw new CSSParseException(cssName + " may not be negative", -1);
           }
       }

       return Collections.singletonList(
               new PropertyDeclaration(cssName, value, important, origin));

   }
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:21,代码来源:LengthLikeWithIdent.java

示例4: buildDeclarations

@Override
public List buildDeclarations(CSSName cssName, List values, int origin, boolean important,
		boolean inheritAllowed) {
	checkValueCount(cssName, 1, values.size());
	CSSPrimitiveValue value = (CSSPrimitiveValue) values.get(0);
	checkInheritAllowed(value, inheritAllowed);
	if (value.getCssValueType() != CSSValue.CSS_INHERIT) {
		checkIdentType(cssName, value);
		IdentValue ident = checkIdent(cssName, value);

		checkValidity(cssName, getAllowed(), ident);
	}

	return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));

}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:16,代码来源:SingleIdent.java

示例5: buildDeclarations

@Override
public List buildDeclarations(CSSName cssName, List values, int origin, boolean important,
		boolean inheritAllowed) {
	checkValueCount(cssName, 1, values.size());
	PropertyValue value = (PropertyValue) values.get(0);
	checkInheritAllowed(value, inheritAllowed);
	if (value.getCssValueType() != CSSValue.CSS_INHERIT) {
		checkIdentNumberOrPercentType(cssName, value);

		if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
			IdentValue ident = checkIdent(cssName, value);
			checkValidity(cssName, allowed, ident);
		} else if (value.getFloatValue() < 0.0f) {
			throw new CSSParseException(cssName + " may not be negative", -1);
		}
	}

	return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));

}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:20,代码来源:CssExtensions.java

示例6: buildDeclarations

@Override
public List buildDeclarations(CSSName cssName, List values, int origin, boolean important,
		boolean inheritAllowed) {
	checkValueCount(cssName, 1, values.size());
	PropertyValue value = (PropertyValue) values.get(0);
	checkInheritAllowed(value, inheritAllowed);
	if (value.getCssValueType() != CSSValue.CSS_INHERIT) {
		checkLengthOrPercentType(cssName, value);

		if (!isNegativeValuesAllowed() && value.getFloatValue() < 0.0f) {
			throw new CSSParseException(cssName + " may not be negative", -1);
		}
	}

	return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));

}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:17,代码来源:LengthLike.java

示例7: buildDeclarations

@Override
public List buildDeclarations(CSSName cssName, List values, int origin, boolean important, boolean inheritAllowed) {
	checkValueCount(cssName, 1, values.size());
	PropertyValue value = (PropertyValue) values.get(0);
	checkInheritAllowed(value, inheritAllowed);
	if (value.getCssValueType() != CSSValue.CSS_INHERIT) {
		checkIdentNumberType(cssName, value);
		if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
			IdentValue ident = checkIdent(cssName, value);
			checkValidity(cssName, allowed, ident);
		} else if (value.getFloatValue() < 0.0f) {
			throw new CSSParseException(cssName + " may not be negative", -1);
		}
	}

	return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));

}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:18,代码来源:AnimationIterationCount.java

示例8: buildDeclarations

@Override
public List buildDeclarations(CSSName cssName, List values, int origin, boolean important,
		boolean inheritAllowed) {
	checkValueCount(cssName, 1, values.size());
	CSSPrimitiveValue value = (CSSPrimitiveValue) values.get(0);
	checkInheritAllowed(value, inheritAllowed);
	if (value.getCssValueType() != CSSValue.CSS_INHERIT) {
		checkIdentOrColorType(cssName, value);

		if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
			FSRGBColor color = Conversions.getColor(value.getStringValue());
			if (color != null) {
				return Collections.singletonList(
						new PropertyDeclaration(cssName, new PropertyValue(color), important, origin));
			}

			IdentValue ident = checkIdent(cssName, value);
			checkValidity(cssName, ALLOWED, ident);
		}
	}

	return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:23,代码来源:GenericColor.java

示例9: buildDeclarations

@Override
public List buildDeclarations(CSSName cssName, List values, int origin, boolean important,
		boolean inheritAllowed) {
	CSSPrimitiveValue value = (CSSPrimitiveValue) values.get(0);
	checkInheritAllowed(value, inheritAllowed);
	if (value.getCssValueType() != CSSValue.CSS_INHERIT) {
		return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));
	}
	return Collections.emptyList();
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:10,代码来源:Layout.java

示例10: buildDeclarations

@Override
public List buildDeclarations(CSSName cssName, List values, int origin, boolean important,
		boolean inheritAllowed) {
	checkValueCount(cssName, 1, values.size());
	PropertyValue value = (PropertyValue) values.get(0);
	checkInheritAllowed(value, inheritAllowed);
	if (value.getCssValueType() != CSSValue.CSS_INHERIT) {
		checkDuration(cssName, value);
		// String strv = value.getStringValue();
		// if (strv != null strv.endsWith("s")) {
		// strv = strv.substring(0, strv.length() - 1);
		// }
		// try {
		// float val = Float.parseFloat(strv);
		// if (!isNegativeValuesAllowed() && value.getFloatValue() <
		// 0.0f) {
		// throw new CSSParseException(cssName + " may not be negative",
		// -1);
		// }
		// PropertyValue v = new PropertyValue(CSSPrimitiveValue.CSS_S,
		// val, String.format("%fs", val));
		// return Collections.singletonList(new
		// PropertyDeclaration(cssName, v, important, origin));
		// } catch (NumberFormatException nfe) {
		// throw new CSSParseException(cssName + " is not a duration in
		// seconds (float suffixed by s)", -1);
		// }
	}
	return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));

}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:31,代码来源:FloatSeconds.java

示例11: buildDeclarations

@Override
public List buildDeclarations(CSSName cssName, List values, int origin, boolean important, boolean inheritAllowed) {
	CSSPrimitiveValue value = (CSSPrimitiveValue) values.get(0);
	checkInheritAllowed(value, inheritAllowed);
	if (value.getCssValueType() != CSSValue.CSS_INHERIT) {
		return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));
	}
	return Collections.emptyList();
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:9,代码来源:AnimationName.java

示例12: buildDeclarations

@Override
public List buildDeclarations(CSSName cssName, List values, int origin, boolean important,
		boolean inheritAllowed) {
	checkValueCount(cssName, 1, values.size());
	PropertyValue value = (PropertyValue) values.get(0);
	checkInheritAllowed(value, inheritAllowed);
	if (value.getCssValueType() != CSSValue.CSS_INHERIT) {
		checkNumberType(cssName, value);
		if (!isNegativeValuesAllowed() && value.getFloatValue() < 0.0f) {
			throw new CSSParseException(cssName + " may not be negative", -1);
		}
	}
	return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:14,代码来源:PlainNumber.java

示例13: applyCss

@Override
public void applyCss(PropertyDeclaration decl) {

	String n = decl.getPropertyName();
	CSSPrimitiveValue v = decl.getValue();
	CSSName cssName = decl.getCSSName();

	if (cssName == CSSName.COLOR) {
		ColorRGBA col = CssUtil.toFontColor(decl, this);
		if (!Objects.equals(col, fontColor)) {
			fontColor = col;
			dirtyLayout(true, LayoutType.text);
		}
	} else if (cssName == CSSName.FONT_SIZE) {
		float fs;
		if (decl.getValue().getPrimitiveType() == CSSValue.CSS_INHERIT) {
			fs = -1;
		} else
			fs = v.getFloatValue(CSSPrimitiveValue.CSS_PT);
		if (fs != fontSize) {
			fontSize = fs;
			dirtyLayout(true, LayoutType.text);
		}
	} else if (cssName == CSSName.FONT_FAMILY) {
		String fn = null;
		if (decl.getValue().getPrimitiveType() != CSSValue.CSS_INHERIT) {
			fn = v.getStringValue();
		}
		if (!Objects.equals(fn, fontFamily)) {
			fontFamily = fn;
			dirtyLayout(true, LayoutType.text);
		}
	} else {
		// LOG.warning(String.format("Unknown style %s (%s) in %s", n,
		// v.getStringValue(), toString()));
	}
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:37,代码来源:Screen.java

示例14: getCssValueType

/**
 * A code defining the type of the value.
 */
public short getCssValueType() {
    return CSSValue.CSS_INHERIT;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:6,代码来源:InheritValue.java

示例15: getCssValueType

/**
 * A code defining the type of the value.
 */
public short getCssValueType( )
{
	return CSSValue.CSS_INHERIT;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:7,代码来源:InheritValue.java


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