Refresh a figure [message #165161] |
Wed, 12 December 2007 12:14 |
Marc Gil 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!
|
|
|
Powered by
FUDForum. Page generated in 0.02753 seconds