[cp-patches] FYI: CSS border support

Roman Kennke roman.kennke at aicas.com
Tue Nov 7 13:00:37 UTC 2006


The attached patch adds support for CSS borders. This implementation is
actually much better than Sun's because it not only recognizes the
border-width attribute (which Sun doesn't, except for 0 and 1 borders),
it also recognizes the border-top-width, etc for installing different
borders on different edges. I also added support for border-XYZ-color
and border-XYZ-style (both of which Sun doesn't support yet). I am
missing most border styles though (Sun too btw).

This is an example of how it might look:

http://kennke.org/~roman/css-border.png

2006-11-07  Roman Kennke  <kennke at aicas.com>

        * gnu/javax/swing/text/html/css/BorderWidth.java:
        New class. Handles CSS border width values.
        * gnu/javax/swing/text/html/css/Length.java
        (floatValue): Made protected so that BorderWidth can access it.
        * javax/swing/text/html/CSS.java
        (Attribute.BORDER_BOTTOM_COLOR): New static field.
        (Attribute.BORDER_BOTTOM_STYLE): New static field.
        (Attribute.BORDER_LEFT_COLOR): New static field.
        (Attribute.BORDER_LEFT_STYLE): New static field.
        (Attribute.BORDER_RIGHT_COLOR): New static field.
        (Attribute.BORDER_RIGHT_STYLE): New static field.
        (Attribute.BORDER_TOP_COLOR): New static field.
        (Attribute.BORDER_TOP_STYLE): New static field.
        (getValue): Added some mappings for the border color and
        border width values.
        * javax/swing/text/html/CSSBorder.java: New class. Implements
        CSS borders.
        * javax/swing/text/html/StyleSheet.java
        (BoxPainter.background): New field.
        (BoxPainter.border): New field.
        (BoxPainter.bottomInset): Documented.
        (BoxPainter.leftInset): Documented.
        (BoxPainter.rightInset): Documented.
        (BoxPainter.topInset): Documented.
        (BoxPainter.BoxPainter): Added support for borders and
background.
        (BoxPainter.getInset): Add border insets.
        (BoxPainter.paint): Implemented. Paints the background and the
        CSS border.
        (addRule): Be less picky about parse and IO exceptions.
        (getBoxPainter): Adjust to new BoxPainter constructor.

/Roman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 30016 bytes
Desc: not available
Url : http://developer.classpath.org/pipermail/classpath-patches/attachments/20061107/04e10da1/patch-0001.bin


More information about the Classpath-patches mailing list