background = style.backgroundOpen;
else if (clickListener.isOver() && style.backgroundOver != null)
background = style.backgroundOver;
else
background = style.background;
final BitmapFont font = style.font;
final Color fontColor = (disabled && style.disabledFontColor != null) ? style.disabledFontColor : style.fontColor;
Color color = getColor();
float x = getX();
float y = getY();
float width = getWidth();
float height = getHeight();
batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
background.draw(batch, x, y, width, height);
T selected = this.selected != null ? this.selected : selection.first();
if (selected != null) {
float availableWidth = width - background.getLeftWidth() - background.getRightWidth();
String string = selected.toString();
int numGlyphs = font.computeVisibleGlyphs(string, 0, string.length(), availableWidth);
bounds.set(font.getBounds(string));
height -= background.getBottomHeight() + background.getTopHeight();
float textY = (int)(height / 2 + background.getBottomHeight() + bounds.height / 2);
font.setColor(fontColor.r, fontColor.g, fontColor.b, fontColor.a * parentAlpha);
font.draw(batch, string, x + background.getLeftWidth(), y + textY, 0, numGlyphs);
}
}