Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Refresh a figure
Refresh a figure [message #165161] Wed, 12 December 2007 12:14
Marc Gil is currently offline Marc GilFriend
Messages: 81
Registered: July 2009
Member
Hi!
I have the following problem. I have a figure A (it's a rectangle) and I
can add a figure B (a little rectangle) that it's located in the exterior
of the figure A. As following is shown...

|-------|
| |---|
| A | B |
|-------|---|

When I create the figure B (his container is A), it doesn't appear in the
diagram until I move manually the figure A. It seems a refresh problem.

In the AItemSemanticEditPolicy, I override the 'getCreateCommand' method
and I put the following code:

protected Command getCreateCommand(CreateElementRequest req)
{
CompoundCommand cc = new CompoundCommand();

cc.add(getGEFWrapper(new BCreateCommand(req)));

SetBoundsCommand sbc = new SetBoundsCommand(
this.getEditingDomain(), "Relocate A", getHost(), new Point(100, 100);
cc.add(getGEFWrapper(sbc));

RefreshEditPartCommand repc = new
RefreshEditPartCommand((GraphicalEditPart)getHost());
cc.add(repc);

return cc;
}

First, I insert the create command of the figure B.
Second, I insert a programatically move command of the figure A.
And finally, I insert a refresh command of the figure A.

The figure A is moved, but the figure B is never shown until I move A
manually. Can somebody help me, please?
Thanks a lot!
Previous Topic:How to change font n size of text on diagram
Next Topic:Listening for focus change events
Goto Forum:
  


Current Time: Fri Apr 26 17:39:35 GMT 2024

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

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

Back to the top