/*
 * ConstructionZone.fx
 *
 * Created on Nov 30, 2009, 8:30:56 PM
 */

package mdot_gui;

import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;


/**
 * @author Jamie Lynn
 */

public class TowTruck extends CustomNode{

public override function create(): Node {

    visible = false;
    id = "TowTruck";
    Group{
        content:[
            Text {
                translateX: Constants.WINDOW_WIDTH/2 - 175
                translateY: Constants.WINDOW_HEIGHT/5
                font : Font {size: 40}
                fill: Color.WHITE
                content: "Tow Truck Application"
            }

            ToggleButton{
                id:"btnStartStop"
                index: 0
                translateX: Constants.WINDOW_WIDTH/2 - Constants.BUTTON_SIZE/2;
                translateY: Constants.WINDOW_HEIGHT/3;
                imageButton1: CommonFunctionsFX.getImage("play_lg");
                imageButton2: CommonFunctionsFX.getImage("stop1_lg");
                //Start
                onclickButton1Action: function(){
                 //Set the vehicle type as CONSTRUCTION
                        mdot.Main.getMe().setObjectAsString(structures.Constants.HASH_TYPE, structures.Constants.TYPE_TOW_STRING);
                        //Insert the roadsign flag for dynamic signs
                        mdot.Main.getMe().setObjectAsString(structures.Constants.HASH_ROADSIGN_ENABLE, "Yes");
                }
                //Stop
                onclickButton2Action: function(){
                     //Remove roadsign flag from hashtable
                        mdot.Main.getMe().removeObject(structures.Constants.HASH_ROADSIGN_ENABLE);

                        //Change type back to vehicle
                        mdot.Main.getMe().setObjectAsString(structures.Constants.HASH_TYPE, structures.Constants.TYPE_VEHICLE.toString());
                }
            }
                      
            ]
        }
    }
}
