1 / 7

CSC 7322 : Object Oriented Development J Paul Gibson, A207 paul.gibson@int-edu.eu

CSC 7322 : Object Oriented Development J Paul Gibson, A207 paul.gibson@int-edu.eu http://www-public. it-sudparis.eu /~gibson/Teaching/CSC7322/. Dice MVC Problem …/~ gibson / Teaching /CSC7322/L6-Dice-MVC-PBL.pdf. A Simple Dice Button Frame. import models.Dice ;

darcie
Télécharger la présentation

CSC 7322 : Object Oriented Development J Paul Gibson, A207 paul.gibson@int-edu.eu

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSC 7322 : Object OrientedDevelopment J Paul Gibson, A207 paul.gibson@int-edu.eu http://www-public.it-sudparis.eu/~gibson/Teaching/CSC7322/ Dice MVC Problem …/~gibson/Teaching/CSC7322/L6-Dice-MVC-PBL.pdf TSP: Software Engineering

  2. A Simple DiceButton Frame importmodels.Dice; importviews.DiceButtonView; importcontrollers.DiceButtonController; publicclassDiceButton { publicstaticvoid main(String args[]) { Dice dm = newDice(6); DiceButtonControllerdc = newDiceButtonController(dm); DiceButtonViewdv = newDiceButtonView(dm, dc); dc.updateView(dv); } } Each time the buttonispressed the button label isupdated TSP: Software Engineering

  3. A more graphicalcanvas package applications; importmodels.Dice; importviews.DiceButtonGraphicsView; importcontrollers.DiceButtonController; publicclassDiceButtonGraphics { publicstaticvoid main(String args[]) { Dice dm = newDice(6); DiceButtonControllerdc = newDiceButtonController(dm); DiceButtonGraphicsViewdv = newDiceButtonGraphicsView(dm, dc); dc.updateView(dv); } } Each time the buttonispressed the button label isupdated and the graphicscanvasrepaintedwith the correct number of spots TSP: Software Engineering

  4. A more graphicalcanvas: separate the controller and view frames package applications; importmodels.Dice; importviews.DiceButtonGraphicsView; importcontrollers.DiceButtonController; publicclassDiceButtonGraphics { publicstaticvoid main(String args[]) { Dice dm = newDice(6); DiceButtonControllerdc = newDiceButtonControllerSeparate(dm); DiceButtonGraphicsViewdv = newDiceButtonGraphicsViewSeparate(dm, dc); dc.updateView(dv); } } Each time the buttonispressed the button label isupdated and the graphicscanvasrepaintedwith the correct number of spots TSP: Software Engineering

  5. A more graphicalcanvas: re-use the pattern for a green 8-sideddice package applications; importmodels.Dice; importviews.DiceButtonGraphicsView; importcontrollers.DiceButtonController; publicclassDiceButtonGraphics { publicstaticvoid main(String args[]) { Dice dm = newDice(8); DiceButtonControllerdc = newDiceButtonControllerSeparate(dm); DiceButtonGraphicsViewdv = newDiceButtonGraphicsViewSeparateGreen(dm, dc); dc.updateView(dv); } } Each time the buttonispressed the button label isupdated and the graphicscanvasrepaintedwith the correct number of spots TSP: Software Engineering

  6. A more graphicalcanvas: 1 button, 2 6-sideddice publicclassDoubleDice_MVC { publicstaticvoid main(String args[]) { finalint SIDES = 6; DiceModel dm1 = newDiceModel(SIDES); DiceModel dm2 = newDiceModel(SIDES); DiceButtonDoubleControllerdc = newDiceButtonDoubleController(dm1,dm2); DiceGraphicsView dv1 = newDiceGraphicsView(dm1); DiceGraphicsView dv2 = newDiceGraphicsView(dm2); } } TSP: Software Engineering

  7. A frequencyhistogram for 2 6-Sideddice How easyisit to extend the dice GUI to add a histogramview of the frequencystatistics: 1 * 6-sideddice 2 * 8-sideddice Focus on using the MVC design pattern, and re-use (re-usability) TSP: Software Engineering

More Related