import je.NumberField;
import javafx.application.Application;
import javafx.event.*;
import javafx.scene.control.*;
import javafx.scene.input.*;
import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
import javafx.scene.Scene;
import javafx.stage.Stage;

/**
 *
 * Beschreibung
 *
 * @version 1.0 vom 31.05.2022
 * @author Gerhard Röhner
 */

public class GuiBlockchain extends Application {
  // Anfang Attribute
  private GridPane gridPane1 = new GridPane();
  private Pane pane1 = new Pane();
    private Label lBlock1 = new Label();
    private Label lSchwierigkeit1 = new Label();
    private Label lNonce1 = new Label();
    private NumberField nfNonce1 = new NumberField();
    private Label lDaten1 = new Label();
    private TextArea taDaten1 = new TextArea();
    private Label lHash1 = new Label();
    private TextField tfHash1 = new TextField();
    private Button bMine1 = new Button();
    private Spinner<Integer> spBlock1 = new Spinner<>(0, 10, 1, 1);
    private Label lVorher1 = new Label();
    private TextField tfVorherigerHash1 = new TextField();
    private Spinner<Integer> spSchwierigkeit1 = new Spinner<>(0, 10, 5, 1);
  private Pane pane2 = new Pane();
    private Label lBlock2 = new Label();
    private Label lSchwierigkeit2 = new Label();
    private Label lNonce2 = new Label();
    private NumberField nfNonce2 = new NumberField();
    private Label lDaten2 = new Label();
    private TextArea taDaten2 = new TextArea();
    private Label lHash2 = new Label();
    private TextField tfHash2 = new TextField();
    private Button bMine2 = new Button();
    private Label lVorher2 = new Label();
    private TextField tfVorherigerHash2 = new TextField();
    private Spinner<Integer> spBlock2 = new Spinner<>(0, 10, 2, 1);
    private Spinner<Integer> spSchwierigkeit2 = new Spinner<>(0, 10, 5, 1);
  private Pane pane3 = new Pane();
    private Label lBlock3 = new Label();
    private Label lSchwierigkeit3 = new Label();
    private Label lNonce3 = new Label();
    private NumberField nfNonce3 = new NumberField();
    private Label lDaten3 = new Label();
    private TextArea taDaten3 = new TextArea();
    private Label lHash3 = new Label();
    private TextField tfHash3 = new TextField();
    private Button bMine3 = new Button();
    private Label lVorher3 = new Label();
    private TextField tfVorherigerHash3 = new TextField();
    private Spinner<Integer> spBlock3 = new Spinner<>(0, 10, 3, 1);
    private Spinner<Integer> spSchwierigkeit3 = new Spinner<>(0, 10, 5, 1);
  private Pane pane4 = new Pane();
    private Label lBlock4 = new Label();
    private Label lSchwierigkeit4 = new Label();
    private Label lNonce4 = new Label();
    private NumberField nfNonce4 = new NumberField();
    private Label lDaten4 = new Label();
    private TextArea taDaten4 = new TextArea();
    private Label lHash4 = new Label();
    private TextField tfHash4 = new TextField();
    private Button bMine4 = new Button();
    private Label lVorher4 = new Label();
    private TextField tfVorherigerHash4 = new TextField();
    private Spinner<Integer> spBlock4 = new Spinner<>(0, 10, 4, 1);
    private Spinner<Integer> spSchwierigkeit4 = new Spinner<>(0, 10, 5, 1);
  // Ende Attribute
  private BlockChain eineBlockChain = new BlockChain(4);
  
