SudokuFX
Loading...
Searching...
No Matches
fr.softsf.sudokufx.service.ui.SpinnerService Class Reference

A centralized service for managing the global loading state through a thread-safe reference counter. More...

Collaboration diagram for fr.softsf.sudokufx.service.ui.SpinnerService:

Public Member Functions

ReadOnlyBooleanProperty loadingProperty ()
 Returns a read-only observable property indicating whether a loading process is active.
void startLoading ()
 Increments the active task counter and activates the loading state upon the first registration.
void stopLoading ()
 Decrements the active task counter and deactivates the loading state only when no more tasks are pending.

Private Attributes

final ReadOnlyBooleanWrapper loading = new ReadOnlyBooleanWrapper(false)
final AtomicInteger taskCount = new AtomicInteger(0)

Detailed Description

A centralized service for managing the global loading state through a thread-safe reference counter.

This service ensures the UI spinner remains active as long as at least one background task is being processed.

Member Function Documentation

◆ loadingProperty()

ReadOnlyBooleanProperty fr.softsf.sudokufx.service.ui.SpinnerService.loadingProperty ( )

Returns a read-only observable property indicating whether a loading process is active.

Returns
The loading property

◆ startLoading()

void fr.softsf.sudokufx.service.ui.SpinnerService.startLoading ( )

Increments the active task counter and activates the loading state upon the first registration.

Executed on the JavaFX Application Thread.

◆ stopLoading()

void fr.softsf.sudokufx.service.ui.SpinnerService.stopLoading ( )

Decrements the active task counter and deactivates the loading state only when no more tasks are pending.

Executed on the JavaFX Application Thread.

Member Data Documentation

◆ loading

final ReadOnlyBooleanWrapper fr.softsf.sudokufx.service.ui.SpinnerService.loading = new ReadOnlyBooleanWrapper(false)
private

◆ taskCount

final AtomicInteger fr.softsf.sudokufx.service.ui.SpinnerService.taskCount = new AtomicInteger(0)
private

The documentation for this class was generated from the following file: