} else { cBack = Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
if (cdCurrent != null && bUseColor) { cFore = new Color(this.getDisplay(), cdCurrent.getRed(), cdCurrent.getGreen(), cdCurrent.getBlue()); } else { cFore = new Color(this.getDisplay(), 0, 0, 0); }
    public void paintControl(PaintEvent pe)    {        Font fSize = null;        Font fCurrent = null;        Color cFore = null;        Color cBack = null;        GC gc = pe.gc;        Font fOld = gc.getFont();        if (cdCurrent != null && bUseColor)        {            cFore = new Color(this.getDisplay(), cdCurrent.getRed(), cdCurrent.getGreen(), cdCurrent.getBlue());        }        else        {            cFore = new Color(this.getDisplay(), 0, 0, 0);        }        if (this.isEnabled())        {            cBack = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND);        }        else        {            cBack = Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);        }        gc.setForeground(cFore);        gc.setBackground(cBack);        gc.fillRectangle(0, 0, this.getSize().x, this.getSize().y);        if (fdCurrent != null)        {            // Handle styles            int iStyle = (fdCurrent.isBold()) ? SWT.BOLD : SWT.NORMAL;            iStyle |= (fdCurrent.isItalic()) ? SWT.ITALIC : iStyle;            String sFontName = fdCurrent.getName();            if (!bUseSize)            {                gc.setClipping(2, 2, this.getSize().x - 40, 26);                fCurrent = new Font(this.getDisplay(), fdCurrent.getName(), fOld.getFontData()[0].getHeight(), iStyle);            }            else            {                fCurrent = new Font(this.getDisplay(), fdCurrent.getName(), (int) fdCurrent.getSize(), iStyle);            }            gc.setFont(fCurrent);            // Calculate the location to render text            int iStartX = 5;            int iStartY = 3;            if (bUseAlignment)            {                if (fdCurrent.getAlignment().getHorizontalAlignment().equals(HorizontalAlignment.LEFT_LITERAL))                {                    iStartX = 5;                }                else if (fdCurrent.getAlignment().getHorizontalAlignment().equals(HorizontalAlignment.CENTER_LITERAL))                {                    iStartX = this.getSize().x / 2 - (getStringWidth(gc, sFontName).x / 2);                }                else if (fdCurrent.getAlignment().getHorizontalAlignment().equals(HorizontalAlignment.RIGHT_LITERAL))                {                    iStartX = this.getSize().x - getStringWidth(gc, sFontName).x;                }                if (fdCurrent.getAlignment().getVerticalAlignment().equals(VerticalAlignment.TOP_LITERAL))                {                    iStartY = 3;                }                else if (fdCurrent.getAlignment().getVerticalAlignment().equals(VerticalAlignment.CENTER_LITERAL))                {                    iStartY = (this.getSize().y / 2);                    if (bUseSize)                    {                        iStartY -= (getStringWidth(gc, sFontName).y / 2);                    }                    else                    {                        iStartY -= 15;                    }                }                else if (fdCurrent.getAlignment().getVerticalAlignment().equals(VerticalAlignment.BOTTOM_LITERAL))                {                    iStartY = this.getSize().y;                    if (bUseSize)                    {                        iStartY -= (getStringWidth(gc, sFontName).y);                    }                    else                    {                        iStartY -= 30;                    }                }            }            gc.drawText(sFontName, iStartX, iStartY);            if (fdCurrent.isUnderline())            {                gc.drawLine(iStartX, iStartY + getStringWidth(gc, sFontName).y - gc.getFontMetrics().getDescent(),                    iStartX + getStringWidth(gc, sFontName).x - gc.getFontMetrics().getDescent(), iStartY                        + getStringWidth(gc, sFontName).y - gc.getFontMetrics().getDescent());            }            if (fdCurrent.isStrikethrough())            {                gc.drawLine(iStartX, iStartY + (getStringWidth(gc, sFontName).y / 2) + 1, iStartX                    + getStringWidth(gc, sFontName).x, iStartY + (getStringWidth(gc, sFontName).y / 2) + 1);            }            if (!bUseSize)            {                gc.setClipping(1, 1, this.getSize().x, this.getSize().y);                fSize = new Font(this.getDisplay(), "Sans-Serif", 10, SWT.NORMAL); //$NON-NLS-1$                gc.setFont(fSize);                gc.drawText("(" + String.valueOf(fdCurrent.getSize()) + ")", this.getSize().x - 36, 3); //$NON-NLS-1$ //$NON-NLS-2$                fSize.dispose();            }            fCurrent.dispose();        }        cFore.dispose();        gc.setFont(fOld);    }