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

package vismobile;

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;
import java.lang.Math;

/**
 * @author Jamie Lynn
 */

public class AlertImage extends CustomNode{

    var size = Math.ceil(Main.stage.width/4.25);
    public var displayimage:Image;


                                

    public override function create(): Node {

        Group{
            blocksMouse: true;
            
            var imageArea:ImageView = ImageView {
                                image: bind displayimage
                                fitWidth: Math.ceil(Main.stage.width / 4.25)
                                preserveRatio: true
                                smooth: true
                                cache: true }

            var rectSolid:Rectangle =   Rectangle {
                    width: size
                    height: size
                    arcWidth: size / 4
                    arcHeight: size / 4
                    fill: null
                    stroke: Color.MEDIUMBLUE
                    strokeWidth: 4
                }
            var rectOutline:Rectangle =    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 }
                        ]
                    }
                }
                content:[

                   rectSolid,
                   rectOutline,
                   imageArea
                   /*
                    Group{
                            translateX: 100//rectSolid.width/2 - imageArea.fitWidth/2
                            translateY: 100
                            content: imageArea
                    }*/
                ]
        }
    }

}
