Class ProjectPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ProjectPanel extends JPanel
The left-hand part of the project dashboard consisting of a project toolbar and a table of faces. This panel also handles the list of tasks (analytical tabs).
See Also:
  • Field Details

    • ACTION_FACES_SELECTED

      public static final String ACTION_FACES_SELECTED
      See Also:
    • MAX_OPEN_FACES

      public static final int MAX_OPEN_FACES
      If more that MAX_OPEN_FACES are selected for the single face analysis, a warning dialogue appears informing that multiple tabs are to be opened.
      See Also:
  • Constructor Details

    • ProjectPanel

      public ProjectPanel()
      Constructor.
  • Method Details

    • addActionListener

      public void addActionListener(ProjectPanelAction action)
      Setting a ProjectPanelAction is mandatory for the communication between this panel and project's control panels.
      Parameters:
      action - Project panel action listener with the interaction code
    • getProject

      public Project getProject()
      Returns project instance
      Returns:
      project instance
    • getProjectTable

      public ProjectTable getProjectTable()
      Returns internal project table with the list of faces
      Returns:
      internal project table with the list of faces
    • createNewProject

      public final Project createNewProject()
      Creates new empty project.
      Returns:
      Previous project or null
    • openProject

      public Project openProject(File dir)
      Opens an exiting project from disk
      Parameters:
      dir - Project's folder
      Returns:
      Previous project or null
    • saveProject

      public void saveProject()
      Saves project to disk. Sets the state of the project to "unchanged". Therefore, call !project.changed() to check whether the project was saved successfully.
    • openTaskTab

      protected TaskWindow openTaskTab(FacesProxy taskFaces)
      Creates and/or opens an analytical tab. Its type is selected automatically.
      Parameters:
      taskFaces - Task faces
      Returns:
      new task window, null if the task already exists.
    • closeTaskTab

      protected void closeTaskTab(TaskWindow tab)
      Closes task tab.
      Parameters:
      tab - task window to be closed
    • removeSelectedFaces

      protected void removeSelectedFaces()
      Finds selected rows in the table, closes task tabs in which corresponding faces appear and removes rows fro the table.
    • addFacesToProject

      protected void addFacesToProject()
      Pops up a file selection dialogue and then adds selected faces into the project. The project state is set to "changed".
    • addFaceToTable

      protected void addFaceToTable(int faceIndex)
      Adds a single face into the project's table. The face has to be already included in the project.faces proxy. The project state is set to "changed".
      Parameters:
      faceIndex - Index of the face from pro project instance to be added into the table
    • focusTaskTab

      protected void focusTaskTab(String taskName)
      Sets active (pops up) a task tab with the given name
      Parameters:
      taskName - Task name
    • getSelectedFaceFiles

      protected List<File> getSelectedFaceFiles()