/*
 * AlertImage.fx
 *
 * Created on Nov 30, 2009, 1:57:17 AM
 */

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.paint.Color;
import javafx.scene.shape.Rectangle;

import javafx.scene.paint.RadialGradient;
import javafx.scene.paint.Stop;

/**
 * @author Jamie Lynn
 */

public class AlertImage extends CustomNode{

    var size = Constants.BUTTON_SIZE * Constants.BUTTON_SCALE;
    public var displayimage: Image;


    public def imageArea = ImageView {
                                var img = CommonFunctionsFX.getImage("blank_lg");
                                x: (size - img.width) / 2
                                y: (size - img.height) / 2
                                image: img
                                    };

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

                      Rectangle {
                    width: size
                    height: size
                    arcWidth: size / 4
                    arcHeight: size / 4
                    fill: null
                    stroke: Color.MEDIUMBLUE
                    strokeWidth: 4
                },
Rectangle {
                    width: size
                    height: size
                    arcWidth: size / 4
                    arcHeight: size / 4
                    fill: RadialGradient {
                        centerX: 0.5
                        centerY: 0.5
                        stops: [
                            Stop { offset: 0.0 color: Color.DARKBLUE },
                            Stop { offset: 0.8 color: Color.BLACK }
                        ]
                    }
                },
                    imageArea
                ]
        }
    }

}
