package videopuzzle;

import javafx.scene.*;
import javafx.scene.layout.*;
import javafx.scene.shape.*;
import javafx.scene.paint.*;
import javafx.scene.text.*;
import javafx.scene.input.*;
import javafx.ext.swing.*;

/**
 * @author joshua.marinacci@sun.com
 */

public class ChooseScreen extends CustomNode {
    public-init var width:Integer = 50;
    public-init var height:Integer = 100;
    public-init var main:Main;
    
    override public function create():Node {
        return Group { content:
            HBox { spacing: 10 content: [
                    // preview of the video
                    Rectangle { width: 640 height: 480 fill: Color.GREEN }
                    // selection controls
                    VBox { spacing: 5 content: [
                            Text { x: 20 y: 15 fill: Color.GRAY content: "Select Shape Type" },
                            HBox { spacing: 5 content: [
                                    SwingButton { text: "Type 1" }
                                    SwingButton { text: "Type 2" }
                                    SwingButton { text: "Type 3" }
                                ]
                            }
                            HBox { spacing: 5 content: [
                                    SwingButton { text: "Type 1" }
                                    SwingButton { text: "Type 2" }
                                    SwingButton { text: "Type 3" }
                                ]
                            }
                            Line { startX: 0 endX: 200 startY: 10 endY: 10 stroke: Color.BLACK }
                            Text { x: 20 y: 15 fill: Color.GRAY content: "Select Shape Type" },
                            Text { x: 20 y: 15 fill: Color.GRAY content: "Easy / Hard" },
                            // difficulty slider
                            SwingSlider{ minimum: 3 maximum: 5 value: bind main.difficulty with inverse }
                            //Rectangle { width: 250 height: 10 fill: Color.DARKGRAY },

                            Text { x: 20 y: 15 fill: Color.GRAY
                                content: bind "{main.difficulty} x {main.difficulty} - {main.difficulty*main.difficulty} puzzle pieces selected" },
                        ]
                    }

                ]
            }
        }
    }
}