*
* @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#paintFigure(org.eclipse.draw2d.Graphics,
* org.eclipse.draw2d.geometry.Rectangle)
*/
public void paintFigure(Graphics g, Rectangle rect) {
ICSSStyle style = this.getCSSStyle();
if (style == null) {
style = DefaultStyle.getInstance();
}
Object textAlign = style
.getStyleProperty(ICSSPropertyID.ATTR_TEXTALIGN);
if (ICSSPropertyMeta.NOT_SPECIFIED == textAlign) {
textAlign = "center"; //$NON-NLS-1$
}
Font font = style.getCSSFont().getSwtFont();
g.setFont(font);
int fontHeight = FigureUtilities.getFontMetrics(font).getHeight();
Color newColor = null;
Object color = style.getColor();
if (color instanceof Color) {
g.setForegroundColor((Color) color);
} else if (color instanceof RGB) {
newColor = new Color(Display.getCurrent(), (RGB) color);
g.setForegroundColor(newColor);