|
@@ -1,19 +1,16 @@
|
|
|
package com.example.application.views.list;
|
|
package com.example.application.views.list;
|
|
|
|
|
|
|
|
-import com.example.application.data.ArrowValue;
|
|
|
|
|
import com.example.application.data.DataThingy;
|
|
import com.example.application.data.DataThingy;
|
|
|
-import com.google.gson.Gson;
|
|
|
|
|
import com.vaadin.flow.component.Component;
|
|
import com.vaadin.flow.component.Component;
|
|
|
-import com.vaadin.flow.component.Key;
|
|
|
|
|
|
|
+import com.vaadin.flow.component.button.Button;
|
|
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
|
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
|
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
|
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
|
|
|
|
+import com.vaadin.flow.component.select.Select;
|
|
|
import com.vaadin.flow.component.textfield.TextField;
|
|
import com.vaadin.flow.component.textfield.TextField;
|
|
|
import com.vaadin.flow.router.PageTitle;
|
|
import com.vaadin.flow.router.PageTitle;
|
|
|
import com.vaadin.flow.router.Route;
|
|
import com.vaadin.flow.router.Route;
|
|
|
|
|
|
|
|
import java.io.BufferedWriter;
|
|
import java.io.BufferedWriter;
|
|
|
-import java.io.FileWriter;
|
|
|
|
|
-import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PageTitle("Spotting")
|
|
@PageTitle("Spotting")
|
|
@@ -23,6 +20,17 @@ public class Spotting extends HorizontalLayout {
|
|
|
private BufferedWriter writer;
|
|
private BufferedWriter writer;
|
|
|
private DataThingy data = new DataThingy();
|
|
private DataThingy data = new DataThingy();
|
|
|
|
|
|
|
|
|
|
+ //controls
|
|
|
|
|
+ private Button reset = new Button("Reset");
|
|
|
|
|
+ private Button confirm = new Button("Bestätigt");
|
|
|
|
|
+ Select<String> mode = new Select<>();
|
|
|
|
|
+ Select<String> start = new Select<>();
|
|
|
|
|
+
|
|
|
|
|
+ HorizontalLayout top = new HorizontalLayout();
|
|
|
|
|
+ HorizontalLayout mid = new HorizontalLayout();
|
|
|
|
|
+ HorizontalLayout bottom = new HorizontalLayout();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//left
|
|
//left
|
|
|
VerticalLayout left = new VerticalLayout(Alignment.END);
|
|
VerticalLayout left = new VerticalLayout(Alignment.END);
|
|
|
TextField left_one = new TextField("Pfeil 1");
|
|
TextField left_one = new TextField("Pfeil 1");
|
|
@@ -39,13 +47,28 @@ public class Spotting extends HorizontalLayout {
|
|
|
|
|
|
|
|
|
|
|
|
|
public Spotting(){
|
|
public Spotting(){
|
|
|
|
|
+
|
|
|
left.add(left_one,left_two,left_three);
|
|
left.add(left_one,left_two,left_three);
|
|
|
right.add(right_one,right_two,right_three);
|
|
right.add(right_one,right_two,right_three);
|
|
|
init_listeners();
|
|
init_listeners();
|
|
|
- add(left,right);
|
|
|
|
|
|
|
+ initSelect();
|
|
|
|
|
+
|
|
|
|
|
+ top.add(mode,start);
|
|
|
|
|
+ right.add(confirm);
|
|
|
|
|
+ bottom.add(reset);
|
|
|
|
|
+
|
|
|
|
|
+ //layouts
|
|
|
|
|
+ add(top,mid,bottom);
|
|
|
|
|
+ mid.add(left,right);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void init_listeners(){
|
|
private void init_listeners(){
|
|
|
|
|
+ //buttons
|
|
|
|
|
+ reset.addClickListener(buttonClickEvent -> matchReset());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ //arrow fields
|
|
|
for (Component c : left.getChildren().toList()){
|
|
for (Component c : left.getChildren().toList()){
|
|
|
if(c instanceof TextField){
|
|
if(c instanceof TextField){
|
|
|
((TextField)c).addValueChangeListener(textFieldStringComponentValueChangeEvent -> write());
|
|
((TextField)c).addValueChangeListener(textFieldStringComponentValueChangeEvent -> write());
|
|
@@ -63,6 +86,23 @@ public class Spotting extends HorizontalLayout {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void initSelect(){
|
|
|
|
|
+ //mode
|
|
|
|
|
+ mode.setLabel("Modus");
|
|
|
|
|
+ mode.setItems("Komulativ","Satz");
|
|
|
|
|
+ mode.setValue("Satz");
|
|
|
|
|
+
|
|
|
|
|
+ //beginning archer
|
|
|
|
|
+ start.setLabel("Beginner:");
|
|
|
|
|
+ start.setItems("Links","Rechts");
|
|
|
|
|
+ start.setValue("Links");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void matchReset(){
|
|
|
|
|
+ data.reset();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private void write(){
|
|
private void write(){
|
|
|
String[] vals_l = {left_one.getValue(),left_two.getValue(),left_three.getValue()};
|
|
String[] vals_l = {left_one.getValue(),left_two.getValue(),left_three.getValue()};
|
|
|
String[] vals_r = {right_one.getValue(),right_two.getValue(),right_three.getValue()};
|
|
String[] vals_r = {right_one.getValue(),right_two.getValue(),right_three.getValue()};
|