PDA

View Full Version : Quartz composer.




Antonios
Aug 12, 2007, 11:11 AM
I want to build a visual based environment in which the user will drag and drop components on an empty canvas and these components would be possible to be interconnected with lines using Java like Quartz composer. My questions are:
1) How would I build the graphic part of the block? Use Java2D to create a rectangle? Use photoshop to make the graphic and then insert it in my project? Then how would I add the properties? Build a class that has the functionality and through properties link them to the graphic?
2) How would I built the lines and in the same time make the flow between two blocks a reality?



HiRez
Aug 12, 2007, 08:58 PM
For starters, I would think you'd want to do the drawing "live", as opposed to prerendering images, because that will give you more flexibility for scaling the boxes, recoloring, etc. For the connecting line you probably want to investigate Béziér curves (cubic or quadratic). A simple stroked curve will probably give you the effect you want, you'll just need to experiment on where and how to place the control points relative to the two boxes being connected for the right effect. You don't really need to know much math to draw them, but it wouldn't hurt, as they are mathematical entities behind the visual representation you see.

Antonios
Aug 13, 2007, 10:25 AM
Then if I go with the drawing live i will have to use Java2D to built my own container/node. Hmm, will have to look into it.