gui.ClientAppViewController - rsanchez-wsu/jfiles GitHub Wiki

This class is the controller for the main client application view.

Package: gui

Implements: Initializable, ClipboradOwner

Member Variables

  • 'private enum Operation' - Type for storing last operation.
  • 'static final Logger Logger' - gets logger for the ClientAppViewController.

Private:

  • 'SocketClient client' - Default value NULL.
  • 'FileStruct selectedFile' - Default value NULL.
  • 'String currentDirectory' - Default value NULL.
  • 'Map<FileStruct, Parent> contents' - Default value NULL.
  • 'Operation lastOperation' - Default value NULL.
  • 'Clipboard clipboard' - Default value NULL.
  • 'ContextMenu fileContextMenu' - Default value NULL.
  • 'ContextMenu viewContextMenu' - Default value NULL.

Public:

  • '@FXML BorderPane root' - Default value NULL.
  • '@FXML TreeView treeView' - Default value NULL.
  • '@FXML FlowPane flowPane' - Default value NULL.

Functions

+ private void clearView()

Clears the view

+ private void loadDirectory(String path)

Parameters:

  • 'path' - the path to load.

Loads the given directory into the view.

+ public void setSelectedFile(FileStruct fs)

Parameters:

  • 'fs' - fileStruct to set.

Sets the current selected file.

+ private ContextMenu buildFileContextMenu()

Builds a context menu for files, returns a context menu.

+ private ContextMenu buildViewContextMenu()

Builds a context menu for main view, returns a context menu.

+ public void cut()

Conducts the cut operation.

+ public void copy()

Conducts the copy operation.

+ public void paste()

Conducts the paste operation.

+ public void delete()

Conducts the delete operation.

+ public void handleMouseClicked()

Handles mouse clicks in the flowPane.

+ public void onDragOver(DragEvent event)

Parameters:

  • 'event' - A drag event.

Handles dragging files over the view.

+ public void onDragDrop(DragEvent event)

Parameters:

  • 'event' - A drag event.

Handles dropping files on the view.

+ public void contextMenuRequested(ContextMenuEvent event)

Parameters:

  • 'event' - The event.

Context menu requested action.

+ public void initialize(URL location, ResourceBundle resources)

Parameters:

  • 'location' -
  • 'resources' - resources for initialization of the app view.

Initializes the app view.

+ public void lostOwnership(Clipboard clipboard, Transferable transferable)

Parameters:

  • 'clipboard' - clipboard used for cut,copy, and paste operations.
  • 'transferable'

Handles losing ownership of the clipboard NOTE: this is required for the ClipboardOwner interface.

⚠️ **GitHub.com Fallback** ⚠️