Question

I want to develop an app where the user should be able to draw objects (circles/elipses), connect them via lines/arrows and drag/drop them, add text to them etc. Of course I also have to write eventHandling.

What is most suitable for that? Would you rather go for gwt-graphics or GWTCanvas?

Était-ce utile?

La solution

Based on that what i know, GWT-Graphics is based on SVG. while GWTCanvas(which is actually part of GWT main line) is based on canvas element.

now, quick comparsion. For all drag and drop thing, SVG was much easier and quicker (when o was testing drag and drop when i had large abount of elements, my program based on canvas was much slower than similar stuff based on SVG

Other advantage of SVG based library is canvas is not supported y all browsers (actualy older versions of ie imight have some issues)

from the other hand, canvas is much quicker while you need to draw massive number of objects, canvas is definietly your choice.

Autres conseils

I would personally go with gwt-graphics. It is the one I know better, it gives as much control over graphics as was needed to me (and I think you too) and most of the events are already implemented, so the logic you will need to write will be minimal.

On the other hand SVG is not well supported by IExplorer and if the vectors become numerous you will have compatibility problems.

The Canvas if HTML 5 and will give you pixel level control - which I assume is not the case in your project - but will also lead to a - no workarounds - approach which is a pro.

In conclusion, I think it depends on the level of control you want the user to have while using the canvas and the level of work you want to do on your part.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top