Drawing a Line inside a browser a well know problem, just look for
"java script line drawing" in your search engine. The basic idea is to
use a set of "div" tags to draw various points, ie 1px*1px rectangles
with background-color but with performance problems. An idea is to
agregate adjacent rectangles in a same column or in the same row to
optimize this drawing. Various js libraries exists depending on the
drawing and graphics complexity you are looking for.
This Canvas library is a good thing but rely on new HTML 5 standard
and is not supported by a lot of browser (current IE and all the old
versions), may be it's a problem in your application. The Canvas class
is includes in GWT 2.2 but as: "Experimental API: This API is still
under development and is subject to change." If this is not a problem
for you this is the best GWT complient solution. The previous post
give you the url of the google demo and examples
http://code.google.com/p/gwtcanvasdemo/
There is (was) another Canvas library in the incubator project and it
works fine in Web mode across the major browser working as JavaScript
wrapper but is not a good idea (now this library is obsolete)
http://code.google.com/p/google-web-toolkit-incubator/wiki/GWTCanvas
Another way is to build a graphic at run time in your server using a
graphics context from java and common drawing API to building an image
and then display it on your server. It's convenient with complex
images or to build a captcha as example. It is also possible to rely
on SVG tags, like LINE. These are simple XML tags but sometimes
requires a browser plugin. In fact there is multiple solutions
depending on your project environment and your targets.
> >
http://code.google.com/p/guit/- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -