This project implements a state management system in Java. It handles different states of a process or task and includes a graphical user interface (GUI) for interaction. Below is a detailed description of the main components and their functionality.
-
Purpose:
This class represents the state of a process. -
Attributes:
state(int): Can hold the following values:- -1: "等待中" (Waiting)
- 0: "进行中" (In Progress)
- 1: "已完成" (Completed)
-
Methods:
getState(): Returns the current state as an integer.toString(): Provides a string description of the current state in Chinese.changeState(): Advances the state sequentially from -1 to 0 to 1, where 1 is the terminal state.
-
State Transitions:
Seamless transitions between the states: Waiting, In Progress, and Completed. -
Error Handling:
If an invalid state is detected, it returns"错误"(Error). -
Change Logic:
Prevents state transitions beyond the terminal state (1), ensuring logical state progression.
-
Compile the Project
Use any Java development environment to compile the files. -
Run the Application
Interact with the process states using the provided GUI. -
State Management
TheStateclass manages state transitions, progressing from Waiting to Completed.
- Clone the repository:
git clone <repository-url>

