Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to programmatically arrange diagram after expanding container editpart?
How to programmatically arrange diagram after expanding container editpart? [message #149475] Fri, 07 September 2007 12:07 Go to next message
Eclipse UserFriend
Hi,

My diagram has some container nodes which are collapsed initially. Each
container node has a shape compartment. When selecting and expanding a
container, the compartment displays the children and connections among
them. After expanding, the container node become much larger because it
has many children. This causes overlapping with other nodes in the diagram.

Manually invoking "Arrange All" on main canvas worked well, but I tried to
programmatically arrange all nodes after expansion for convenience.
Following GMF runtime "Arrange All" action,I copied most of Arrange All
code to my action for experiment. For some unknown reasons, it did not
work because overlapping still occurred. The only difference I can think
about is I had one container selected while calling "Arrange All" on
canvas had no selection. Not sure if this was related because I did set
DiagramEditPart to operation set which I believed that was what Arrange
All ended up doing for operation set.

Strange enough, if I add some code to pop up any message dialog ( for
example, standard Eclipse info message dialog ) in my action before
executing arrange command, diagram was arranged well without overlapping.

Does anybody have similar problem ? Any help will be greatly appreciated.

Li
Problem solved [message #149480 is a reply to message #149475] Fri, 07 September 2007 16:14 Go to previous message
Eclipse UserFriend
I did two steps layout :
1. The action first expanded container and then asked the container to
layout its children.
2. The action then asked arrange all for the whole diagram.

It turned out that after step1, the container size did not get updated. So
step2 still used the size of collapsed container by layout provider. By
forcing a validate on diagram, the size was updated and the overlapping
was gone :)

Li
Previous Topic:Cant generate code after adding BasicFont to a custom figure
Next Topic:How to stop Connection from moving when Nodes are moved?
Goto Forum:
  


Current Time: Sat Jul 19 10:10:37 EDT 2025

Powered by FUDForum. Page generated in 0.05840 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top