Hi,
This question is related to my SharedState question but I think it deserve it’s own thread.
Is it possible to control the ZOrder of nodes and links that are inside the same layer?
I’m looking for something like MoveAfter and MoveBefore methods that were on GoLayer in GoDiagram.
Also, in the GoXam documentation you write “A Layer holds a collection of parts that are drawn in (approximately) the same Z-order position” - why is it approximately ?
Not really. Sorry.
It says approximately, because the Z-order may change within a layer.
Of course the Z-ordering is maintained for any two objects in different layers.
I hadn’t thought about that being an impediment towards implementing something like Shared States, but I guess it is. I guess you could implement a DiagramPanel.ViewportBoundsChanged event handler to make sure all of the “Super” state nodes that are visible in the viewport are in the proper Z-order. (Having regular nodes be in a separate layer will help performance there.)
Hi,
I’m still trying to find a way to control the ZOrder of parts inside the same layer.
I am able to change the ZOrder by removing and adding the parts from the layer.
Currently I’m removing all the parts and then add them in the order I want them - which can’t be any worth for performance but it is working and changing the ZOrder.
If you can add a MoveBefore and MoveAfter methods to Layer which will move parts before and after other parts it will be much better - performance and code clear wise.
In order implement ZOrder I’ve created 20 layers for the container nodes (SuperNode) and I’ve bound the go<span =“s1”>:Part.LayerName to ContainerLayerID which is calculated according to the depth of the nesting of the container in other containers.
So the top-most container will be 0 and one it it will be 1 etc.
The problem is that is works, but not always. It is possible it’s a bug in my end, I’ve not exclude it yet.
Another thing is even after I’ll fix the first problem and have the containers order as require there will still be possibility that two (or more) containers in the same depth level will overlap each other. In this case I will like to implement “Bring To Front” behavior which require manipulation of ZOrder inside a layer.
I’m sure adding ZOrder abilities is not easy - it is pretty essential to me.
I have question about ZOrdering. I have a property ZOrder on my NodeData class. If I set the value at construction the drawing of the nodes on the diagram is perfect. The draw order matches the ZOrder. However if I change the ZOrder via the contextMenu I created (E.g. BringToFront, SendToBack) no changes is visible. According the diagram the ZOrder is still the same.
Which makes sense because the model is not aware of the ZOrder change.
How do I trigger the update to the model such that the new ZOrdering is applied?