@SuppressWarnings("unchecked") // FIXME in Java7
    public BuildQueuePanel(FreeColClient freeColClient, GUI gui, Colony colony) {

        super(freeColClient, gui, new MigLayout("wrap 3", "[260:][390:, fill][260:]", "[][][300:400:][]"));
        this.colony = colony;
        this.unitCount = colony.getUnitCount();
        featureContainer = new FeatureContainer();

        for (UnitType unitType : getSpecification().getUnitTypeList()) {
            if (!(unitType.getGoodsRequired().isEmpty()
                  || unitType.hasAbility(Ability.BORN_IN_COLONY))) {
                // can be built
                buildableUnits.add(unitType);
            }
        }

        DefaultListModel current = new DefaultListModel();
        for (BuildableType type : colony.getBuildQueue()) {
            current.addElement(type);
            FeatureContainer.addFeatures(featureContainer, type);
        }

        cellRenderer = getCellRenderer();

        // remove previous listeners
        for (ItemListener listener : compact.getItemListeners()) {
            compact.removeItemListener(listener);
        }
        compact.setText(Messages.message("colonyPanel.compactView"));
        compact.addItemListener(this);

        // remove previous listeners
        for (ItemListener listener : showAll.getItemListeners()) {
            showAll.removeItemListener(listener);
        }
        showAll.setText(Messages.message("colonyPanel.showAll"));
        showAll.addItemListener(this);

        buildQueueList = new JList(current);
        buildQueueList.setTransferHandler(buildQueueHandler);
        buildQueueList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        buildQueueList.setDragEnabled(true);
        buildQueueList.setCellRenderer(cellRenderer);
        buildQueueList.addMouseListener(new BuildQueueMouseAdapter(false));

        Action deleteAction = new AbstractAction() {
                @SuppressWarnings("deprecation") // FIXME in Java7
                public void actionPerformed(ActionEvent e) {
                    for (Object type : buildQueueList.getSelectedValues()) {
                        removeBuildable(type);
                    }
                    updateAllLists();
                }
            };

        buildQueueList.getInputMap().put(KeyStroke.getKeyStroke("DELETE"), "delete");
        buildQueueList.getActionMap().put("delete", deleteAction);

        Action addAction = new AbstractAction() {
                @SuppressWarnings("deprecation") // FIXME in Java7
                public void actionPerformed(ActionEvent e) {
                    DefaultListModel model = (DefaultListModel) buildQueueList.getModel();
                    for (Object type : ((JList) e.getSource()).getSelectedValues()) {
                        model.addElement(type);
                    }
                    updateAllLists();
                }
            };

        BuildQueueMouseAdapter adapter = new BuildQueueMouseAdapter(true);
        DefaultListModel units = new DefaultListModel();
        unitList = new JList(units);
        unitList.setTransferHandler(buildQueueHandler);
        unitList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        unitList.setDragEnabled(true);
        unitList.setCellRenderer(cellRenderer);
        unitList.addMouseListener(adapter);

        unitList.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "add");
        unitList.getActionMap().put("add", addAction);

        DefaultListModel buildings = new DefaultListModel();
        buildingList = new JList(buildings);
        buildingList.setTransferHandler(buildQueueHandler);
        buildingList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        buildingList.setDragEnabled(true);
        buildingList.setCellRenderer(cellRenderer);
        buildingList.addMouseListener(adapter);

        buildingList.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "add");
        buildingList.getActionMap().put("add", addAction);

        JLabel headLine = new JLabel(Messages.message("colonyPanel.buildQueue"));
        headLine.setFont(bigHeaderFont);

        buyBuilding = new JButton(Messages.message("colonyPanel.buyBuilding"));
        buyBuilding.setActionCommand(BUY);
        buyBuilding.addActionListener(this);

        constructionPanel = new ConstructionPanel(gui, colony, false);
        constructionPanel.setOpaque(false);
        StringTemplate buildingNothing = StringTemplate.template("colonyPanel.currentlyBuilding")
            .add("%buildable%", "nothing");
        constructionPanel.setDefaultLabel(buildingNothing);

        updateAllLists();

        add(headLine, "span 3, align center, wrap 40");
        add(new JLabel(Messages.message("colonyPanel.units")), "align center");
        add(new JLabel(Messages.message("colonyPanel.buildQueue")), "align center");
        add(new JLabel(Messages.message("colonyPanel.buildings")), "align center");
        add(new JScrollPane(unitList), "grow");
        add(constructionPanel, "split 2, flowy");
        add(new JScrollPane(buildQueueList), "grow");
        add(new JScrollPane(buildingList), "grow, wrap 20");
        add(buyBuilding, "span, split 4");
        add(compact);
        add(showAll);
        add(okButton, "tag ok");
    }