Objects and Design
Objects and Design CS 2340
Popular in Course
Popular in ComputerScienence
This 0 page Study Guide was uploaded by Alayna Veum on Monday November 2, 2015. The Study Guide belongs to CS 2340 at Georgia Institute of Technology - Main Campus taught by Staff in Fall. Since its upload, it has received 35 views. For similar materials see /class/234140/cs-2340-georgia-institute-of-technology-main-campus in ComputerScienence at Georgia Institute of Technology - Main Campus.
Reviews for Objects and Design
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 11/02/15
Volcano M4 Document Devin Hunt and John White Candidate Classes Graph Node Edge GraphIO Algorithm BreadthFirstSearch ShortestPath MinimumSpanning Tree MaXFlow GraphConnectivity GraphEditor GraphComponentFactory NodeComponent EdgeComponent Scenarios Scenario User Creates New Graph A user runs the program A new GraphEditor is made The GraphEditor object creates a new undirected Graph model which will be edited The user is presented with a blank screen Scenario User Toggles Between Directed and Undirected Mode A user changes an undirected graph into a directed graph by clicking on a U1 component The component then notifies the Graph object through the GraphEditor that it is now a directed graph The Graph object then updates all of its Edge references by notifying them that they are now directed The EdgeComponent updates itself based on the change from its reference object Edge The current view is invalidated and the EdgeComponent displays its changes through the graphic context Scenario User Adds a Node to the Graph A user clicks on the UI and the GraphEditor handles the input by sending a request for a NodeComponent to the GraphComponentFactory The GraphEditor tells the Graph object to create a new Node The Graph object keeps a reference to the Node and returns it to the GraphEditor The GraphEditor sends the reference of the Node object to the NodeComponent object and the new NodeComponent is added to the dependency list of the new Node Scenario User Removes Node from the Graph A user clicks on the UI and the GraphEditor handles the input by sending a message to the Graph object The message tells the Graph object to remove the particular Node object The Graph object tells the Node that it is removed and then dereferences it The NodeComponent knows the Node is removed and then destroys itself and invalidates the view Scenario User Adds Edge between two Nodes A user wishes to join two nodes A and B such that the edge represents a directed connection from B to A with a weight of 11 The user first mouses over the UI component that represents B As she does so the UI component gains some buttons around its representation One is labeled Add Edge The user clicks and drags off this button and towards A As she does so a line is drawn between B and the mouse cursor When the cursor is over A A becomes highlighted signaling a valid selection The user releases the mouse button signaling the selection In doing so the GraphEditor requests a new EdgeComponent from the GraphComponentFactory This new EdgeComponent is added to the component list and the view is invalidated When the EdgeComponent is drawn to the the screen it will ask for the user to input it39s weight and if it was directed The user inserts 11 into the text field and signals that the edge was directed Once this is complete a new Edge can be added the Graph The Graph takes in the two nodes A and B and the edge weight as input When the new edge is created the GraphEditor receives an update message from the Graph model and updates the display to re ect the new edge Scenario User Loads a Graph le adds an edge and then saves the Graph le The GraphEditor receives a request to load a graph data from a properly formated file This request is accompanied by a string representation of the les location The GraphEditor passes this request to a new instance of the GraphIO class GraphIO then opens the le stream and begins to parse the file In doing so multiple things will occur First GraphIO will create a new instance of Graph GraphIO will also create multiple instances of Node which will be added to the new Graph As the file describes associations between the Nodes Edges will be made Once the parsing is complete the GraphIO will return the new Graph object Once the view has been updated to re ect the fresh Graph the user adds a new edge This is accomplished much in the same method as described above Once the graph has been changed to the users liking it is saved back to file This is done by passing the Graph model to the instance of GraphIO GraphIO then opens the le and begins to output the graph model using a standardized language Once this is complete the file is closed and the user is noti ed of the successful save Scenario User Runs Shortest Path Algorithm on the Graph A user wishes to run the shortest path algorithm on the current Graph model After selecting the algorithm the user is prompted to select two nodes to run between The selecte NodeComponents re ect the nodes the user wishes to run between Once the selection is complete the GraphEditor creates an instance of the ShortestPathAlgorithm and then using the information from the selected NodeComponents passes in the two nodes along with the
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'