I need to create a utility that presents the user with a "canvas" and
allows them to add geometric shapes, including lines and circles.
These must be drag-able (that is, once they're on the canvas, they can
be moved), and I need to know the angles between the lines. There
will be as many as 300 shapes on the screen at once. The first API
that comes to mind is Java3D, but it might take too much time to
render this, expecially with hundreds of shapes on the screen. Java2D
might work, but I am not aware of any build-in object-awareness or
scene-graph capabilities.
What direction should I go in? Are there any APIs out there that are
recommended?
Andre Bialojahn - 13 Apr 2004 21:16 GMT
[Unannounced xpost over four groups without fup2 being set]
> I need to create a utility that presents the user with a "canvas" and
> allows them to add geometric shapes, including lines and circles.
> These must be drag-able [...]
(...PickMouseBehaviors...)
> There will be as many as 300 shapes on the screen at once.
Depending on the sort of hardware you have: not really a challenge.
I have almost everything from 600 to 12000 on my screen in my visuali-
zation. About 2000 are absolutely no problem on an Athlon XP24+.
> Java2D might work, but I am not aware of any build-in object-awareness
> or scene-graph capabilities.
J2D doesn't feature *any* kind of SG. Why should it?
If you need a SG, you're with Java3D or Xith3D.
[xpost removed, fup2 clj.3d]
André
vkm - 15 Apr 2004 01:02 GMT
Something like 'http://home.earthlink.net/~vkmohan/draw/draw.html' this?
> I need to create a utility that presents the user with a "canvas" and
> allows them to add geometric shapes, including lines and circles.
[quoted text clipped - 8 lines]
> What direction should I go in? Are there any APIs out there that are
> recommended?
Rom - 19 Apr 2004 22:17 GMT
Not quite. That applet doesn't seem to allow manipulation via
point-and-click (i.e. mouse).
> Something like 'http://home.earthlink.net/~vkmohan/draw/draw.html' this?
>
[quoted text clipped - 11 lines]
> > What direction should I go in? Are there any APIs out there that are
> > recommended?
Roedy Green - 20 Apr 2004 03:32 GMT
>What direction should I go in? Are there any APIs out there that are
>recommended?
Your biggest problem is taking an x/y co-ordinate and trying to guess
which shape it is pointing at. You can do that quickly with a
hangingmoss algorithm. see
http://mindprod.com/jgloss/hangingmoss.html
To move a shape over others, you can erase the old position, and
repaint the new, leaving chunks out of shapes you move over. Or figure
out which shapes are affected and then re-rendening only them in a
clip region.
Surely though somebody has figured this all out with a sprite library.
If not, it might be a fun student project, and then demonstrate it by
using the library to create a pacman game.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.