Package UI

Class Event

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.util.EventListener

    public class Event
    extends java.lang.Object
    implements java.awt.event.ActionListener
    The Event class implements the ActionListener interface and handles button click events for a user interface associated with the "Domineering" game.
    Since:
    2023-12-01
    Version:
    1.0
    Author:
    Laamiri Ouail & Hajar Sadik
    • Constructor Summary

      Constructors 
      Constructor Description
      Event()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)
      Handles button click events, making moves in the "Domineering" game.
      void makeMove​(Button sourceButton)
      Makes a move in the game based on the button clicked.
      void setLabelMessage​(Label labelMessage)
      Sets the label message for the UI.
      void toEnableBtns​(boolean enable)
      Enables or disables all buttons in the UI.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • listOfValidPosition

        java.util.List<Position> listOfValidPosition
    • Constructor Detail

      • Event

        public Event()
    • Method Detail

      • setLabelMessage

        public void setLabelMessage​(Label labelMessage)
        Sets the label message for the UI.
        Parameters:
        labelMessage - The label message to be set.
      • toEnableBtns

        public void toEnableBtns​(boolean enable)
        Enables or disables all buttons in the UI.
        Parameters:
        enable - True to enable, false to disable.
      • makeMove

        public void makeMove​(Button sourceButton)
        Makes a move in the game based on the button clicked.
        Parameters:
        sourceButton - The button that was clicked.
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        Handles button click events, making moves in the "Domineering" game.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        e - The ActionEvent object representing the button click event.