Esempio n. 1
0
  /**
   * Purpose: Creates the post-login GUI for browsing remote files and rendering them on screen
   *
   * @param remoteFiles a static list of files that are present on the server and can be retrieved
   *     through the UI
   */
  private void createBrowserUI(File[] remoteFiles) {
    // reset the main area
    this.removeAll();
    JPanel mainPanel = new JPanel(new GridLayout(1, 1));
    this.add(mainPanel);

    // split the main panel vertically
    JSplitPane vertSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    vertSplitPane.setDividerSize(1);
    vertSplitPane.setEnabled(false);
    mainPanel.add(vertSplitPane);

    // create header controls
    vertSplitPane.setLeftComponent(createFileSelectionHeader());

    // split the lower content area horizontally
    JSplitPane hSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    browserController.setContentSplitter(hSplitPane);
    hSplitPane.setContinuousLayout(true);
    vertSplitPane.setRightComponent(hSplitPane);

    // add the file list to the left hand side
    JScrollPane fileListPane = createFileList(remoteFiles);
    hSplitPane.setLeftComponent(fileListPane);

    // initialize the browser control
    browserController.setSelectedFiles(null);
    this.revalidate();
    this.repaint();
  }