code: protected void setPropertiesFromAttributes(AttributeSet attr)
      {
          if (attr != null)
          {
              Font newFont = (Font) attr.getAttribute(Constants.ATTRIBUTE_FONT);
              if (newFont != null)
              {
                  setFont(newFont);
              }
              else
              {
                  // the font is the most important for us
                  throw new IllegalStateException("Font can not be null !");
              }
  
              setForeground((Color) attr.getAttribute(Constants.ATTRIBUTE_FOREGROUND));
              setFontVariant((String) attr.getAttribute(Constants.ATTRIBUTE_FONT_VARIANT));
  
              @SuppressWarnings("unchecked")
              List<TextDecoration> attribute = (List<TextDecoration>) attr.getAttribute(Constants.ATTRIBUTE_TEXT_DECORATION);
              setTextDecoration(attribute);
          }
      }
docs: Sets the properties from the attributes.
  
  @param attr
  the new properties from attributes