Class CameraDesktopController

java.lang.Object
com.serinity.accesscontrol.controller.CameraDesktopController

public final class CameraDesktopController extends Object
Controller for 'camera-desktop.fxml'.

Supports two modes:

  • RECOGNIZE (default) – matches a detected face against all stored embeddings and closes the window on success (used at login).
  • ENROLL – captures the user's face, saves the embedding to the DB, and closes the window (used from the user dashboard toggle).
Set enroll mode before showing the stage via setEnrollMode(User, Runnable).
Since:
2026-02-27 CameraDesktopController.java
Version:
1.0
Author:
@ZouariOmar (zouariomar20@gmail.com)
  • Constructor Details

    • CameraDesktopController

      public CameraDesktopController()
      Creates a new camera desktop controller.
  • Method Details

    • setRecognizeMode

      public void setRecognizeMode(Consumer<User> onRecognizeSuccess)
      Switch to recognize mode with a callback. Must be called before the stage is shown.
      Parameters:
      onRecognizeSuccess - callback invoked on the JavaFX thread with the matched User
    • setEnrollMode

      public void setEnrollMode(User user, Runnable onEnrollSuccess)
      Switch to enroll mode. Must be called before the stage is shown.
      Parameters:
      user - the user whose face will be enrolled
      onEnrollSuccess - callback invoked on the JavaFX thread after successful enrollment