this.formatAndRoutesModel = formatAndRoutesModel;
initialize(table);
}
private void initialize(final JTable table) {
formatAndRoutesModel.addListDataListener(new ListDataListener() {
public void intervalAdded(ListDataEvent e) {
for (int i = e.getIndex0(); i <= e.getIndex1(); i++) {
BaseRoute route = formatAndRoutesModel.getRoute(i);
JMenuItem menuItem = new JMenuItem(new MergePositionListAction(table, route, formatAndRoutesModel));
menuItem.setText(shortenRouteName(route));