Overview | Library | Tag | Help
| FRAMES NO FRAMES

## RichFaces
Tag paint2D

Create an image by paint in a managed bean, same as paint (Graphics g) in SWING components. It can be used as a cacheable or non-cacheable resource. With a cache support, a key is created in URI with a mix of size (width/height), paint method, format and data attributes.

Tag Information
Tag Class | org.richfaces.taglib.Paint2DTag
TagExtraInfo Class | None
Body Content | JSP
Display Name | None

Attributes
Name | Required | Request-time | Type | Description
align | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.String`) | Deprecated. This attribute specifies the position of an IMG, OBJECT, or APPLET with respect to its context. The possible values are "bottom", "middle", "top", "left" and "right". The default value is "middle".
alt | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.String`) | For compability with XHTML 1.1 standart
bgcolor | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.String`) | Background color of painted image. Default value is 'transparent' which means no background fill. Hex colors can be used, as well as common color names. Invalid values are treated as transparent. Note, that JPEG format doesn't support transparency, and transparent background is painted black. Also note, that several browsers (e.g. IE6) do not support PNG transparency
binding | false | false | `javax.el.ValueExpression` (must evaluate to `javax.faces.component.UIComponent`) | The attribute takes a value-binding expression for a component property of a backing bean
border | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.String`) | Deprecated. This attribute specifies the width of an IMG or OBJECT border, in pixels. The default value for this attribute depends on the user agent
cacheable | false | false | `javax.el.ValueExpression` (must evaluate to `boolean`) | Supported (or not) client/server caching for generated images. Caching on client supported by properly sending and processing of HTTP headers (Last-Modified, Expires, If-Modified-Since, etc.) Server-side caching is supported by application-scope object cache. For build of cache key use "value" attribute, serialized to URI
data | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.Object`) | Value calculated at render time and stored in Image URI (as part of cache Key), at paint time passed to a paint method. It can be used for updating cache at change of image generating conditions, and for creating paint beans as "Lightweight" pattern components (request scope). IMPORTANT: Since serialized data stored in URI, avoid using big objects
format | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.String`) | format Name of format for sending a generated image. It currently supports "jpeg" (24 bit, default), "gif" (8 bit with transparency), "png" (32 bit with transparency)
height | false | false | `javax.el.ValueExpression` (must evaluate to `int`) | Height in pixels of image (for paint canvas and HTML attribute). Default value is "10".
hspace | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.String`) | Deprecated. This attribute specifies the amount of white space to be inserted to the left and right of an IMG, APPLET, or OBJECT. The default value is not specified, but is generally a small, non-zero length
id | false | false | `java.lang.String` | Every component may have a unique id that is automatically created if omitted
lang | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.String`) | Code describing the language used in the generated markup for this component
paint | false | false | `javax.el.MethodExpression` (signature must match `void paint(java.awt.Graphics2D,java.lang.Object)`) | The method calls expression to paint Image on prepared Buffered image. It must have two parameters with a type of java.awt.Graphics2D (graphics to paint) and Object (restored from URI "data" property). For painting used 32-bit RGBA color model (for 8-bit images used Diffusion filtration before sending)
rendered | false | false | `javax.el.ValueExpression` (must evaluate to `boolean`) | If "false", this component is not rendered
style | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.String`) | CSS style(s) is/are to be applied when this component is rendered
styleClass | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.String`) | Corresponds to the HTML class attribute
title | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.String`) | Advisory title information about markup elements generated for this component
value | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.Object`) | The current value of this component
vspace | false | false | `javax.el.ValueExpression` (must evaluate to `java.lang.String`) | Deprecated. This attribute specifies the amount of white space to be inserted above and below an IMG, APPLET, or OBJECT. The default value is not specified, but is generally a small, non-zero length
width | false | false | `javax.el.ValueExpression` (must evaluate to `int`) | Width in pixels of image (for paint canvas and HTML attribute). Default value is "10".

Variables
| No Variables Defined.

Overview | Library | Tag | Help
| FRAMES NO FRAMES

Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.