/*
 * CarContextCourse.fx
 *
 * Created on Nov 30, 2009, 11:38:02 AM
 */

package mdot_gui;



import javafx.scene.CustomNode;
import javafx.scene.Node;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import javafx.scene.image.ImageView;
import javafx.geometry.Rectangle2D;



import javafx.scene.Group;

import javafx.scene.layout.VBox;



import javafx.scene.layout.HBox;




/**
 * @author Jamie Lynn
 */


public class CarContextCourse extends CustomNode{


public override function create(): Node {
    visible = true;

    id = "CarContextCourse";

    SceneManager.setActiveScene(id);
    Group{
            content:[

           
            HBox{
                layoutX:Constants.WINDOW_WIDTH/2 - ((3*Constants.BLINKING_RECT_COURSE_WIDTH)/2);
                content:[

            VBox{
            spacing:2
                content:[
                        rectLocation8,
                        rectLocation7,
                        rectLocation6
                        ]
                }

            VBox{
            spacing:2
                content:[
                        rectLocation1,
                        rectCar,
                        rectLocation5
                        ]
                }

            VBox{
                    spacing:2
                content:[
                        rectLocation2,
                        rectLocation3,
                        rectLocation4
                       ]
                }

               

                ]}
                 carImage
                ]


               

    }

}

var rectLocation1 = Rectangle{
                    width: Constants.BLINKING_RECT_COURSE_WIDTH,
                    height: Constants.BLINKING_RECT_COURSE_HEIGHT,
                    fill:  bind  MainScreen.courseRect1.color

                            }

def rectLocation2 = Rectangle{
                    width: Constants.BLINKING_RECT_COURSE_WIDTH,
                    height: Constants.BLINKING_RECT_COURSE_HEIGHT,
                    fill: bind  MainScreen.courseRect2.color}


def rectCar       = Rectangle{
                    width: Constants.BLINKING_RECT_COURSE_WIDTH,
                    height: Constants.BLINKING_RECT_COURSE_HEIGHT,
                    fill: bind  Color.BLACK}

def rectLocation3 = Rectangle{
                    width: Constants.BLINKING_RECT_COURSE_WIDTH,
                    height: Constants.BLINKING_RECT_COURSE_HEIGHT,
                    fill: bind  MainScreen.courseRect3.color}

def rectLocation4 = Rectangle{
                    width: Constants.BLINKING_RECT_COURSE_WIDTH,
                    height: Constants.BLINKING_RECT_COURSE_HEIGHT,
                    fill: bind  MainScreen.courseRect4.color}

def rectLocation5 = Rectangle{
                    width: Constants.BLINKING_RECT_COURSE_WIDTH,
                    height: Constants.BLINKING_RECT_COURSE_HEIGHT,
                    fill: bind  MainScreen.courseRect5.color
                    }

def rectLocation6 = Rectangle{
                    width: Constants.BLINKING_RECT_COURSE_WIDTH,
                    height: Constants.BLINKING_RECT_COURSE_HEIGHT,
                    fill: bind  MainScreen.courseRect6.color}

def rectLocation7 = Rectangle{
                    width: Constants.BLINKING_RECT_COURSE_WIDTH,
                    height: Constants.BLINKING_RECT_COURSE_HEIGHT,
                    fill: bind  MainScreen.courseRect7.color}

def rectLocation8 = Rectangle{
                    width: Constants.BLINKING_RECT_COURSE_WIDTH,
                    height: Constants.BLINKING_RECT_COURSE_HEIGHT,
                    fill: bind  MainScreen.courseRect8.color}




var carImage:ImageView =    ImageView{

                            image: CommonFunctionsFX.getImage("car_lg")
                            translateX: Constants.WINDOW_WIDTH/2 - (50); //carheight/2
                            translateY: Constants.APPLICATION_HEIGHT/2 - (50);
                    }

}

