本文整理汇总了Java中org.w3c.css.sac.LexicalUnit.SAC_MILLIMETER属性的典型用法代码示例。如果您正苦于以下问题:Java LexicalUnit.SAC_MILLIMETER属性的具体用法?Java LexicalUnit.SAC_MILLIMETER怎么用?Java LexicalUnit.SAC_MILLIMETER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.w3c.css.sac.LexicalUnit
的用法示例。
在下文中一共展示了LexicalUnit.SAC_MILLIMETER属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDimensionUnitText
/**
* <b>SAC</b>: Implements {@link LexicalUnit#getDimensionUnitText()}.
*/
public String getDimensionUnitText() {
switch (lexicalUnitType) {
case LexicalUnit.SAC_CENTIMETER: return UNIT_TEXT_CENTIMETER;
case LexicalUnit.SAC_DEGREE: return UNIT_TEXT_DEGREE;
case LexicalUnit.SAC_EM: return UNIT_TEXT_EM;
case LexicalUnit.SAC_EX: return UNIT_TEXT_EX;
case LexicalUnit.SAC_GRADIAN: return UNIT_TEXT_GRADIAN;
case LexicalUnit.SAC_HERTZ: return UNIT_TEXT_HERTZ;
case LexicalUnit.SAC_INCH: return UNIT_TEXT_INCH;
case LexicalUnit.SAC_KILOHERTZ: return UNIT_TEXT_KILOHERTZ;
case LexicalUnit.SAC_MILLIMETER: return UNIT_TEXT_MILLIMETER;
case LexicalUnit.SAC_MILLISECOND: return UNIT_TEXT_MILLISECOND;
case LexicalUnit.SAC_PERCENTAGE: return UNIT_TEXT_PERCENTAGE;
case LexicalUnit.SAC_PICA: return UNIT_TEXT_PICA;
case LexicalUnit.SAC_PIXEL: return UNIT_TEXT_PIXEL;
case LexicalUnit.SAC_POINT: return UNIT_TEXT_POINT;
case LexicalUnit.SAC_RADIAN: return UNIT_TEXT_RADIAN;
case LexicalUnit.SAC_REAL: return UNIT_TEXT_REAL;
case LexicalUnit.SAC_SECOND: return UNIT_TEXT_SECOND;
default:
throw new IllegalStateException("No Unit Text for type: " +
lexicalUnitType);
}
}
示例2: isNumber
public boolean isNumber() {
short type = getLexicalUnitType();
switch (type) {
case LexicalUnit.SAC_INTEGER:
case LexicalUnit.SAC_REAL:
case LexicalUnit.SAC_EM:
case SCSSLexicalUnit.SAC_LEM:
case SCSSLexicalUnit.SAC_REM:
case LexicalUnit.SAC_EX:
case LexicalUnit.SAC_PIXEL:
case LexicalUnit.SAC_INCH:
case LexicalUnit.SAC_CENTIMETER:
case LexicalUnit.SAC_MILLIMETER:
case LexicalUnit.SAC_POINT:
case LexicalUnit.SAC_PICA:
case LexicalUnit.SAC_PERCENTAGE:
case LexicalUnit.SAC_DEGREE:
case LexicalUnit.SAC_GRADIAN:
case LexicalUnit.SAC_RADIAN:
case LexicalUnit.SAC_MILLISECOND:
case LexicalUnit.SAC_SECOND:
case LexicalUnit.SAC_HERTZ:
case LexicalUnit.SAC_KILOHERTZ:
case LexicalUnit.SAC_DIMENSION:
return true;
default:
return false;
}
}
示例3: createRectComponent
private Value createRectComponent(LexicalUnit lu) throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_IDENT:
if (lu.getStringValue().equalsIgnoreCase
(CSSConstants.CSS_AUTO_VALUE)) {
return ValueConstants.AUTO_VALUE;
}
break;
case LexicalUnit.SAC_EM:
return new FloatValue(CSSPrimitiveValue.CSS_EMS,
lu.getFloatValue());
case LexicalUnit.SAC_EX:
return new FloatValue(CSSPrimitiveValue.CSS_EXS,
lu.getFloatValue());
case LexicalUnit.SAC_PIXEL:
return new FloatValue(CSSPrimitiveValue.CSS_PX,
lu.getFloatValue());
case LexicalUnit.SAC_CENTIMETER:
return new FloatValue(CSSPrimitiveValue.CSS_CM,
lu.getFloatValue());
case LexicalUnit.SAC_MILLIMETER:
return new FloatValue(CSSPrimitiveValue.CSS_MM,
lu.getFloatValue());
case LexicalUnit.SAC_INCH:
return new FloatValue(CSSPrimitiveValue.CSS_IN,
lu.getFloatValue());
case LexicalUnit.SAC_POINT:
return new FloatValue(CSSPrimitiveValue.CSS_PT,
lu.getFloatValue());
case LexicalUnit.SAC_PICA:
return new FloatValue(CSSPrimitiveValue.CSS_PC,
lu.getFloatValue());
case LexicalUnit.SAC_INTEGER:
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
lu.getIntegerValue());
case LexicalUnit.SAC_REAL:
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
lu.getFloatValue());
case LexicalUnit.SAC_PERCENTAGE:
return new FloatValue(CSSPrimitiveValue.CSS_PERCENTAGE,
lu.getFloatValue());
}
throw createMalformedRectDOMException();
}
示例4: createValue
/**
* Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}.
*/
public Value createValue(LexicalUnit lu, CSSEngine engine)
throws DOMException {
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_EM:
return new FloatValue(CSSPrimitiveValue.CSS_EMS,
lu.getFloatValue());
case LexicalUnit.SAC_EX:
return new FloatValue(CSSPrimitiveValue.CSS_EXS,
lu.getFloatValue());
case LexicalUnit.SAC_PIXEL:
return new FloatValue(CSSPrimitiveValue.CSS_PX,
lu.getFloatValue());
case LexicalUnit.SAC_CENTIMETER:
return new FloatValue(CSSPrimitiveValue.CSS_CM,
lu.getFloatValue());
case LexicalUnit.SAC_MILLIMETER:
return new FloatValue(CSSPrimitiveValue.CSS_MM,
lu.getFloatValue());
case LexicalUnit.SAC_INCH:
return new FloatValue(CSSPrimitiveValue.CSS_IN,
lu.getFloatValue());
case LexicalUnit.SAC_POINT:
return new FloatValue(CSSPrimitiveValue.CSS_PT,
lu.getFloatValue());
case LexicalUnit.SAC_PICA:
return new FloatValue(CSSPrimitiveValue.CSS_PC,
lu.getFloatValue());
case LexicalUnit.SAC_INTEGER:
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
lu.getIntegerValue());
case LexicalUnit.SAC_REAL:
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
lu.getFloatValue());
case LexicalUnit.SAC_PERCENTAGE:
return new FloatValue(CSSPrimitiveValue.CSS_PERCENTAGE,
lu.getFloatValue());
}
throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType());
}