本文整理汇总了Java中org.w3c.dom.css.CSSValue类的典型用法代码示例。如果您正苦于以下问题:Java CSSValue类的具体用法?Java CSSValue怎么用?Java CSSValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CSSValue类属于org.w3c.dom.css包,在下文中一共展示了CSSValue类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: computeValue
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
/**
* Implements {@link
* ValueManager#computeValue(CSSStylableElement,String,CSSEngine,int,StyleMap,Value)}.
*/
public Value computeValue(CSSStylableElement elt,
String pseudo,
CSSEngine engine,
int idx,
StyleMap sm,
Value value) {
switch (value.getCssValueType()) {
case CSSValue.CSS_PRIMITIVE_VALUE:
return value;
}
ListValue lv = (ListValue)value;
ListValue result = new ListValue(' ');
for (int i = 0; i < lv.getLength(); i++) {
result.append(super.computeValue(elt, pseudo, engine, idx, sm,
lv.item(i)));
}
return result;
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:24,代码来源:StrokeDasharrayManager.java
示例2: computeValue
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
/**
* Implements {@link
* ValueManager#computeValue(CSSStylableElement,String,CSSEngine,int,StyleMap,Value)}.
*/
public Value computeValue(CSSStylableElement elt,
String pseudo,
CSSEngine engine,
int idx,
StyleMap sm,
Value value) {
if ((value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) &&
(value.getPrimitiveType() == CSSPrimitiveValue.CSS_URI)) {
// Reveal the absolute value as the cssText now.
return new URIValue(value.getStringValue(),
value.getStringValue());
}
return value;
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:20,代码来源:AbstractValueManager.java
示例3: computeValue
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
/**
* Implements {@link
* ValueManager#computeValue(CSSStylableElement,String,CSSEngine,int,StyleMap,Value)}.
*/
public Value computeValue(CSSStylableElement elt,
String pseudo,
CSSEngine engine,
int idx,
StyleMap sm,
Value value) {
if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) {
ListValue lv = (ListValue)value;
int len = lv.getLength();
ListValue result = new ListValue(' ');
for (int i=0; i<len; i++) {
Value v = lv.item(0);
if (v.getPrimitiveType() == CSSPrimitiveValue.CSS_URI) {
// Reveal the absolute value as the cssText now.
result.append(new URIValue(v.getStringValue(),
v.getStringValue()));
} else {
result.append(v);
}
}
return result;
}
return super.computeValue(elt, pseudo, engine, idx, sm, value);
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:29,代码来源:CursorManager.java
示例4: createCSSValue
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
/**
* Creates a CSSValue to manage the value at the given index.
*/
protected CSSValue createCSSValue(int idx) {
if (idx > SVGCSSEngine.FINAL_INDEX) {
if (cssEngine.getValueManagers()[idx] instanceof SVGPaintManager) {
return new ComputedCSSPaintValue(idx);
}
if (cssEngine.getValueManagers()[idx] instanceof SVGColorManager) {
return new ComputedCSSColorValue(idx);
}
} else {
switch (idx) {
case SVGCSSEngine.FILL_INDEX:
case SVGCSSEngine.STROKE_INDEX:
return new ComputedCSSPaintValue(idx);
case SVGCSSEngine.FLOOD_COLOR_INDEX:
case SVGCSSEngine.LIGHTING_COLOR_INDEX:
case SVGCSSEngine.STOP_COLOR_INDEX:
return new ComputedCSSColorValue(idx);
}
}
return super.createCSSValue(idx);
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:26,代码来源:CSSOMSVGComputedStyle.java
示例5: item
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
/**
* <b>DOM</b>: Implements {@link org.w3c.dom.css.CSSValueList#item(int)}.
*/
public CSSValue item(int index) {
int len = valueProvider.getValue().getLength();
if (index < 0 || index >= len) {
return null;
}
if (items == null) {
items = new CSSValue[valueProvider.getValue().getLength()];
} else if (items.length < len) {
CSSValue[] nitems = new CSSValue[len];
System.arraycopy( items, 0, nitems, 0, items.length );
items = nitems;
}
CSSValue result = items[index];
if (result == null) {
items[index] = result = new ListComponent(index);
}
return result;
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:22,代码来源:CSSOMValue.java
示例6: createCSSValue
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
/**
* Creates the CSS value associated with the given property.
*/
protected CSSValue createCSSValue(String name) {
int idx = cssEngine.getPropertyIndex(name);
if (idx > SVGCSSEngine.FINAL_INDEX) {
if (cssEngine.getValueManagers()[idx] instanceof SVGPaintManager) {
return new StyleDeclarationPaintValue(name);
}
if (cssEngine.getValueManagers()[idx] instanceof SVGColorManager) {
return new StyleDeclarationColorValue(name);
}
} else {
switch (idx) {
case SVGCSSEngine.FILL_INDEX:
case SVGCSSEngine.STROKE_INDEX:
return new StyleDeclarationPaintValue(name);
case SVGCSSEngine.FLOOD_COLOR_INDEX:
case SVGCSSEngine.LIGHTING_COLOR_INDEX:
case SVGCSSEngine.STOP_COLOR_INDEX:
return new StyleDeclarationColorValue(name);
}
}
return super.createCSSValue(name);
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:27,代码来源:CSSOMSVGStyleDeclaration.java
示例7: getColorType
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
/**
* <b>DOM</b>: Implements {@link
* org.w3c.dom.svg.SVGColor#getColorType()}.
*/
public short getColorType() {
Value value = valueProvider.getValue();
int cssValueType = value.getCssValueType();
switch ( cssValueType ) {
case CSSValue.CSS_PRIMITIVE_VALUE:
int primitiveType = value.getPrimitiveType();
switch ( primitiveType ) {
case CSSPrimitiveValue.CSS_IDENT: {
if (value.getStringValue().equalsIgnoreCase
(CSSConstants.CSS_CURRENTCOLOR_VALUE))
return SVG_COLORTYPE_CURRENTCOLOR;
return SVG_COLORTYPE_RGBCOLOR;
}
case CSSPrimitiveValue.CSS_RGBCOLOR:
return SVG_COLORTYPE_RGBCOLOR;
}
// there was no case for this primitiveType, prevent throwing the other exception
throw new IllegalStateException("Found unexpected PrimitiveType:" + primitiveType );
case CSSValue.CSS_VALUE_LIST:
return SVG_COLORTYPE_RGBCOLOR_ICCCOLOR;
}
// should not happen
throw new IllegalStateException("Found unexpected CssValueType:" + cssValueType );
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:30,代码来源:CSSOMSVGColor.java
示例8: computeValue
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
/**
* 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,代码行数:22,代码来源:SVGAnimationEngine.java
示例9: convertEnableBackground
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
/**
* Returns the subregion of user space where access to the
* background image is allowed to happen.
*
* @param e the container element
*/
public static Rectangle2D convertEnableBackground(Element e /*,
UnitProcessor.Context uctx*/) {
Value v = getComputedStyle(e, SVGCSSEngine.ENABLE_BACKGROUND_INDEX);
if (v.getCssValueType() != CSSValue.CSS_VALUE_LIST) {
return null; // accumulate
}
ListValue lv = (ListValue)v;
int length = lv.getLength();
switch (length) {
case 1:
return CompositeGraphicsNode.VIEWPORT; // new
case 5: // new <x>,<y>,<width>,<height>
float x = lv.item(1).getFloatValue();
float y = lv.item(2).getFloatValue();
float w = lv.item(3).getFloatValue();
float h = lv.item(4).getFloatValue();
return new Rectangle2D.Float(x, y, w, h);
default:
throw new IllegalStateException("Unexpected length:" + length ); // Cannot happen
}
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:29,代码来源:CSSUtilities.java
示例10: convertStrokeDasharray
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
/**
* Converts the 'stroke-dasharray' property to a list of float
* number in user units.
*
* @param v the CSS value describing the dasharray property
*/
public static float [] convertStrokeDasharray(Value v) {
float [] dasharray = null;
if (v.getCssValueType() == CSSValue.CSS_VALUE_LIST) {
int length = v.getLength();
dasharray = new float[length];
float sum = 0;
for (int i = 0; i < dasharray.length; ++i) {
dasharray[i] = v.item(i).getFloatValue();
sum += dasharray[i];
}
if (sum == 0) {
/* 11.4 - If the sum of the <length>'s is zero, then
* the stroke is rendered as if a value of none were specified.
*/
dasharray = null;
}
}
return dasharray;
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:26,代码来源:PaintServer.java
示例11: buildDeclarations
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
@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,代码行数:17,代码来源:GenericURIWithNone.java
示例12: buildDeclarations
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
@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,代码行数:22,代码来源:LengthLikeWithIdent.java
示例13: buildDeclarations
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
@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,代码行数:17,代码来源:SingleIdent.java
示例14: buildDeclarations
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
@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,代码行数:21,代码来源:CssExtensions.java
示例15: buildDeclarations
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
@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,代码行数:18,代码来源:LengthLike.java
示例16: buildDeclarations
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
@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,代码行数:19,代码来源:AnimationIterationCount.java
示例17: buildDeclarations
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
@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,代码行数:24,代码来源:GenericColor.java
示例18: getColor
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
private ColorDefinition getColor( CSSValue value )
{
if ( value != null && value instanceof RGBColorValue )
{
RGBColorValue color = (RGBColorValue) value;
try
{
return goFactory.createColorDefinition( Math.round( color.getRed( )
.getFloatValue( CSSPrimitiveValue.CSS_NUMBER ) ),
Math.round( color.getGreen( )
.getFloatValue( CSSPrimitiveValue.CSS_NUMBER ) ),
Math.round( color.getBlue( )
.getFloatValue( CSSPrimitiveValue.CSS_NUMBER ) ) );
}
catch ( RuntimeException ex )
{
logger.log( Level.WARNING.intValue( ),
"invalid color: {0}" + value.toString( ) ); //$NON-NLS-1$
}
}
return null;
}
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:ChartReportStyleProcessor.java
示例19: buildTextDecoration
import org.w3c.dom.css.CSSValue; //导入依赖的package包/类
/**
* Build the Text-Decoration style string.
*
* @param styleBuffer
* The <code>StringBuffer</code> to which the result is output.
* @param linethrough
* The line-through value.
* @param underline
* The underline value.
* @param overline
* The overline value.
*/
public static void buildTextDecoration( StringBuffer styleBuffer,
IStyle style )
{
CSSValue linethrough = style.getProperty(IStyle.STYLE_TEXT_LINETHROUGH);
CSSValue underline = style.getProperty(IStyle.STYLE_TEXT_UNDERLINE);
CSSValue overline = style.getProperty(IStyle.STYLE_TEXT_OVERLINE);
if (linethrough == IStyle.LINE_THROUGH_VALUE || underline == IStyle.UNDERLINE_VALUE || overline == IStyle.OVERLINE_VALUE)
{
styleBuffer.append( " text-decoration:" ); //$NON-NLS-1$
if (IStyle.LINE_THROUGH_VALUE == linethrough )
{
addPropValue( styleBuffer, "line-through" );
}
if ( IStyle.UNDERLINE_VALUE == underline)
{
addPropValue( styleBuffer, "underline" );
}
if ( IStyle.OVERLINE_VALUE == overline)
{
addPropValue( styleBuffer, "overline" );
}
styleBuffer.append( ';' );
}
}
开发者ID:eclipse,项目名称:birt,代码行数:38,代码来源:AttributeBuilder.java
注:本文中的org.w3c.dom.css.CSSValue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论