Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » 2 requests with 4 commands each. I loose 3 of the 8
2 requests with 4 commands each. I loose 3 of the 8 [message #213208] Mon, 03 April 2006 22:30 Go to next message
No real name is currently offline No real nameFriend
Messages: 9
Registered: July 2009
Junior Member
I have a box, with subBoxes. Both are placed in what I call Diagram, the
equivalent of a Graph, and the boxes would be vertices.

When I delete a subBox, all subsequent subBoxes must be moved, and the
box resized. I use a CompoundCommand:

1 - DeleteCommand : remove subBox from box (this could be skiped)
2 - DeleteCommand : remove subBox from the Diagram
3 - MoveCommand: move the following subBox (could be multiple of this)
4 - MoveCommand: resizes the box

Now, when I select two subboxes, 2 requests are created with the same
structure above, however, this is what is executed

Req1
1 - DeleteCommand : remove subBox from box (this could be skiped)
2 - DeleteCommand : remove subBox from the Diagram
Req2
1 - MoveCommand: move the following subBox (could be multiple of this)
2 - MoveCommand: resizes the box
3 - DeleteCommand : remove subBox from the Diagram

So I lost 3 commands. Any tips on how to debug this or why is this
happening? I've tried a few things already, but I'm puzzled

Would it help if I provided more detailed description? It would be a bit
long.


thanks
Re: 2 requests with 4 commands each. I loose 3 of the 8 [message #213218 is a reply to message #213208] Mon, 03 April 2006 23:49 Go to previous message
No real name is currently offline No real nameFriend
Messages: 9
Registered: July 2009
Junior Member
Ok, this is what I'm talking about. I have SubBoxComponentPolicy with
some code. Using the method bellow, I moved the code from
SubBoxComponentPolicy to BoxComponentPolicy

public Command getCommand(Request request) {
CompoundCommand cmd = new CompoundCommand();
if (request.getType().equals(REQ_DELETE)) {
Box box = (Box) getHost().getParent().getModel();
request.setType(REQ_DELETE_DEPENDANT);
Map m = new HashMap();
m.put("selectedElement", getHost().getModel());
request.setExtendedData(m);

cmd.add(getEditPart(box).getCommand(request));
}
else if (request.getType().equals(REQ_DELETE_DEPENDANT)) {
cmd.add (createDeleteCommand((GroupRequest)request));
}
return cmd;
}

Anyone had previous experience with this?

thanks
Previous Topic:GEF / Draw2d adoption of ICU4J
Next Topic:Displaying children figures on left and right hand sides of the splitter?
Goto Forum:
  


Current Time: Thu Apr 25 13:16:53 GMT 2024

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

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

Back to the top