td = data.get(sel); for ( Iterator<Character> it = td.getChars().iterator(); it.hasNext(); ) { res.append(it.next()); if (it.hasNext()) res.append(",");
td = data.get(backend.get(sel)); for ( Character c : td.getChars() ) { res.append(c); res.append(",");
    public void run() {                // listpanel enthlt die Liste mit allen Transitionen, darunter ein        // Textfeld zur Bearbeitung der Transitionszeichen        transList = new JList();        transChars = new JTextField();                listMod = new DefaultListModel();                for (int i = 0 ; i < data.size() ; i++ ) {            listMod.addElement(data.get(i));        }                transList.setModel(listMod);        transList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);                JPanel listPanel = new JPanel();                listPanel.setLayout(new BorderLayout());                listPanel.add(transList, BorderLayout.CENTER);        listPanel.add(transChars, BorderLayout.SOUTH);                JPanel buttonPanel = new JPanel();                buttonPanel.setLayout(new GridLayout(1,3));                delButton = new JButton(java.util.ResourceBundle.getBundle("global").getString("remove"));        updateButton = new JButton(java.util.ResourceBundle.getBundle("global").getString("update"));        okButton = new JButton(java.util.ResourceBundle.getBundle("global").getString("OK"));                buttonPanel.add(okButton);        buttonPanel.add(updateButton);        buttonPanel.add(delButton);                okButton.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent event) {                dispose();            }        });                delButton.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent event) {                int sel = transList.getSelectedIndex();                if (sel!=-1) {                    // !!!! wir arbeiten auf der Originalreferenz, die Transition ist dann                    // tatschlich hin :)                    data.remove(sel);                    listMod.remove(sel);                    transList.setSelectedIndex(listMod.size()-1);                    if (listMod.isEmpty()) {                        delButton.setEnabled(false);                    }                }            }        });                updateButton.addActionListener(new ActionListener()  {            public void actionPerformed(ActionEvent event) {                Vector<Character> newChars;                int sel = transList.getSelectedIndex();                                if (sel!=-1) {                    newChars = AutWindow.parseTransChars(transChars.getText());                                        // wenn != null, war zumindest ein sinniges Zeichen dabei                    if (newChars!=null) {                        data.get(sel).setChars(newChars);                        listMod.setElementAt(data.get(sel).toString(), sel);                    }                }            }        });                transList.addListSelectionListener(new ListSelectionListener() {            public void valueChanged(ListSelectionEvent lEvent) {                int sel = transList.getSelectedIndex();                TransitionData td;                StringBuffer res = new StringBuffer();                                // da wir vom User erwarten das er die Zeichen so eingibt wie wir                // es gerne htten, mssen auch wir wohl oder bel den Char-Vec etwas anhbschen                if (sel!=-1) {                    td = data.get(sel);                    for ( Iterator<Character> it = td.getChars().iterator(); it.hasNext(); ) {                        res.append(it.next());                        if (it.hasNext()) res.append(",");                    }                                        transChars.setText(res.toString());                }            }        });                getContentPane().setLayout(new BorderLayout());                getContentPane().add(listPanel, BorderLayout.CENTER);        getContentPane().add(buttonPanel, BorderLayout.SOUTH);                setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);        pack();        setLocation(80,80);        setSize(250,200);        setVisible(true);            }