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


Java LexicalUnit.getFloatValue方法代码示例

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


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

示例1: 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_INHERIT:
        return SVGValueConstants.INHERIT_VALUE;

    case  LexicalUnit.SAC_INTEGER:
        return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                              lu.getIntegerValue());

    case  LexicalUnit.SAC_REAL:
        return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                              lu.getFloatValue());

    default:
        throw createInvalidLexicalUnitDOMException
            (lu.getLexicalUnitType());
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:23,代码来源:StrokeMiterlimitManager.java

示例2: 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_INHERIT:
        return SVGValueConstants.INHERIT_VALUE;

    case LexicalUnit.SAC_INTEGER:
        return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                              lu.getIntegerValue());

    case LexicalUnit.SAC_REAL:
        return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
                              lu.getFloatValue());
    }
    throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType());
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:20,代码来源:OpacityManager.java

示例3: createColorComponent

import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
 * Creates a color component from a lexical unit.
 */
protected Value createColorComponent(LexicalUnit lu) throws DOMException {
    switch (lu.getLexicalUnitType()) {
    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 createInvalidRGBComponentUnitDOMException
        (lu.getLexicalUnitType());
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:21,代码来源:AbstractColorManager.java

示例4: 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_INHERIT:
        return ValueConstants.INHERIT_VALUE;

    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_IDENT:
        if (lu.getStringValue().equalsIgnoreCase
            (CSSConstants.CSS_NONE_VALUE)) {
            return ValueConstants.NONE_VALUE;
        }
        throw createInvalidIdentifierDOMException(lu.getStringValue());
    }
    throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType());
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:27,代码来源:FontSizeAdjustManager.java

示例5: getColorValue

import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
/**
 * Creates a float value usable as a component of an RGBColor.
 */
protected float getColorValue(LexicalUnit lu) {
    expectNonNull(lu);
    switch (lu.getLexicalUnitType()) {
    case LexicalUnit.SAC_INTEGER:
        return lu.getIntegerValue();
    case LexicalUnit.SAC_REAL:
        return lu.getFloatValue();
    }
    throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType());
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:14,代码来源:SVGColorManager.java

示例6: createRectComponent

import org.w3c.css.sac.LexicalUnit; //导入方法依赖的package包/类
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();
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:45,代码来源:RectManager.java

示例7: 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_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());
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:53,代码来源:LengthManager.java


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