Ejemplo n.º 1
0
  private Style getStyle(final Field f) {
    final boolean isInput = f instanceof InputField;
    if (f.isHidden()) {
      return styleHidden;
    }

    if (isInput) {
      final InputField inputField = (InputField) f;
      if (inputField.isChanged()) {
        return styleInputChanged;
      } else {
        return styleInput;
      }
    }

    final int i = (f.getExtendedColor() == 0) ? 0 : f.getExtendedColor() - 0xf0;
    Color foregroundColor = extendedColors[i];
    Color backgroundColor = Color.black;
    if (f.getExtendedHighlight() == Field.ATTR_EH_REV_VIDEO) {
      final Color tmp = backgroundColor;
      backgroundColor = foregroundColor;
      foregroundColor = tmp;
    }
    boolean isUnderline = f.getExtendedHighlight() == Field.ATTR_EH_UNDERSCORE;

    if (f.isIntensified()) {
      foregroundColor = Color.white;
    }
    return createStyle(foregroundColor, backgroundColor, isUnderline);
  }