Package belotetime.application.components

Source Code of belotetime.application.components.JoinButton

package belotetime.application.components;

import belotetime.core.controller.AbstractController;
import belotetime.core.view.StageView;
import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.control.Button;

public class JoinButton extends Button
{
  private int value;
  private StageView view;
 
  @SuppressWarnings({ "unchecked", "rawtypes" })
  public JoinButton(String title, int value, StageView view)
  {
    super(title);
    this.value = value;
    this.view = view;
   
    setOnAction(new EventHandler()
    {
      @Override
      public void handle(Event event)
      {
        Object[] obj = new Object[1];
        obj[0] = JoinButton.this.value;
        JoinButton.this.view.getController().execute("setValue", obj);
        JoinButton.this.view.getController().removeView(JoinButton.this.view);
        JoinButton.this.view.getController().execute("addGamePlayer", null);
        JoinButton.this.view.hide();
      }
    });
  }
 
  public int getValue()
  {
    return value;
  }
}
TOP

Related Classes of belotetime.application.components.JoinButton

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.