I have created code that can be run from a phase listener or servlet
that can generate nicely rendered PNG images with highlighted beveled
edges. The idea is to be able to dynamically create a DIV tag with
images in the corners and sides that can stretch to create a nice
rounded corner background image effect that works on CSS2 compliant
browsers as well as IE6 (with alpha-transparency IE6 CSS specific
code).

Attributes:
color: the foreground color of the div (required)
backgroundColor: the background color of the div (optional, defaults
to transparent)
borderColor: instead of 3D highlighting, use a solid rounded border of
this color
borderWidth: if 3D, the size of the bevel (highlight). If 2D
(borderColor set), the thickness of the line. Default: 8
size: specify a specific WxH of the image. When given, just acts as a
background image with no repeat an no support for stretching. Default
is to have images generated for each corner, side and the center and
have CSS position them to support resizing
radius: the radius, in pixels, of the rounded corners. default: 8

See example result (attached) which is a 200x200 image with 20px
border width & 20px radius

Usage:

<s:roundedDiv color="red" style="padding: 8px;">
 <h:outputText value="Hello world!" />
</s:roundedDiv>

Any comments?

I have 2 questions on this as well:
1) How should I implement the image generation code: new servlet, new
phase listener, part of the extensions filter or other idea?
2) This requires browser detection of IE6. I can easily use a regex on
the user agent, but am wondering if there is already any browser
detection code in tomahawk or a 3rd party library that I can leverage
that is compatible with the apache license.

Thanks,
Andrew

<<attachment: test_full.png>>

Reply via email to