    public void initialize() {
        Player player = getCanvas().getClient().getMyPlayer();
        colonies = player.getColonies();
        Collections.sort(colonies, getCanvas().getClient().getClientOptions().getColonyComparator());
        reportPanel.setLayout(new HIGLayout(new int[] {780}, new int[] {0}));
        JTextPane textPane = new JTextPane();
        textPane.setOpaque(false);
	textPane.setEditable(false);
        StyledDocument doc = textPane.getStyledDocument();
        defineStyles(doc);
        int numberUnitTypes = FreeCol.getSpecification().numberOfUnitTypes();
        int numberGoodsTypes = FreeCol.getSpecification().numberOfGoodsTypes();
        unitCount = new int[colonies.size()][numberUnitTypes];
        canTrain = new boolean[colonies.size()][numberUnitTypes];
        surplus = new int[colonies.size()][numberGoodsTypes];
        List<GoodsType> goodsTypes = FreeCol.getSpecification().getGoodsTypeList();
        for (int index = 0; index < colonies.size(); index++) {
            Colony colony = colonies.get(index);
            for (Unit unit : colony.getUnitList()) {
                unitCount[index][unit.getType()]++;
                canTrain[index][unit.getType()] = colony.canTrain(unit.getUnitType());
            }
            for (GoodsType goodsType : goodsTypes) {
                surplus[index][goodsType.getIndex()] = colony.getProductionNetOf(goodsType);
            }
        }
        for (int index = 0; index < colonies.size(); index++) {
            Colony colony = colonies.get(index);
            try {
                StyleConstants.setComponent(doc.getStyle("button"), createColonyButton(colony, true));
                doc.insertString(doc.getLength(), " ", doc.getStyle("button"));
                doc.insertString(doc.getLength(), "\n\n", doc.getStyle("regular"));
            } catch(Exception e) {
                logger.warning(e.toString());
            }
            boolean[] expertWarning = new boolean[numberUnitTypes];
            boolean[] productionWarning = new boolean[numberGoodsTypes];
            boolean hasWarning = false;
            Iterator<WorkLocation> workLocationIterator = colony.getWorkLocationIterator();
            while (workLocationIterator.hasNext()) {
                WorkLocation workLocation = workLocationIterator.next();
                if (workLocation instanceof ColonyTile) {
                    Unit unit = ((ColonyTile) workLocation).getUnit();
                    if (unit != null) {
                        GoodsType workType = unit.getWorkType();
                        UnitType expert = FreeCol.getSpecification().getExpertForProducing(workType);
                        int expertIndex = expert.getIndex();
                        if (unitCount[index][expertIndex] == 0 && !expertWarning[expertIndex]) {
                            addExpertWarning(doc, index, workType.getName(), expert);
                            expertWarning[expertIndex] = true;
                            hasWarning = true;
                        }
                    }
                } else {
                    Building building = (Building) workLocation;
                    GoodsType goodsType = building.getGoodsOutputType();
                    UnitType expert = building.getExpertUnitType();
                    int expertIndex = expert.getIndex();
                    int goodsIndex = goodsType.getIndex();
                    if (goodsType != null) {
                        if (building.getFirstUnit() != null &&
                            !expertWarning[expertIndex] &&
                            unitCount[index][expertIndex] == 0) {
                            addExpertWarning(doc, index, goodsType.getName(), expert);
                            expertWarning[expertIndex] = true;
                            hasWarning = true;
                        }
                        if (building.getProductionNextTurn() < building.getMaximumProduction() &&
                            !productionWarning[goodsIndex]) {
                            addProductionWarning(doc, index, goodsType, building.getGoodsInputType());
                            productionWarning[goodsIndex] = true;
                            hasWarning = true;
                        }
                    }
                }
            }
            if (!hasWarning) {
                try {
                    doc.insertString(doc.getLength(), Messages.message("report.requirements.met") + "\n\n",
                                     doc.getStyle("regular"));
                } catch(Exception e) {
                    logger.warning(e.toString());
                }
            }
            reportPanel.add(textPane, higConst.rc(1, 1));
        }
        textPane.setCaretPosition(0);
    }

    public void initialize() {
        Player player = getCanvas().getClient().getMyPlayer();
        colonies = player.getColonies();
        Collections.sort(colonies, getCanvas().getClient().getClientOptions().getColonyComparator());
        reportPanel.setLayout(new HIGLayout(new int[] {780}, new int[] {0}));
        JTextPane textPane = new JTextPane();
        textPane.setOpaque(false);
        textPane.setEditable(false);
        StyledDocument doc = textPane.getStyledDocument();
        defineStyles(doc);
        int numberUnitTypes = FreeCol.getSpecification().numberOfUnitTypes();
        int numberGoodsTypes = FreeCol.getSpecification().numberOfGoodsTypes();
        unitCount = new int[colonies.size()][numberUnitTypes];
        canTrain = new boolean[colonies.size()][numberUnitTypes];
        surplus = new int[colonies.size()][numberGoodsTypes];
        List<GoodsType> goodsTypes = FreeCol.getSpecification().getGoodsTypeList();
        for (int index = 0; index < colonies.size(); index++) {
            Colony colony = colonies.get(index);
            for (Unit unit : colony.getUnitList()) {
                unitCount[index][unit.getType()]++;
                canTrain[index][unit.getType()] = colony.canTrain(unit.getUnitType());
            }
            for (GoodsType goodsType : goodsTypes) {
                surplus[index][goodsType.getIndex()] = colony.getProductionNetOf(goodsType);
            }
        }
        for (int index = 0; index < colonies.size(); index++) {
            Colony colony = colonies.get(index);
            try {
                StyleConstants.setComponent(doc.getStyle("button"), createColonyButton(colony, true));
                doc.insertString(doc.getLength(), " ", doc.getStyle("button"));
                doc.insertString(doc.getLength(), "\n\n", doc.getStyle("regular"));
            } catch(Exception e) {
                logger.warning(e.toString());
            }
            boolean[] expertWarning = new boolean[numberUnitTypes];
            boolean[] productionWarning = new boolean[numberGoodsTypes];
            boolean hasWarning = false;
            Iterator<WorkLocation> workLocationIterator = colony.getWorkLocationIterator();
            while (workLocationIterator.hasNext()) {
                WorkLocation workLocation = workLocationIterator.next();
                if (workLocation instanceof ColonyTile) {
                    Unit unit = ((ColonyTile) workLocation).getUnit();
                    if (unit != null) {
                        GoodsType workType = unit.getWorkType();
                        UnitType expert = FreeCol.getSpecification().getExpertForProducing(workType);
                        int expertIndex = expert.getIndex();
                        if (unitCount[index][expertIndex] == 0 && !expertWarning[expertIndex]) {
                            addExpertWarning(doc, index, workType.getName(), expert);
                            expertWarning[expertIndex] = true;
                            hasWarning = true;
                        }
                    }
                } else {
                    Building building = (Building) workLocation;
                    GoodsType goodsType = building.getGoodsOutputType();
                    UnitType expert = building.getExpertUnitType();
                    if (goodsType != null && expert!=null) {
                        int expertIndex = expert.getIndex();
                        if (building.getFirstUnit() != null &&
                            !expertWarning[expertIndex] &&
                            unitCount[index][expertIndex] == 0) {
                            addExpertWarning(doc, index, goodsType.getName(), expert);
                            expertWarning[expertIndex] = true;
                            hasWarning = true;
                        }
                    }
                    if (goodsType != null) {
                        int goodsIndex = goodsType.getIndex();
                        if (building.getProductionNextTurn() < building.getMaximumProduction() &&
                            !productionWarning[goodsIndex]) {
                            addProductionWarning(doc, index, goodsType, building.getGoodsInputType());
                            productionWarning[goodsIndex] = true;
                            hasWarning = true;
                        }
                    }
                }
            }
            if (!hasWarning) {
                try {
                    doc.insertString(doc.getLength(), Messages.message("report.requirements.met") + "\n\n",
                                     doc.getStyle("regular"));
                } catch(Exception e) {
                    logger.warning(e.toString());
                }
            }
            reportPanel.add(textPane, higConst.rc(1, 1));
        }
        textPane.setCaretPosition(0);
    }
