Class MainWindow

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class MainWindow extends JFrame
MainWindow is a class that extends JFrame and represents the main window of the application. This window is used to display the Jellyfin items and folders to the user. The class contains methods to connect to the Jellyfin API, parse the response, and display the items and folders.
Author:
Cesar Bianchi
See Also:
  • Field Details

  • Constructor Details

    • MainWindow

      public MainWindow()
      Constructs a new MainWindow. This constructor initializes the components of the window.
      Since:
      1.0
  • Method Details

    • setInstanceData

      public void setInstanceData(JellyfinInstanceDetails instData)
      Sets the instance data and updates the base URL and API token in the ConnectAPI. This method sets the instance data to the given JellyfinInstanceDetails, and updates the base URL and API token in the ConnectAPI with the base URL and API token from the given JellyfinInstanceDetails.
      Parameters:
      instData - The JellyfinInstanceDetails to be set.
      Since:
      1.0
      See Also:
    • main

      public static void main(String[] args)
      Parameters:
      args - the command line arguments
    • setFieldsValues

      public void setFieldsValues()
      Sets the field values based on the selected item in the list. This method displays a waiting window and sets the cursor to the waiting cursor. It then calls the setFieldsValuesBackground method to load the fields and grids. After the fields and grids are loaded, it sets the cursor back to the default cursor.
      Since:
      1.0
    • reloadFolderItems

      public void reloadFolderItems()
      Reloads the folder items displayed in the MainWindow. This method clears the current list of folder items, then reloads them by calling the loadFolders method. If an error occurs while loading the folders, it is logged and the method exits.
      Throws:
      IOException - If an I/O error occurs. This can happen if there's a problem with the network connection, the server, or the local machine.
      org.json.simple.parser.ParseException - If there is an error parsing the server's response. This can happen if the server's response does not match the expected format.
      Since:
      1.1
    • preDefineFooter

      public void preDefineFooter()
      Pre-defines the footer labels with initial text while establishing a connection. This method sets the initial text for the footer labels to indicate that the connection is being established.
      Since:
      1.2.0.
    • prepareFooter

      public void prepareFooter()
      Prepares the footer labels with the connection details after a successful connection. This method sets the text for the footer labels with the details of the connected Jellyfin instance.
      Since:
      1.0