  public void start(Stage primaryStage) { 
    Pane root = new Pane();
    Scene scene = new Scene(root, 501, 954);
    // Anfang Komponenten
    
    pane1.setLayoutX(0);
    pane1.setLayoutY(0);
    pane1.setPrefHeight(224);
    pane1.setPrefWidth(500);
    root.getChildren().add(pane1);
    lBlock1.setLayoutX(208);
    lBlock1.setLayoutY(8);
    lBlock1.setPrefHeight(20);
    lBlock1.setPrefWidth(46);
    lBlock1.setText("Block");
    pane1.getChildren().add(lBlock1);
    lSchwierigkeit1.setLayoutX(344);
    lSchwierigkeit1.setLayoutY(8);
    lSchwierigkeit1.setPrefHeight(20);
    lSchwierigkeit1.setPrefWidth(86);
    lSchwierigkeit1.setText("Schwierigkeit");
    pane1.getChildren().add(lSchwierigkeit1);
    spSchwierigkeit1.setLayoutX(432);
    spSchwierigkeit1.setLayoutY(5);
    spSchwierigkeit1.setPrefHeight(27);
    spSchwierigkeit1.setPrefWidth(54);
    spSchwierigkeit1.setOnMouseClicked(
      (event) -> {spBlock_MouseClicked(event);} 
    );
    pane1.getChildren().add(spSchwierigkeit1);
    lNonce1.setLayoutX(8);
    lNonce1.setLayoutY(8);
    lNonce1.setPrefHeight(20);
    lNonce1.setPrefWidth(46);
    lNonce1.setText("Nonce");
    pane1.getChildren().add(lNonce1);
    nfNonce1.setLayoutX(56);
    nfNonce1.setLayoutY(6);
    nfNonce1.setPrefHeight(25);
    nfNonce1.setPrefWidth(75);
    nfNonce1.setOnKeyReleased(
      (event) -> {taDaten_KeyReleased(event);} 
    );
    pane1.getChildren().add(nfNonce1);
    lDaten1.setLayoutX(8);
    lDaten1.setLayoutY(40);
    lDaten1.setPrefHeight(20);
    lDaten1.setPrefWidth(46);
    lDaten1.setText("Daten");
    pane1.getChildren().add(lDaten1);
    taDaten1.setLayoutX(56);
    taDaten1.setLayoutY(40);
    taDaten1.setPrefHeight(84);
    taDaten1.setPrefWidth(432);
    taDaten1.setOnKeyReleased(
      (event) -> {taDaten_KeyReleased(event);} 
    );
    pane1.getChildren().add(taDaten1);
    lHash1.setLayoutX(8);
    lHash1.setLayoutY(161);
    lHash1.setPrefHeight(20);
    lHash1.setPrefWidth(46);
    lHash1.setText("Hash");
    pane1.getChildren().add(lHash1);
    tfHash1.setLayoutX(56);
    tfHash1.setLayoutY(161);
    tfHash1.setPrefHeight(25);
    tfHash1.setPrefWidth(432);
    tfHash1.setEditable(false);
    pane1.getChildren().add(tfHash1);
    bMine1.setLayoutX(56);
    bMine1.setLayoutY(192);
    bMine1.setPrefHeight(25);
    bMine1.setPrefWidth(75);
    bMine1.setOnAction(
      (event) -> {bMine1_Action(event);} 
    );
    bMine1.setText("Mine");
    pane1.getChildren().add(bMine1);
    spBlock1.setLayoutX(248);
    spBlock1.setLayoutY(5);
    spBlock1.setPrefHeight(27);
    spBlock1.setPrefWidth(54);
    spBlock1.setOnMouseClicked(
      (event) -> {spBlock_MouseClicked(event);} 
    );
    pane1.getChildren().add(spBlock1);
    lVorher1.setLayoutX(8);
    lVorher1.setLayoutY(132);
    lVorher1.setPrefHeight(20);
    lVorher1.setPrefWidth(38);
    lVorher1.setText("Vorher");
    pane1.getChildren().add(lVorher1);
    tfVorherigerHash1.setLayoutX(56);
    tfVorherigerHash1.setLayoutY(132);
    tfVorherigerHash1.setPrefHeight(25);
    tfVorherigerHash1.setPrefWidth(432);
    tfVorherigerHash1.setEditable(false);
    pane1.getChildren().add(tfVorherigerHash1);

    pane2.setLayoutX(0);
    pane2.setLayoutY(224);
    pane2.setPrefHeight(224);
    pane2.setPrefWidth(500);
    root.getChildren().add(pane2);
    lBlock2.setLayoutX(208);
    lBlock2.setLayoutY(8);
    lBlock2.setPrefHeight(20);
    lBlock2.setPrefWidth(46);
    lBlock2.setText("Block");
    pane2.getChildren().add(lBlock2);
    lSchwierigkeit2.setLayoutX(344);
    lSchwierigkeit2.setLayoutY(8);
    lSchwierigkeit2.setPrefHeight(20);
    lSchwierigkeit2.setPrefWidth(86);
    lSchwierigkeit2.setText("Schwierigkeit");
    pane2.getChildren().add(lSchwierigkeit2);
    spSchwierigkeit2.setLayoutX(432);
    spSchwierigkeit2.setLayoutY(5);
    spSchwierigkeit2.setPrefHeight(27);
    spSchwierigkeit2.setPrefWidth(54);
    spSchwierigkeit2.setOnMouseClicked(
      (event) -> {spBlock_MouseClicked(event);} 
    );
    pane2.getChildren().add(spSchwierigkeit2);
    lNonce2.setLayoutX(8);
    lNonce2.setLayoutY(8);
    lNonce2.setPrefHeight(20);
    lNonce2.setPrefWidth(46);
    lNonce2.setText("Nonce");
    pane2.getChildren().add(lNonce2);
    nfNonce2.setLayoutX(56);
    nfNonce2.setLayoutY(6);
    nfNonce2.setPrefHeight(25);
    nfNonce2.setPrefWidth(75);
    nfNonce2.setOnKeyReleased(
      (event) -> {taDaten_KeyReleased(event);} 
    );   
    pane2.getChildren().add(nfNonce2);
    lDaten2.setLayoutX(8);
    lDaten2.setLayoutY(40);
    lDaten2.setPrefHeight(20);
    lDaten2.setPrefWidth(46);
    lDaten2.setText("Daten");
    pane2.getChildren().add(lDaten2);
    taDaten2.setLayoutX(56);
    taDaten2.setLayoutY(40);
    taDaten2.setPrefHeight(84);
    taDaten2.setPrefWidth(432);
    taDaten2.setOnKeyReleased(
      (event) -> {taDaten_KeyReleased(event);} 
    );
    pane2.getChildren().add(taDaten2);
    lHash2.setLayoutX(8);
    lHash2.setLayoutY(161);
    lHash2.setPrefHeight(20);
    lHash2.setPrefWidth(46);
    lHash2.setText("Hash");
    pane2.getChildren().add(lHash2);
    tfHash2.setLayoutX(56);
    tfHash2.setLayoutY(161);
    tfHash2.setPrefHeight(25);
    tfHash2.setPrefWidth(432);
    tfHash2.setEditable(false);
    pane2.getChildren().add(tfHash2);
    bMine2.setLayoutX(56);
    bMine2.setLayoutY(192);
    bMine2.setPrefHeight(25);
    bMine2.setPrefWidth(75);
    bMine2.setOnAction(
      (event) -> {bMine2_Action(event);} 
    );
    bMine2.setText("Mine");
    pane2.getChildren().add(bMine2);
    spBlock2.setLayoutX(248);
    spBlock2.setLayoutY(5);
    spBlock2.setPrefHeight(27);
    spBlock2.setPrefWidth(54);
    spBlock2.setOnMouseClicked(
      (event) -> {spBlock_MouseClicked(event);} 
    );
    pane2.getChildren().add(spBlock2);
    lVorher2.setLayoutX(8);
    lVorher2.setLayoutY(132);
    lVorher2.setPrefHeight(20);
    lVorher2.setPrefWidth(38);
    lVorher2.setText("Vorher");
    pane2.getChildren().add(lVorher2);
    tfVorherigerHash2.setLayoutX(56);
    tfVorherigerHash2.setLayoutY(132);
    tfVorherigerHash2.setPrefHeight(25);
    tfVorherigerHash2.setPrefWidth(432);
    tfVorherigerHash2.setEditable(false);
    pane2.getChildren().add(tfVorherigerHash2);
    pane3.setLayoutX(0);
    pane3.setLayoutY(448);
    pane3.setPrefHeight(224);
    pane3.setPrefWidth(500);
    root.getChildren().add(pane3);
    lBlock3.setLayoutX(208);
    lBlock3.setLayoutY(8);
    lBlock3.setPrefHeight(20);
    lBlock3.setPrefWidth(46);
    lBlock3.setText("Block");
    pane3.getChildren().add(lBlock3);
    lSchwierigkeit3.setLayoutX(344);
    lSchwierigkeit3.setLayoutY(8);
    lSchwierigkeit3.setPrefHeight(20);
    lSchwierigkeit3.setPrefWidth(86);
    lSchwierigkeit3.setText("Schwierigkeit");
    pane3.getChildren().add(lSchwierigkeit3);
    spSchwierigkeit3.setLayoutX(432);
    spSchwierigkeit3.setLayoutY(5);
    spSchwierigkeit3.setPrefHeight(27);
    spSchwierigkeit3.setPrefWidth(54);
    spSchwierigkeit3.setOnMouseClicked(
      (event) -> {spBlock_MouseClicked(event);} 
    );
    pane3.getChildren().add(spSchwierigkeit3);
    lNonce3.setLayoutX(8);
    lNonce3.setLayoutY(8);
    lNonce3.setPrefHeight(20);
    lNonce3.setPrefWidth(46);
    lNonce3.setText("Nonce");
    pane3.getChildren().add(lNonce3);
    nfNonce3.setLayoutX(56);
    nfNonce3.setLayoutY(6);
    nfNonce3.setPrefHeight(25);
    nfNonce3.setPrefWidth(75);
    nfNonce3.setOnKeyReleased(
      (event) -> {taDaten_KeyReleased(event);} 
    );
    pane3.getChildren().add(nfNonce3);
    lDaten3.setLayoutX(8);
    lDaten3.setLayoutY(40);
    lDaten3.setPrefHeight(20);
    lDaten3.setPrefWidth(46);
    lDaten3.setText("Daten");
    pane3.getChildren().add(lDaten3);
    taDaten3.setLayoutX(56);
    taDaten3.setLayoutY(40);
    taDaten3.setPrefHeight(84);
    taDaten3.setPrefWidth(432);
    taDaten3.setOnKeyReleased(
      (event) -> {taDaten_KeyReleased(event);} 
    );
    pane3.getChildren().add(taDaten3);
    lHash3.setLayoutX(8);
    lHash3.setLayoutY(161);
    lHash3.setPrefHeight(20);
    lHash3.setPrefWidth(46);
    lHash3.setText("Hash");
    pane3.getChildren().add(lHash3);
    tfHash3.setLayoutX(56);
    tfHash3.setLayoutY(161);
    tfHash3.setPrefHeight(25);
    tfHash3.setPrefWidth(432);
    tfHash3.setEditable(false);
    pane3.getChildren().add(tfHash3);
    bMine3.setLayoutX(56);
    bMine3.setLayoutY(192);
    bMine3.setPrefHeight(25);
    bMine3.setPrefWidth(75);
    bMine3.setOnAction(
      (event) -> {bMine3_Action(event);} 
    );
    bMine3.setText("Mine");
    pane3.getChildren().add(bMine3);
    spBlock3.setLayoutX(248);
    spBlock3.setLayoutY(5);
    spBlock3.setPrefHeight(27);
    spBlock3.setPrefWidth(54);
    spBlock3.setOnMouseClicked(
      (event) -> {spBlock_MouseClicked(event);} 
    );
    pane3.getChildren().add(spBlock3);
    lVorher3.setLayoutX(8);
    lVorher3.setLayoutY(132);
    lVorher3.setPrefHeight(20);
    lVorher3.setPrefWidth(38);
    lVorher3.setText("Vorher");
    pane3.getChildren().add(lVorher3);
    tfVorherigerHash3.setLayoutX(56);
    tfVorherigerHash3.setLayoutY(132);
    tfVorherigerHash3.setPrefHeight(25);
    tfVorherigerHash3.setPrefWidth(432);
    tfVorherigerHash3.setEditable(false);
    pane3.getChildren().add(tfVorherigerHash3);
    pane4.setLayoutX(0);
    pane4.setLayoutY(672);
    pane4.setPrefHeight(224);
    pane4.setPrefWidth(500);
    root.getChildren().add(pane4);
    lBlock4.setLayoutX(208);
    lBlock4.setLayoutY(8);
    lBlock4.setPrefHeight(20);
    lBlock4.setPrefWidth(46);
    lBlock4.setText("Block");
    pane4.getChildren().add(lBlock4);
    lSchwierigkeit4.setLayoutX(344);
    lSchwierigkeit4.setLayoutY(8);
    lSchwierigkeit4.setPrefHeight(20);
    lSchwierigkeit4.setPrefWidth(86);
    lSchwierigkeit4.setText("Schwierigkeit");
    pane4.getChildren().add(lSchwierigkeit4);
    spSchwierigkeit4.setLayoutX(432);
    spSchwierigkeit4.setLayoutY(5);
    spSchwierigkeit4.setPrefHeight(27);
    spSchwierigkeit4.setPrefWidth(54);
    spSchwierigkeit4.setOnMouseClicked(
      (event) -> {spBlock_MouseClicked(event);} 
    );
    pane4.getChildren().add(spSchwierigkeit4);
    lNonce4.setLayoutX(8);
    lNonce4.setLayoutY(8);
    lNonce4.setPrefHeight(20);
    lNonce4.setPrefWidth(46);
    lNonce4.setText("Nonce");
    pane4.getChildren().add(lNonce4);
    nfNonce4.setLayoutX(56);
    nfNonce4.setLayoutY(6);
    nfNonce4.setPrefHeight(25);
    nfNonce4.setPrefWidth(75);
    nfNonce4.setOnKeyReleased(
      (event) -> {taDaten_KeyReleased(event);} 
    );   
    pane4.getChildren().add(nfNonce4);
    lDaten4.setLayoutX(8);
    lDaten4.setLayoutY(40);
    lDaten4.setPrefHeight(20);
    lDaten4.setPrefWidth(46);
    lDaten4.setText("Daten");
    pane4.getChildren().add(lDaten4);
    taDaten4.setLayoutX(56);
    taDaten4.setLayoutY(40);
    taDaten4.setPrefHeight(84);
    taDaten4.setPrefWidth(432);
    taDaten4.setOnKeyReleased(
      (event) -> {taDaten_KeyReleased(event);} 
    );
    pane4.getChildren().add(taDaten4);
    lHash4.setLayoutX(8);
    lHash4.setLayoutY(161);
    lHash4.setPrefHeight(20);
    lHash4.setPrefWidth(46);
    lHash4.setText("Hash");
    pane4.getChildren().add(lHash4);
    tfHash4.setLayoutX(56);
    tfHash4.setLayoutY(161);
    tfHash4.setPrefHeight(25);
    tfHash4.setPrefWidth(432);
    tfHash4.setEditable(false);
    pane4.getChildren().add(tfHash4);
    bMine4.setLayoutX(56);
    bMine4.setLayoutY(192);
    bMine4.setPrefHeight(25);
    bMine4.setPrefWidth(75);
    bMine4.setOnAction(
      (event) -> {bMine4_Action(event);} 
    );
    bMine4.setText("Mine");
    pane4.getChildren().add(bMine4);
    spBlock4.setLayoutX(248);
    spBlock4.setLayoutY(5);
    spBlock4.setPrefHeight(27);
    spBlock4.setPrefWidth(54);
    spBlock4.setOnMouseClicked(
      (event) -> {spBlock_MouseClicked(event);} 
    );
    pane4.getChildren().add(spBlock4);
    lVorher4.setLayoutX(8);
    lVorher4.setLayoutY(132);
    lVorher4.setPrefHeight(20);
    lVorher4.setPrefWidth(38);
    lVorher4.setText("Vorher");
    pane4.getChildren().add(lVorher4);
    tfVorherigerHash4.setLayoutX(56);
    tfVorherigerHash4.setLayoutY(132);
    tfVorherigerHash4.setPrefHeight(25);
    tfVorherigerHash4.setPrefWidth(432);
    tfVorherigerHash4.setEditable(false);
    pane4.getChildren().add(tfVorherigerHash4);
    tfVorherigerHash4.setEditable(false);
        
    primaryStage.setOnShowing(
      (event) -> {primaryStage_Showing(event);} 
    );
    // Ende Komponenten
    
    primaryStage.setAlwaysOnTop(false);
    primaryStage.setOnCloseRequest(e -> System.exit(0));
    primaryStage.setTitle("GuiBlockchain");
    primaryStage.setScene(scene);
    primaryStage.show();
  } 
  
