@Override public void redo () throws CannotRedoException { super.redo (); if (oldParent != null) oldParent.removeComponent (child); if (newParent != null) newParent.addComponent (child); }
@Override public void undo () throws CannotUndoException { super.undo (); if (newParent != null) newParent.removeComponent (child); if (oldParent != null) oldParent.addComponent (child); }
/** * Removes the component from its parent component. */ public void removeFromParentComponent () { assert document.getTransactionManager ().isWriteAccess (); if (parentComponent != null) parentComponent.removeComponent (this); }
public void run() { if (DEBUG) System.out.println("animatedTileRemoved: " + tile); // NOI18N DesignComponent dcAnimTile = designIdMap.get(tile); assert (dcAnimTile != null); DesignComponent dcImgRes = designIdMap.get(imgRes); assert (dcImgRes != null); dcImgRes.removeComponent(dcAnimTile); List<DesignComponent> tmp = new ArrayList<DesignComponent>(dcAnimTile.getComponents()); for (DesignComponent child : tmp) { changeMap.put(child.getComponentID(), null); dcAnimTile.removeComponent(child); document.deleteComponent(child); } document.deleteComponent(dcAnimTile); //update the image resource holding the animated tile changeMap.put(dcImgRes.getComponentID(), ImageResourceCD.PROPERTY_NAME); } });
dcSequenceContainer.removeComponent(dcSequence);