ZOrder of nodes and links inside the same layer

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 ?

Thank you,
Ido

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.)

Can you explain about it some more?
How can I make sure that the visible super nodes are in the proper Z-order if I can’t change it programmatically ?

Also, why having separate layers help performance?

Thank you,
Ido.

OK, try using a different Layer for each depth of Super state node.

You can dynamically add Layers as needed. This is probably no more work than trying to specify the Z-order, and it will work reliably.

I’ve create 20 layers for the containers and set the LayerName to the string Container+[Depth Of Container].

This works, but it is limited.
If you do plan to have ZOrder inside a layer I’ll be glad to know.

Thank you very much,
Ido.

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.

Thank you,
Ido.

We hear you.

Hi,
I’m having problem with the ZOrder again - is it a possibility to add children ordering methods to the layer?

Thank you,
Ido.

It’s not an easy addition, in general. What problem are you having now?

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.

Thank you,
Ido.

Hi,

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?

Thanks for your effort.

Mathijs

First, I want to make clear that we added the Node.ZOrder property many years ago. GoXam for WPF 2.2.4

Second, do you have a Binding of this property?

Third, when you make changes to your data’s properties, do you wrap all of the code in a transaction?

Hi Walter,

Yes I bind the ZOrder to a property on the underlying VM.

No currently I do not wrap the changes in a transaction. Is there an example somewhere in the samples demo?

Kind regards,

Mathijs

Search for StartTransaction and CommitTransaction. Also in the GoXamIntro.pdf document.

Thanks. I will have a look