When creating a composite node, what are the conventions for setting the size of the node and the calculating the size of the child nodes. I have a GoTextNode dervied class which can has 4 decorators. the decorators are visible depending on the value of a user controlled variable. The decorators are a GoNode derived class which contain a GoRectangle and a GoTriangle. The triangle has to point in different directions depending on the side its on.
I’m currently setting the decorator to an initial size of 0,0 i.e. hidden. Then when the user changes a property I change the size to 50,10 or 10,50 depending on the side they want it on. But my layout is screwed up. The decorator is always placed on the bottom and the bounds of the GotTextNode class get bigger.
Can someone give me some guidelines as to how I should approach this?