コード例 #1
0
 public void execute() {
   startIndex = oldContainer.getChildren().indexOf(child);
   oldContainer.removeChild(child);
   if (after != null) {
     destIndex = newContainer.getChildren().indexOf(after);
     newContainer.addChild(child, destIndex);
   } else {
     newContainer.addChild(child);
   }
 }
コード例 #2
0
 public void undo() {
   newContainer.removeChild(child);
   oldContainer.addChild(child, startIndex);
 }