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


Java LexicalUnit.SAC_DEGREE属性代码示例

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


在下文中一共展示了LexicalUnit.SAC_DEGREE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:27,代码来源:CSSLexicalUnit.java

示例2: getCssText

public String getCssText() {
	// TODO: All LexicalUnit.SAC_OPERATOR_* except for COMMA left undone for
	// now as it's not even clear whether they should be treated as measures
	// see bug #278139
	switch (value.getLexicalUnitType()) {
	case LexicalUnit.SAC_INTEGER:
		return String.valueOf(value.getIntegerValue());
	case LexicalUnit.SAC_REAL:
		return String.valueOf(value.getFloatValue());
	case LexicalUnit.SAC_PERCENTAGE:
	case LexicalUnit.SAC_PIXEL:
	case LexicalUnit.SAC_CENTIMETER:
	case LexicalUnit.SAC_EM:
	case LexicalUnit.SAC_EX:
	case LexicalUnit.SAC_PICA:
	case LexicalUnit.SAC_POINT:
	case LexicalUnit.SAC_INCH:
	case LexicalUnit.SAC_DEGREE:
		return String.valueOf(value.getFloatValue()) + value.getDimensionUnitText();
	case LexicalUnit.SAC_URI:
		return "url(" + value.getStringValue() + ")";
	case LexicalUnit.SAC_OPERATOR_COMMA:
		return ",";
	case LexicalUnit.SAC_INHERIT:
		return "inherit";
	}
	return value.getStringValue();
}
 
开发者ID:eclipse,项目名称:tm4e,代码行数:28,代码来源:Measure.java

示例3: 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;
    }
}
 
开发者ID:fjalvingh,项目名称:domui,代码行数:29,代码来源:LexicalUnitImpl.java


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