Package UI
Class Event
- java.lang.Object
-
- UI.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
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<Position>
listOfValidPosition
-
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.
-
-
-
Field Detail
-
listOfValidPosition
java.util.List<Position> listOfValidPosition
-
-
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 interfacejava.awt.event.ActionListener
- Parameters:
e
- The ActionEvent object representing the button click event.
-
-