ActionScript Developer’s Guide to Robotlegs by Joel Hooks & Stray (Lindsey Fallow)
Author:Joel Hooks & Stray (Lindsey Fallow) [Joel Hooks]
Language: eng
Format: epub
Tags: COMPUTERS / Software Development & Engineering / General
ISBN: 9781449308896
Publisher: O'Reilly Media
Published: 2011-08-07T16:00:00+00:00
Mediator Structure
Mediators are simple by design. As shown below, your mediators declare injections, register events to listen to, and define methods to handle those events.
Example 8-2. MosaicTool: GridViewMediator.as listens for events on its view and from the Context
public class GridViewMediator extends Mediator { [Inject] public var view:GridView; override public function onRegister():void { addViewListener(TileColorChangeEvent.CHANGED, dispatch, TileColorChangeEvent); addContextListener(TileSupplyEvent.SUPPLY_SELECTED, changeSelectionColor, TileSupplyEvent); addContextListener(TileSupplyEvent.SELECTED_SUPPLY_COLOR_CHANGED, changeSelectionColor, TileSupplyEvent); addContextListener(GroutEvent.COLOR_CHANGED, changeGroutColor, GroutEvent); addContextListener(GroutEvent.COLOR_LOADED, changeGroutColor, GroutEvent); addContextListener(DesignEvent.DESIGN_COLORS_CHANGED, redrawGrid, DesignEvent); dispatch(new GridReadyEvent(GridReadyEvent.READY)); } protected function changeSelectionColor(e:TileSupplyEvent):void { view.selectionColor = e.color; } protected function changeGroutColor(e:GroutEvent):void { view.groutColor = e.color; } protected function redrawGrid(e:DesignEvent):void { view.applyColorsToWholeGrid(e.colors); } }
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(16187)
The Mikado Method by Ola Ellnestam Daniel Brolund(13470)
Hello! Python by Anthony Briggs(13260)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(12406)
Dependency Injection in .NET by Mark Seemann(12265)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(11022)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(10883)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10540)
Grails in Action by Glen Smith Peter Ledbrook(10337)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(10297)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(9602)
Hit Refresh by Satya Nadella(9040)
Kotlin in Action by Dmitry Jemerov(9039)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(8703)
The Kubernetes Operator Framework Book by Michael Dame(8488)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8309)
Robo-Advisor with Python by Aki Ranin(8262)
Practical Computer Architecture with Python and ARM by Alan Clements(8234)
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(8204)