禁用动画后,点击节点会改变布局

我设置了红框的两个属性,但是我点击的时候,节点会往上跳一段距离,有有没什么办法让禁止它跳动

Animation can be enabled or partly disabled (AnimationManager.isInitial). Layouts can be controlled by the value of Diagram.layout and its properties. Although layout animation is the most commonly seen built-in animation, they really are independent of each other.

I’m sorry, but I do not understand what the problem is. You have disabled layout invalidation for the case when a node changes size. Your Diagram layout is a TreeLayout, and it appears that it did not run after expanding the node panel. The node remains at the same location that it original had – you had specified the Node.locationSpot to be go.Spot.Left.

So what is the problem? It seems everything is behaving exactly as you told it to.

我一旦点击PanelExpanderButton按钮来展开详细,就会使树形条往上跳一段距离
初始位置:


点击后:
点击后实际要的效果:

Why did you set Node.locationSpot to be go.Spot.Left? Don’t set it at all – the default value is go.Spot.TopLeft.

好的,谢谢,现在它正常工作,还有一个问题再请教一下,怎么使第二个Tree默认往下排

It looks as if this is a different question. Could you put it into a separate forum topic, please? And explain what you want and how it is different from what you have.