private void initListeners() {
		automaton.addTransitionListener(new AutomataTransitionListener() {
			public void automataTransitionChange(AutomataTransitionEvent e) {
				if (!e.isAdd()) {
					return;
				}
				Transition transition = e.getTransition();
				if (!tToP.containsKey(transition)
						|| alreadyDone.contains(tToP.get(transition))) {
					javax.swing.JOptionPane.showMessageDialog(parent,
							"That transition is not correct!");
					automaton.removeTransition(transition);
				} else {
					Production p = (Production) tToP.get(transition);
					alreadyDone.add(p);
					grammarView.setChecked(p, true);
				}
			}
		});

		grammarView.addSelectionListener(new SelectionListener() {
			public void selectionChanged(SelectionEvent event) {
				Production[] p = grammarView.getSelected();
				drawer.clearSelected();
				for (int i = 0; i < p.length; i++) {
					drawer.addSelected((Transition) pToT.get(p[i]));
				}
				parent.repaint();
			}
		});
	}