  // Anfang Methoden
  
  public static void main(String[] args) {
    launch(args);
  } // end of main
  
  public void primaryStage_Showing(Event evt) {
    String _64Nullen = "0000000000000000000000000000000000000000000000000000000000000000";
    eineBlockChain.NeuerBlock(1, 867062, _64Nullen, "Gerhard zahlt 50 Coins an Lutz");
    eineBlockChain.NeuerBlock(2, 368769, eineBlockChain.getBlock(1).getHash(), "Gerhard zahlt 110 Coins Peer");
    eineBlockChain.NeuerBlock(3, 2280058, eineBlockChain.getBlock(2).getHash(), "Peer zahlt 40 Coins an Jacqueline");
    eineBlockChain.NeuerBlock(4, 707122, eineBlockChain.getBlock(3).getHash(), "Eva zahlt 35 Coins an Gerhard");
    ModelToView();
  } 
  
  public void setNonce(NumberField Nonce, int value) {
    int p = Nonce.getCaretPosition();
    Nonce.setInt(value);
    Nonce.positionCaret(p);
  }
  
  public void setText(TextArea Area, String value) {
    int p = Area.getCaretPosition();
    Area.setText(value);
    Area.positionCaret(p);
  }  

  public void ModelToView() {
    Block einBlock = eineBlockChain.getBlock(1);
    setNonce(nfNonce1, einBlock.getNonce());
    setText(taDaten1, einBlock.getDaten());
    tfVorherigerHash1.setText(einBlock.getVorgängerHash());
    tfHash1.setText(einBlock.getHash());
    ZeigeGültigkeit(einBlock.gültig(), pane1);

    einBlock = eineBlockChain.getBlock(2);
    setNonce(nfNonce2, einBlock.getNonce());   
    setText(taDaten2, einBlock.getDaten());
    tfVorherigerHash2.setText(einBlock.getVorgängerHash());
    tfHash2.setText(einBlock.getHash());
    ZeigeGültigkeit(einBlock.gültig(), pane2);
    
    einBlock = eineBlockChain.getBlock(3);
    setNonce(nfNonce3, einBlock.getNonce());
    setText(taDaten3, einBlock.getDaten());
    tfVorherigerHash3.setText(einBlock.getVorgängerHash());
    tfHash3.setText(einBlock.getHash());
    ZeigeGültigkeit(einBlock.gültig(), pane3);
    
    einBlock = eineBlockChain.getBlock(4);
    setNonce(nfNonce4, einBlock.getNonce());
    setText(taDaten4, einBlock.getDaten());
    tfVorherigerHash4.setText(einBlock.getVorgängerHash());
    tfHash4.setText(einBlock.getHash());
    ZeigeGültigkeit(einBlock.gültig(), pane4);       
  }
  
