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. On 24 avr, 05:20, 剑涛 何 <[email protected]> wrote: > can you tell me something detail? > > On 4月23日, 下午10时20分, Gal Dolber <[email protected]> wrote: > > > > >http://gwtcanvasdemo.appspot.com/ > > > On Sat, Apr 23, 2011 at 10:54 AM, 剑涛 何 <[email protected]> wrote: > > > if there are two coordinates -p1:(x1,y1),p2:(x2,y2) in the > > > browser ,how to draw an arrow from p1 to p2? > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "Google Web Toolkit" group. > > > To post to this group, send email to [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]. > > > For more options, visit this group at > > >http://groups.google.com/group/google-web-toolkit?hl=en. > > > -- > > Guit: Elegant, beautiful, modular and *production ready* gwt applications. > > >http://code.google.com/p/guit/- Masquer le texte des messages précédents - > > - Afficher le texte des messages précédents - -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
