/*
 * SchoolBus.fx
 *
 * Created on Nov 30, 2009, 8:30:44 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;
import javafx.scene.input.MouseEvent;
import sphinx.SphinxControl;
import CommonFunctions.debugPrinter;

/**
 * @author Jamie Lynn
 */

public class Sphinx extends CustomNode{

public override function create(): Node {

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

                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(){
                        SphinxControl.sphinx.setRunning(true);
                        debugPrinter.printLine("RUNNING: {SphinxControl.sphinx.isRunning().toString()}");
                    }
                    //Stop
                    onclickButton2Action: function(){
                        SphinxControl.sphinx.stop();
                    }
                }
            ]
        }
    }
}
