public static void become(Automaton dest, Automaton src){
		
		dest.clear();
		// Copy over the states.
		HashMap map = new HashMap(); // Old states to new states.
		Iterator it = src.states.iterator();
		while (it.hasNext()) {
			State state = (State) it.next();
			State nstate = new State(state.getID(),
					new Point(state.getPoint()), dest);
			nstate.setLabel(state.getLabel());
			nstate.setName(state.getName());
			map.put(state, nstate);
			dest.addState(nstate);
		}
		// Set special states.
		it = src.finalStates.iterator();
		while (it.hasNext()) {
			State state = (State) it.next();
			dest.addFinalState((State) map.get(state));
		}
		dest.setInitialState((State) map.get(src.getInitialState()));

		// Copy over the transitions.
		it = src.states.iterator();
		while (it.hasNext()) {
			State state = (State) it.next();
			Transition[] ts = src.getTransitionsFromState(state);
			State from = (State) map.get(state);
			for (int i = 0; i < ts.length; i++) {
				State to = (State) map.get(ts[i].getToState());
                Transition toBeAdded = (Transition) ts[i].clone(); //call clone instead of copy so that the gui stuff can get appropriately updated
                toBeAdded.setFromState(from);
                toBeAdded.setToState(to);
//				dest.addTransition(ts[i].copy(from, to));
				dest.addTransition(toBeAdded);
			}
		}
		for(int k = 0; k < src.getNotes().size(); k++){
			Note curNote = (Note)src.getNotes().get(k);		
			dest.addNote(new Note(curNote.getAutoPoint(), curNote.getText()));
            ((Note)dest.getNotes().get(k)).initializeForView(curNote.getView());
		}
        dest.setEnvironmentFrame(src.getEnvironmentFrame());
	}