ActionScript 3.0 Design Patterns
440 | Chapter 12: Model-View-Controller Pattern update notices from the model. TheRootNodeViewcomposite view will have two child ...
Minimalist Example of an MVC Pattern | 441 Both component view classes CharCodeLeafView (Example 12-10) and AsciiCharLeafView(Ex ...
442 | Chapter 12: Model-View-Controller Pattern // composite view var rootView:CompositeView = new RootNodeView(model,controller ...
Example: Weather Maps | 443 Key OOP Concepts in the MVC Pattern The key concept in the MVC pattern isloose coupling. Loose coupl ...
444 | Chapter 12: Model-View-Controller Pattern regional maps available from the web site. The data is the URLs of the satellite ...
Example: Weather Maps | 445 The next step is to implement the IModel interface and develop the model (Example 12-13). Example 12 ...
446 | Chapter 12: Model-View-Controller Pattern Note theupdate( )method in theModelclass shown in Example 12-13. It dispatches a ...
Example: Weather Maps | 447 The Views The weather map application consists of two views. The first is a user interface ele- ment ...
448 | Chapter 12: Model-View-Controller Pattern Combo box view The CBViewclass (Example 12-16) subclassesCompositeView (Example ...
Example: Weather Maps | 449 TheCBViewclass (Example 12-16) gets the list of region names from the model (line and adds them to ...
450 | Chapter 12: Model-View-Controller Pattern TheMapViewclass (Example 12-17) loads and displays the satellite image, and does ...
Extended Example: Infrared Weather Maps | 451 Note that only the combo bo xview that’s at the root of the composite view struc- ...
452 | Chapter 12: Model-View-Controller Pattern Let’s look at the changes needed to update the model. Adding a New Model Instead ...
Extended Example: Infrared Weather Maps | 453 InterfaceINewModelextends theIModelinterface (Example 12-12) and defines the metho ...
454 | Chapter 12: Model-View-Controller Pattern ThegetMapURL( )method was overridden, as the returned image URL now depends on t ...
Extended Example: Infrared Weather Maps | 455 TheRBViewclass (Example 12-21) subclassesComponentView(Example 12-7) and draws the ...
456 | Chapter 12: Model-View-Controller Pattern given time. As in previous view implementations, theupdate( )method is called wi ...
Example: Cars | 457 // add map type select radio button group view as child var mapTypeView:ComponentView = new RBView(model, ma ...
458 | Chapter 12: Model-View-Controller Pattern The Model Let’s first develop the interface for our car model. We should be able ...
Example: Cars | 459 carMoveTimer.start( ); } public function setLoc(pt:Point):void { ptLoc = pt; } public function getLoc( ):Poi ...
«
18
19
20
21
22
23
24
25
26
27
»
Free download pdf