package be.iminds.ilabt.jfed.ui.javafx;

import javafx.scene.paint.Color;
import org.controlsfx.glyphfont.FontAwesome;
import org.controlsfx.glyphfont.Glyph;
import org.controlsfx.glyphfont.GlyphFont;
import org.controlsfx.glyphfont.GlyphFontRegistry;

/**
 * User: twalcari
 * Date: 9/8/2014
 * Time: 10:24
 */
public class GlyphUtils {
    private static final GlyphFont FONT_AWESOME = GlyphFontRegistry.font("FontAwesome");

    private GlyphUtils() {
    }

    public static Glyph createDialogGlyph(FontAwesome.Glyph glyph, Color color) {
        Glyph result = FONT_AWESOME
                .create(glyph)
                .color(color)
                .size(40)
               .useGradientEffect();

        return result;
    }

    public static Glyph createSmallGlyph(FontAwesome.Glyph glyph) {
        Glyph result = FONT_AWESOME
                .create(glyph)
                /*.useGradientEffect()*/;
        result.setPrefSize(16, 16);
        return result;
    }

    public static Glyph createSmallGlyph(FontAwesome.Glyph glyph, Color color) {
        Glyph result = FONT_AWESOME
                .create(glyph)
                .color(color)
                /*.useGradientEffect()*/;
        result.setPrefSize(16, 16);
        return result;
    }

    public static Glyph createGlyph(FontAwesome.Glyph glyph){
        final Glyph result = FONT_AWESOME.create(glyph);
        return result;
    }


    public static Glyph createGlyph(FontAwesome.Glyph glyph, Color color){
        final Glyph result = FONT_AWESOME.create(glyph)
                .color(color);
      //  result.setStyle("-fx-font-family: 'FontAwesome';");
        return result;
    }
}
