110 likes | 218 Views
The Voltron.GUI API. With a short description of Voltron.Controller. Overview of the GUI API. We have three main categories of interface Classes implemented by the UI for use by the controller or model Classes containing data the UI will need or representing data objects in the world
E N D
The Voltron.GUI API With a short description of Voltron.Controller
Overview of the GUI API • We have three main categories of interface • Classes implemented by the UI for use by the controller or model • Classes containing data the UI will need or representing data objects in the world • Adapters that allow the UI to notify the model when the user performs an action
Internal Class API • IView • Represents the GUI as a whole. • Should be notified whenever a node is directly connected or disconnected, and updated the status of jobs • Implemented by MainForm.cs, the main GUI class, but could be moved out into a separate class if the code gets too large
Login/Authentication API • GetLogin class • Allows the controller to request login information from the view • LoginInfo class • Contains two string fields for the username and password • Essentially a structure so GetLogin can return a pair of strings
Data Representation API • IComputer • Represents a single computer on the grid • Has methods for getting resource info, location, and name • ILocation • Contained by a given IComputer • Represents a location of the computer in the world
Adapters API • INetworkAdapter • Allows the computer to interact with the grid as a network • Currently allows view to walk network • IConnectionAdapter • Manages the view’s notion of connections • Currently allows the view to make or break direct connections to remote hosts
Adapters API (2) • IFileSystemAdapter • Encapsulates the notion of getting files from or giving files to any provider • Can get, delete, and put files into the abstract file system by a string filename • IFlatFileSystemAdapter • Adds the ability to list all of the files in the file system, since it lacks hierarchy
UML Diagram of the GUI MainForm IView LoginDialog IFileSytstemAdapter IFlatFileSytstemAdapter IConnectionAdapter ILocation IComputer LoginInfo GetLogin INetworkAdapter
Story – Running a Process The user would like to run one of the processes that is shown graphically in the view of the file system. The user single-clicks on the file they want to run, and then drags it onto the view of the grid (the blob). The file is then run by the grid, and its status is shown on the process panel, which tells the user which computer this process is being run on, and its status (running/done).
Story – Direct Connection A user would like to directly connect to one of the computers in the grid. To do this, the user right-clicks on one of the entries on the processes panel. They then select on the right-click menu to directly connect to the computer that process was run on in the grid. If a direct connection has not already been established with this computer, a connection is established, and the computer that was connected to is displayed in the directly connected panel.
Controller Overview • Basic idea – implement classes the subprojects need and pass around information between model and view • Contains implementations of UI adapters • Encapsulate startup code for running the entire program