Class SelectBoxService

java.lang.Object
cz.fidentis.analyst.gui.task.batch.SelectBoxService

public class SelectBoxService extends Object
In contrast to the FacesProxy, which deals with faces that are the subject of batch processing, this class add handling of the (optionally computed) average face. While the faces can be temporarily dumped, the average face is always in the memory. It is assumed that the average face is added as the first item of a menu (combo box), whenever is computed. This class provides methods for such menu (combo box) management and synchronization.
  • Constructor Details

    • SelectBoxService

      public SelectBoxService()
  • Method Details

    • syncSelectionMenu

      public static void syncSelectionMenu(Task task, FaceReference avgFace, boolean selectNewAvgFace, JComboBox<String> cbox)
      Fill the menu (combo box) with names of faces, including the average face, if provided as input parameter. The average face is stored. An action event is triggered automatically by the cbox with with the originally selected item or the newly added average face.
      Parameters:
      avgFace - The average face, can be null
      selectNewAvgFace - If true and a new average is added, then the average face is automatically selected. If the avgFace is null, then this parameter has no effect.
      cbox - A combo box (menu)
    • syncSelectionMenu

      public static void syncSelectionMenu(Task task, boolean selectNewAvgFace, JComboBox<String> cbox)
      Fill the menu (combo box) with names of faces stored in the face proxy, plus the optional average face. An action event is triggered automatically by the cbox with the originally selected item or the newly added average face.
      Parameters:
      selectNewAvgFace - If true and a new average is added, then the average face is automatically selected.
      cbox - A combo box (menu)
    • getSelectedFace

      public static FaceReference getSelectedFace(Task task, JComboBox<String> cbox)
      Returns the face selected in a menu.
      Parameters:
      cbox - A combo box (menu)
      Returns:
      The face selected in a menu. This is either some face from the dataset, or the average face.