package com.ht.ui.svg;

import com.ht.ui.GlobalSettings;

import javafx.scene.control.CheckBox;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;

public class ControlPanel extends Region {
	
	public ControlPanel() {
		getStyleClass().add("window");
		setMaxSize(450, 450);
		
		VBox vb = new VBox(5);
		vb.setStyle("-fx-padding: 10px;-fx-font-size: 20px;");
		getChildren().add(vb);
		
		CheckBox showAlarm = new CheckBox("报警推画面");
		CheckBox showBlinking = new CheckBox("闪烁动画");
		CheckBox showNormalBlinking = new CheckBox("普通闪烁动画");
		CheckBox showFillBlinking = new CheckBox("填充色闪烁动画");
		CheckBox showStrokeBlinking = new CheckBox("连线色闪烁动画");
		
		showAlarm.setSelected(true);
		showBlinking.setSelected(true);
		showNormalBlinking.setSelected(true);
		showFillBlinking.setSelected(true);
		showStrokeBlinking.setSelected(true);
		
		GlobalSettings.INSTANCE.showAlarmProperty().bind(showAlarm.selectedProperty());
		GlobalSettings.INSTANCE.showBlinkingProperty().bind(showBlinking.selectedProperty());
		GlobalSettings.INSTANCE.showNormalBlinkingProperty().bind(showNormalBlinking.selectedProperty());
		GlobalSettings.INSTANCE.showFillBlinkingProperty().bind(showFillBlinking.selectedProperty());
		GlobalSettings.INSTANCE.showStrokeBlinkingProperty().bind(showStrokeBlinking.selectedProperty());
		
		vb.getChildren().addAll(showAlarm, showBlinking, showNormalBlinking, showFillBlinking, showStrokeBlinking);
		
	}
}
