if (field.isVisible()) {
Form.Flag flag = Form.getFlag(field);
if (flag != null) {
if (showFlagIcons) {
MessageType messageType = flag.getMessageType();
Image flagIcon = null;
switch (messageType) {
case ERROR: {
flagIcon = errorIcon;
break;
}
case WARNING: {
flagIcon = warningIcon;
break;
}
case QUESTION: {
flagIcon = questionIcon;
break;
}
case INFO: {
flagIcon = infoIcon;
break;
}
default: {
flagIcon = infoIcon;
break;
}
}
Label label = labels.get(sectionIndex).get(fieldIndex);
int flagIconX = label.getX() - (flagIcon.getWidth() + flagIconOffset);
int flagIconY = label.getY() + (label.getHeight() - flagIcon.getHeight()) / 2;
graphics.translate(flagIconX, flagIconY);
flagIcon.paint(graphics);
graphics.translate(-flagIconX, -flagIconY);
}
if (showFlagHighlight) {
MessageType messageType = flag.getMessageType();
Color highlightColor = null;
switch (messageType) {
case ERROR: {
highlightColor = errorHighlightColor;