- How can I restrict where to drag those child components? (for example, not outside the parent component, or not over/behind another child compoment like attack can't go over decay etc..)
It's been a while since I really looked at this code, but I think there are methods for getting the next, and previous handles. You can just test against their positions.
- How can I draw lines/curves between two points?
Lines ARE drawn between the points? See MyEnvelopeComponent::paint(Graphics& g), if you want curves just change the lineTo() call to a cubicTo, or quadTo, sorry I can't recall the name of those functions of the top of my head, check the docs.
- How can I draw a circle instead of a square to use as child component?
Look at MyEnvelopeHandleComponent::paint()