applyTo method

  1. @override
void applyTo(
  1. DiagramDocumentBatch batch
)

Implementation

@override
void applyTo(DiagramDocumentBatch batch) {
  final current = batch.elementById(before.id);
  if (before.id != after.id) {
    throw StateError('Replacement must preserve element identity.');
  }
  if (current != before) {
    throw StateError('Element ${before.id} changed before the step applied.');
  }
  batch.replace(after);
}