I am currently trying to replicate functionality for a ‘pipe’ component. The pipe component is a resizable component that has connection points at the start, middle and end and and is capable of being waypointed, adding points to the line to allow the user to shape it. Looking at the go objects it is most similar to a gostroke, the gostroke object has alot of inbuilt functionality that would help us replicate the pipe model.
So what I need to do is get an instance of a gostroke and place ports at the ends and centre of the stroke. The problems I have are as follows
- I cannot add the ports to the stroke as I can with for example a go simple node
- I cannot add the ports and group the objects so that the ports move with the stroke as we have a layer manager and as far as I understand as soon as I add the ‘pipe’ to the layer manager it will ungroup the stroke and the ports
- I can position ports at the ends and centre and use events in the view class to reposition the ports but this results in the code getting rather messy and fragmented, I would prefer to keep it all in a pipe class.
I have considered using a golink but then we have other default functionality that is a problem and I still have the problem of repositiong etc. the port at the centre of the link so I think go strokes would be the best thing to use
I can think of some rather complicated ways around this but I would prefer to keep it as elegant and simple as possible (if at all possible), do you have any ideas / thoughts on how we could make this work effectively.