} if(x<width){ graphics.setColor(Color.WHITE); graphics.fillRect(x, (y * 16) + 1 , width-1, (y + 1) * 16);
    public void setPartList(PartListDO partListDO) {        try        {            if (this.partListDO == partListDO)                return;            this.partListDO = partListDO;            if (partListDO == null){                image = new BufferedImage(getWidth(),getHeight(),BufferedImage.TYPE_INT_ARGB);                Graphics graphics = image.getGraphics();                height = getHeight();                width = getWidth();                graphics.setColor(getBackground());                graphics.fillRect(0, 0, width, height);            }            else            {                image = new BufferedImage(getWidth(),getHeight(),BufferedImage.TYPE_INT_ARGB);                Graphics graphics = image.getGraphics();                height = getHeight();                width = getWidth();                graphics.setColor(getBackground());                graphics.fillRect(0, 0, width, height);                int anzahlRows = getHeight() / 16;                int anzahlZeile = getWidth() / 2;                int anzahl = anzahlRows * anzahlZeile;                int groesseProPart;                int anzahlParts;                if (partListDO.getGroesse() > anzahl)                {                    groesseProPart = (int) partListDO.getGroesse() / anzahl;                    anzahlParts = anzahl;                }                else                {                    groesseProPart = 1;                    anzahlParts = (int) partListDO.getGroesse();                }                int bisher = 0;                int x = 1;                int y = 0;                long position = 0;                int partPos = 0;                PartListDO.Part[] parts = partListDO.getParts();                long mbStart;                long mbEnde;                int kleiner;                int groesstes;                boolean ueberprueft;                while (bisher < anzahlParts)                {                    bisher++;                    if (x >= anzahlZeile * 2 - 2)                    {                        y++;                        x = 1;                    }                    position += groesseProPart;                    while (parts[partPos].getFromPosition() < position && partPos < parts.length - 1)                    {                        partPos++;                    }                    if (partPos>0)                        partPos--;                    if (parts[partPos].getType() == -1 && partListDO.getPartListType()==PartListDO.MAIN_PARTLIST)                    {                        mbStart = position / 1048576 * 1048576;                        mbEnde = mbStart + 1048576;                        kleiner = partPos;                        groesstes = partPos;                        while (parts[kleiner].getFromPosition() > mbStart && kleiner > 0)                        {                            kleiner--;                        }                        while (parts[groesstes].getFromPosition() < mbEnde && groesstes < parts.length - 1)                        {                            groesstes++;                        }                        groesstes--;                        ueberprueft = true;                        for (int l = kleiner; l <= groesstes; l++)                        {                            if (parts[l].getType() != -1)                            {                                ueberprueft = false;                                break;                            }                        }                        if (ueberprueft)                        {                            graphics.setColor(PartListDO.COLOR_TYPE_UEBERPRUEFT);                        }                        else                        {                            graphics.setColor(PartListDO.COLOR_TYPE_OK);                        }                    }                    else                    {                        graphics.setColor(getColorByType(parts[partPos].getType()));                    }                    graphics.fillRect(x, y * 16 +1 , x + 1, (y + 1) * 16);                    x += 2;                }            }            updateUI();        }        catch (Exception e)        {            if (logger.isEnabledFor(Level.ERROR))                logger.error("Unbehandelte Exception", e);        }    }