/*
 * GenericAppButton.fx
 *
 * Created on Dec 5, 2009, 2:50:34 PM
 */

package mdot_gui;

import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;

/**
 * @author student
 */

public class GenericAppButton extends GenericButton{

    var size = Constants.BUTTON_SIZE * Constants.BUTTON_SCALE;
    public var displayimage: Image;
    public var onclickAction: function(e:MouseEvent):Void;



    public override function create(): Node {
        Group{
            blocksMouse: true;
                content:[

                    ImageView {
                        x: (size - displayimage.width) / 2;
                        y: (size - displayimage.height) /2;

                        image: displayimage
                    }
                ]

            onMousePressed: onclickAction;
        }
    }
}
