/*
 * CarContextCourse.fx
 *
 * Created on Mar 23, 2010, 9:54:41 PM
 */
package vismobile;

import javafx.scene.Scene;
import javafx.scene.Group;
import javafx.scene.layout.HBox;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import javafx.scene.layout.VBox;
import java.lang.Math;
import javafx.scene.image.ImageView;

/**
 * @author Student
 */
public class CarContextCourse extends Scene {




    override var content = [

                Group {
                    content: [
                        VBox {
                            //spacing: 1
                            content: [
                                HBox {
                                    //spacing: 1
                                    content: [
                                        rectLocation8,
                                        rectLocation1,
                                        rectLocation2

                                    ]
                                }
                                HBox {
                                    //spacing: 1
                                    content: [
                                        rectLocation7,
                                        rectCar,
                                        rectLocation3
                                    ]
                                }
                                HBox {
                                    //spacing: 1
                                    content: [
                                        rectLocation6,
                                        rectLocation5,
                                        rectLocation4
                                    ]
                                }
                            ]
                        }
                    ]
                }
                Group {
                    translateX: Main.stage.width - Math.ceil(Main.stage.width / 4.25) - 3

                    content: [
                        VBox {
                            spacing: 1

                            content: [
                                    
                                AlertImage{
                                        displayimage: bind Main.alertImage1;
                                        }
                                        AlertImage{
                                        displayimage: bind Main.alertImage2;
                                        }
                                        AlertImage{
                                        displayimage: bind Main.alertImage3;
                                        }
                                        AlertImage{
                                        displayimage: bind Main.alertImage4;
                                        }
                           
                               
                            ]
                        }
                    ]
                }
                Group {
                    var homeButton: HomeButton =
                            HomeButton {
                                desc: "HOME"
                            }
                    translateX: 1
                    translateY: Main.stage.height - homeButton.boundsInLocal.height;
                    content: [
                        homeButton]
                }
                Group {
                    var carImage = ImageView {
                                image: CommonFunctionsFX.getImage("car_lg")
                                fitWidth: Math.ceil(Main.stage.width / 4.25)
                                preserveRatio: true
                                smooth: true
                                cache: true }
                    translateX: (Math.ceil(Main.stage.width / 4.25) * 3) / 2 - carImage.boundsInParent.width / 2
                    translateY: (Math.ceil(Main.stage.width / 4.25) * 3) / 2 - carImage.boundsInParent.height / 2
                    content: [
                        carImage
                    ]
                }


                
            ]
}




def rectLocation1 = Rectangle {
            width: Math.ceil(Main.stage.width / 4.25)
            height: Math.ceil(Main.stage.width / 4.25)
            fill: bind Main.courseRect1.color
        }
def rectLocation2 = Rectangle {
            width: Math.ceil(Main.stage.width / 4.25)
            height: Math.ceil(Main.stage.width / 4.25)
            fill: bind Main.courseRect2.color }
def rectCar = Rectangle {
            width: Math.ceil(Main.stage.width / 4.25)
            height: Math.ceil(Main.stage.width / 4.25)
            fill: bind Color.BLACK }
def rectLocation3 = Rectangle {
            width: Math.ceil(Main.stage.width / 4.25)
            height: Math.ceil(Main.stage.width / 4.25)
            fill: bind Main.courseRect3.color }
def rectLocation4 = Rectangle {
            width: Math.ceil(Main.stage.width / 4.25)
            height: Math.ceil(Main.stage.width / 4.25)
            fill: bind Main.courseRect4.color }
def rectLocation5 = Rectangle {
            width: Math.ceil(Main.stage.width / 4.25)
            height: Math.ceil(Main.stage.width / 4.25)
            fill: bind Main.courseRect5.color
        }
def rectLocation6 = Rectangle {
            width: Math.ceil(Main.stage.width / 4.25)
            height: Math.ceil(Main.stage.width / 4.25)
            fill: bind Main.courseRect6.color }
def rectLocation7 = Rectangle {
            width: Math.ceil(Main.stage.width / 4.25)
            height: Math.ceil(Main.stage.width / 4.25)
            fill: bind Main.courseRect7.color }
def rectLocation8 = Rectangle {
            width: Math.ceil(Main.stage.width / 4.25)
            height: Math.ceil(Main.stage.width / 4.25)
            fill: bind Main.courseRect8.color }
