Quartz composer.

Discussion in 'Mac Programming' started by Antonios, Aug 12, 2007.

  1. Antonios macrumors newbie

    Apr 15, 2007
    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?
  2. HiRez macrumors 603


    Jan 6, 2004
    Western US
    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.
  3. Antonios thread starter macrumors newbie

    Apr 15, 2007
    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.

Share This Page