  public void ViewToModel() {
    Block einBlock = eineBlockChain.getBlock(1);
    einBlock.setNonce(nfNonce1.getInt());
    einBlock.setNr(spBlock1.getValue());
    einBlock.setSchwierigkeit(spSchwierigkeit1.getValue());
    einBlock.setDaten(taDaten1.getText());
    einBlock.berechneHash();
    
    einBlock = eineBlockChain.getBlock(2);
    einBlock.setNonce(nfNonce2.getInt());
    einBlock.setNr(spBlock2.getValue());
    einBlock.setSchwierigkeit(spSchwierigkeit2.getValue());
    einBlock.setDaten(taDaten2.getText());
    einBlock.setVorgängerHash(eineBlockChain.getBlock(1).getHash());
    einBlock.berechneHash();
    
    einBlock = eineBlockChain.getBlock(3);
    einBlock.setNonce(nfNonce3.getInt());
    einBlock.setNr(spBlock3.getValue());
    einBlock.setSchwierigkeit(spSchwierigkeit3.getValue());
    einBlock.setDaten(taDaten3.getText());
    einBlock.setVorgängerHash(eineBlockChain.getBlock(2).getHash());
    einBlock.berechneHash();
    
    einBlock = eineBlockChain.getBlock(4);
    einBlock.setNonce(nfNonce4.getInt());
    einBlock.setNr(spBlock4.getValue());
    einBlock.setSchwierigkeit(spSchwierigkeit4.getValue());
    einBlock.setDaten(taDaten4.getText());
    einBlock.setVorgängerHash(eineBlockChain.getBlock(3).getHash());
    einBlock.berechneHash();
  } 
  
  public void ZeigeGültigkeit(boolean gültig, Pane aPane) {
    if (gültig)
      aPane.setStyle("-fx-background-color: #DBF0D4;");
    else 
      aPane.setStyle("-fx-background-color: #F7D9D9;");
  }
  
  public void bMine1_Action(Event evt) {
    ViewToModel();
    eineBlockChain.getBlock(1).mine();
    ModelToView();
  } 

  public void bMine2_Action(Event evt) {
    ViewToModel();
    eineBlockChain.getBlock(2).mine();
    ModelToView();    
  } 

  public void bMine3_Action(Event evt) {
    ViewToModel();
    eineBlockChain.getBlock(3).mine();
    ModelToView();    
  } 

  public void bMine4_Action(Event evt) {
    ViewToModel();
    eineBlockChain.getBlock(4).mine();
    ModelToView(); 
  } 

  public void spBlock_MouseClicked(MouseEvent evt) {
    ViewToModel();
    ModelToView();
  } 
  
  public void taDaten_KeyReleased(KeyEvent evt) {
    ViewToModel();
    ModelToView();
  } 

  // Ende Methoden
} // end of class GuiBlockchain
