public void render(GeneralGC gc, Rectangle visibleRegion)
{
// TODO maybe draw switch state too?
public void render(GeneralGC gc, Rectangle visibleRegion)
{
// TODO maybe draw switch state too?
Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());
gc.setFont(labelFont);
Point textExtent = gc.textExtent(label);
Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());
gc.setFont(labelFont);
Point textExtent = gc.textExtent(label);
if (textColor != null)
gc.setForeground(textColor);
gc.drawText(label, getPosX() + (width - textExtent.x) / 2, getPosY() + (height - textExtent.y) / 2, true);
if (textColor != null)
gc.setForeground(textColor);
gc.drawText(label, getPosX() + (width - textExtent.x) / 2, getPosY() + (height - textExtent.y) / 2, true);