public boolean undo(Set<Integer> p_changed_nets){
  brd_components.undo(observers);
  Collection<UndoObjectStorable> cancelled_objects=new LinkedList<UndoObjectStorable>();
  Collection<UndoObjectStorable> restored_objects=new LinkedList<UndoObjectStorable>();
  boolean result=undo_items.undo(cancelled_objects,restored_objects);
  Iterator<UndoObjectStorable> iter=cancelled_objects.iterator();
  while (iter.hasNext()) {
    BrdItem curr_item=(BrdItem)iter.next();
    search_tree_manager.remove(curr_item);
    observers.notify_deleted(curr_item);
    if (p_changed_nets != null) {
      for (int i=0; i < curr_item.net_count(); ++i) {
        p_changed_nets.add(new Integer(curr_item.get_net_no(i)));
      }
    }
  }
  iter=restored_objects.iterator();
  while (iter.hasNext()) {
    BrdItem curr_item=(BrdItem)iter.next();
    curr_item.set_transient_field(this);
    curr_item.art_item_clear();
    search_tree_manager.insert(curr_item);
    observers.notify_new(curr_item);
    if (p_changed_nets != null) {
      for (int i=0; i < curr_item.net_count(); ++i) {
        p_changed_nets.add(new Integer(curr_item.get_net_no(i)));
      }
    }
  }
  return result;
}

public boolean undo ( Set < Integer > p_changed_nets ) { brd_components . undo ( observers ) ; Collection < UndoObjectStorable > cancelled_objects = new LinkedList < UndoObjectStorable > ( ) ; Collection < UndoObjectStorable > restored_objects = new LinkedList < UndoObjectStorable > ( ) ; boolean result = undo_items . undo ( cancelled_objects , restored_objects ) ; Iterator < UndoObjectStorable > iter = cancelled_objects . iterator ( ) ; while ( iter . hasNext ( ) ) { BrdItem curr_item = ( BrdItem ) iter . next ( ) ; search_tree_manager . remove ( curr_item ) ; observers . notify_deleted ( curr_item ) ; if ( p_changed_nets != null ) { for ( int i = 0 ; i < curr_item . net_count ( ) ; ++ i ) { p_changed_nets . add ( new Integer ( curr_item . get_net_no ( i ) ) ) ; } } } iter = restored_objects . iterator ( ) ; while ( iter . hasNext ( ) ) { BrdItem curr_item = ( BrdItem ) iter . next ( ) ; curr_item . set_transient_field ( this ) ; curr_item . art_item_clear ( ) ; search_tree_manager . insert ( curr_item ) ; observers . notify_new ( curr_item ) ; if ( p_changed_nets != null ) { for ( int i = 0 ; i < curr_item . net_count ( ) ; ++ i ) { p_changed_nets . add ( new Integer ( curr_item . get_net_no ( i ) ) ) ; } } } return result ; }
restores the situation at the previous snapshot . returns false , if no more undo is possible . puts the numbers of the changed nets into the set p_changed_nets , if p_changed_nets ! = null
