本文整理汇总了Java中org.w3c.css.sac.LexicalUnit.getParameters方法的典型用法代码示例。如果您正苦于以下问题:Java LexicalUnit.getParameters方法的具体用法?Java LexicalUnit.getParameters怎么用?Java LexicalUnit.getParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.w3c.css.sac.LexicalUnit
的用法示例。
在下文中一共展示了LexicalUnit.getParameters方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createICCNamedColorValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
private Value createICCNamedColorValue(LexicalUnit lu, Value v) {
lu = lu.getParameters();
expectIdent(lu);
String profileName = lu.getStringValue();
lu = lu.getNextLexicalUnit();
expectComma(lu);
lu = lu.getNextLexicalUnit();
expectIdent(lu);
String colorName = lu.getStringValue();
ICCNamedColor icc = new ICCNamedColor(profileName, colorName);
lu = lu.getNextLexicalUnit();
return icc;
}
示例2: createCIELabColorValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
private Value createCIELabColorValue(LexicalUnit lu, Value v) {
lu = lu.getParameters();
float l = getColorValue(lu);
lu = lu.getNextLexicalUnit();
expectComma(lu);
lu = lu.getNextLexicalUnit();
float a = getColorValue(lu);
lu = lu.getNextLexicalUnit();
expectComma(lu);
lu = lu.getNextLexicalUnit();
float b = getColorValue(lu);
CIELabColor icc = new CIELabColor(l, a, b);
lu = lu.getNextLexicalUnit();
return icc;
}
示例3: createCIELCHColorValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
private Value createCIELCHColorValue(LexicalUnit lu, Value v) {
lu = lu.getParameters();
float l = getColorValue(lu);
lu = lu.getNextLexicalUnit();
expectComma(lu);
lu = lu.getNextLexicalUnit();
float c = getColorValue(lu);
lu = lu.getNextLexicalUnit();
expectComma(lu);
lu = lu.getNextLexicalUnit();
float h = getColorValue(lu);
CIELCHColor icc = new CIELCHColor(l, c, h);
lu = lu.getNextLexicalUnit();
return icc;
}
示例4: createDeviceColorValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
private Value createDeviceColorValue(LexicalUnit lu, Value v, int expectedComponents) {
lu = lu.getParameters();
boolean nChannel = (expectedComponents <= 0);
DeviceColor col = new DeviceColor(nChannel);
col.append(getColorValue(lu));
LexicalUnit lastUnit = lu;
lu = lu.getNextLexicalUnit();
while (lu != null) {
expectComma(lu);
lu = lu.getNextLexicalUnit();
col.append(getColorValue(lu));
lastUnit = lu;
lu = lu.getNextLexicalUnit();
}
if (!nChannel && expectedComponents != col.getNumberOfColors()) {
throw createInvalidLexicalUnitDOMException(lastUnit.getLexicalUnitType());
}
return col;
}
示例5: RGBColorImpl
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
public RGBColorImpl(LexicalUnit lexicalUnit) {
LexicalUnit nextUnit = lexicalUnit.getParameters();
red = new Measure(nextUnit);
nextUnit = nextUnit.getNextLexicalUnit().getNextLexicalUnit();
green = new Measure(nextUnit);
nextUnit = nextUnit.getNextLexicalUnit().getNextLexicalUnit();
blue = new Measure(nextUnit);
}
示例6: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_FUNCTION:
if (!lu.getFunctionName().equalsIgnoreCase("rect")) {
break;
}
case LexicalUnit.SAC_RECT_FUNCTION:
lu = lu.getParameters();
Value top = createRectComponent(lu);
lu = lu.getNextLexicalUnit();
if (lu == null ||
lu.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
throw createMalformedRectDOMException();
}
lu = lu.getNextLexicalUnit();
Value right = createRectComponent(lu);
lu = lu.getNextLexicalUnit();
if (lu == null ||
lu.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
throw createMalformedRectDOMException();
}
lu = lu.getNextLexicalUnit();
Value bottom = createRectComponent(lu);
lu = lu.getNextLexicalUnit();
if (lu == null ||
lu.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
throw createMalformedRectDOMException();
}
lu = lu.getNextLexicalUnit();
Value left = createRectComponent(lu);
return new RectValue(top, right, bottom, left);
}
throw createMalformedRectDOMException();
}
示例7: createICCColorValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
private Value createICCColorValue(LexicalUnit lu, Value v) {
lu = lu.getParameters();
expectIdent(lu);
ICCColor icc = new ICCColor(lu.getStringValue());
lu = lu.getNextLexicalUnit();
while (lu != null) {
expectComma(lu);
lu = lu.getNextLexicalUnit();
icc.append(getColorValue(lu));
lu = lu.getNextLexicalUnit();
}
return icc;
}
示例8: createValue
import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
if (lu.getLexicalUnitType() == LexicalUnit.SAC_RGBCOLOR) {
lu = lu.getParameters();
Value red = createColorComponent(lu);
lu = lu.getNextLexicalUnit().getNextLexicalUnit();
Value green = createColorComponent(lu);
lu = lu.getNextLexicalUnit().getNextLexicalUnit();
Value blue = createColorComponent(lu);
return createRGBColor(red, green, blue);
}
return super.createValue(lu, engine);
}