package beatmeter4;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.*;
import javafx.scene.text.Text;
import javafx.stage.Stage;
/**
*
* @author wr
*/
public class BeatMeter4 extends Application {
char[] b = new char[8];
String beat;
Button btn_1, btn_2;
@Override
public void start(Stage primaryStage) {
// BorderPane Top
Button btn_Start = new Button("Start");
btn_Start.setOnAction(e -> btnStart_Click());
Button btn_Stop = new Button("Stop");
btn_Stop.setOnAction(e -> btnStop_Click());
Button btn_End = new Button("Ende");
btn_End.setOnAction(e -> btnEnd_Click());
HBox hbox = new HBox(10, btn_Start, btn_Stop, btn_End);
hbox.setPadding(new Insets(5));
// BorderPane Right
Text textVbox = new Text(" Beat");
btn_1 = new Button("10001000");
btn_1.setOnAction(e -> beat = btn_1.getText());
btn_2 = new Button("10101010");
btn_2.setOnAction(e -> beat = btn_2.getText());
Button btn_3 = new Button("11111111");
btn_3.setOnAction(e -> beat = btn_3.getText());
Button btn_4 = new Button("11101110");
btn_4.setOnAction(e -> beat = btn_4.getText());
Button btn_5 = new Button("10111000");
btn_5.setOnAction(e -> beat = btn_5.getText());
VBox vbox = new VBox(1, textVbox, btn_1, btn_2, btn_3, btn_4, btn_5);
vbox.setPadding(new Insets(1));
// BorderPane Center
Pane pane = new Pane();
Line beatLine = new Line(0, 450, 800, 450);
Rectangle beatRec = new Rectangle(200, 440, 10, 20);
beatRec.setFill(Color.YELLOW);
beatRec.setStroke(Color.BLACK);
pane.getChildren().addAll(beatLine, beatRec);
BorderPane root = new BorderPane();
root.setTop(hbox);
root.setRight(vbox);
root.setCenter(pane);
// Scene
Scene scene = new Scene(root, 800, 500);
primaryStage.setTitle("BeatMeter 4");
primaryStage.setScene(scene);
primaryStage.show();
}
private void btnStart_Click() {
}
private void btnStop_Click() {
}
private void btnEnd_Click() {
Platform.exit();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}