if (color != null) attributes.put(key, colorToHex(color));
if (font == null) return attributes; attributes.put(Style.FONT_FAMILY, font.getFace());  int style = Font.PLAIN; if ((font.getStyle() & Font.ITALIC) > 0) attributes.put(Style.FONT_STYLE, "italic");  if ((font.getStyle() & Font.BOLD) > 0) attributes.put(Style.FONT_WEIGHT, "bold");  attributes.put(Style.FONT_SIZE, font.getSize() + "pt");
    public static AttributeSet getAttributes(Color color, String key) {	AttributeSet attributes = new SimpleAttributeSet();	if (color != null)	    attributes.put(key, colorToHex(color));	return attributes;    }