public Font(Properties attributes) { this(UNDEFINED, UNDEFINED, UNDEFINED, null); String value; if ((value = attributes.getProperty(ElementTags.FONT)) != null) { setFamily(value); } if ((value = attributes.getProperty(ElementTags.SIZE)) != null) { setSize(Float.valueOf(value + "f").floatValue()); } if ((value = attributes.getProperty(ElementTags.STYLE)) != null) { setStyle(value); } String r = attributes.getProperty(ElementTags.RED); String g = attributes.getProperty(ElementTags.GREEN); String b = attributes.getProperty(ElementTags.BLUE); if (r != null || g != null || b != null) { int red = 0; int green = 0; int blue = 0; if (r != null) red = Integer.parseInt(r); if (g != null) green = Integer.parseInt(g); if (b != null) blue = Integer.parseInt(b); setColor(new Color(red, green, blue)); } else if ((value = attributes.getProperty(ElementTags.COLOR)) != null) { setColor(ElementTags.decodeColor(value)); }
public Font(int family, float size, int style, Color color) { this.family = family; this.size = size; this.style = style; this.color = color;
    public Font(Properties attributes) {        this(UNDEFINED, UNDEFINED, UNDEFINED, null);        String value;        if ((value = attributes.getProperty(ElementTags.FONT)) != null) {            setFamily(value);        }        if ((value = attributes.getProperty(ElementTags.SIZE)) != null) {            setSize(Float.valueOf(value + "f").floatValue());        }        if ((value = attributes.getProperty(ElementTags.STYLE)) != null) {            setStyle(value);        }        String r = attributes.getProperty(ElementTags.RED);        String g = attributes.getProperty(ElementTags.GREEN);        String b = attributes.getProperty(ElementTags.BLUE);        if (r != null || g != null || b != null) {            int red = 0;            int green = 0;            int blue = 0;            if (r != null) red = Integer.parseInt(r);            if (g != null) green = Integer.parseInt(g);            if (b != null) blue = Integer.parseInt(b);            setColor(new Color(red, green, blue));        }        else if ((value = attributes.getProperty(ElementTags.COLOR)) != null) {            setColor(ElementTags.decodeColor(value));        }    }