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.ActionListenerThe 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 voidactionPerformed(java.awt.event.ActionEvent e)Handles button click events, making moves in the "Domineering" game.voidmakeMove(Button sourceButton)Makes a move in the game based on the button clicked.voidsetLabelMessage(Label labelMessage)Sets the label message for the UI.voidtoEnableBtns(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:
actionPerformedin interfacejava.awt.event.ActionListener- Parameters:
e- The ActionEvent object representing the button click event.
-
-