| 2 requests with 4 commands each. I loose 3 of the 8 [message #213208] | 
Mon, 03 April 2006 18:30   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 19:49   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.05634 seconds