Search in sources :

Example 1 with LengthValue

use of javax.swing.text.html.CSS.LengthValue in project jdk8u_jdk by JetBrains.

the class CSSBorder method getBorderWidth.

/**
     * Return the border width for the given side.
     */
private int getBorderWidth(int side) {
    int width = 0;
    BorderStyle bs = (BorderStyle) attrs.getAttribute(ATTRIBUTES[STYLE][side]);
    if ((bs != null) && (bs.getValue() != Value.NONE)) {
        // The 'border-style' value of "none" forces the computed value
        // of 'border-width' to be 0 (CSS2 8.5.3)
        LengthValue bw = (LengthValue) attrs.getAttribute(ATTRIBUTES[WIDTH][side]);
        if (bw == null) {
            bw = (LengthValue) DEFAULTS[WIDTH];
        }
        width = (int) bw.getValue(true);
    }
    return width;
}
Also used : BorderStyle(javax.swing.text.html.CSS.BorderStyle) LengthValue(javax.swing.text.html.CSS.LengthValue)

Aggregations

BorderStyle (javax.swing.text.html.CSS.BorderStyle)1 LengthValue (javax.swing.text.html.CSS.LengthValue)1