├── asdoc
├── images
│ ├── logo.jpg
│ ├── collapsed.gif
│ ├── expanded.gif
│ ├── inherit-arrow.gif
│ ├── titleTableTop.jpg
│ ├── detailHeaderRule.jpg
│ ├── inheritedSummary.gif
│ ├── titleTableBottom.jpg
│ ├── titleTableMiddle.jpg
│ └── detailSectionHeader.jpg
├── org
│ └── puremvc
│ │ └── as3
│ │ └── multicore
│ │ ├── patterns
│ │ ├── proxy
│ │ │ ├── class-list.html
│ │ │ └── package-detail.html
│ │ ├── facade
│ │ │ ├── class-list.html
│ │ │ └── package-detail.html
│ │ ├── mediator
│ │ │ ├── class-list.html
│ │ │ └── package-detail.html
│ │ ├── command
│ │ │ ├── class-list.html
│ │ │ └── package-detail.html
│ │ └── observer
│ │ │ ├── class-list.html
│ │ │ └── package-detail.html
│ │ ├── core
│ │ ├── class-list.html
│ │ └── package-detail.html
│ │ └── interfaces
│ │ ├── class-list.html
│ │ ├── package-detail.html
│ │ └── ICommand.html
├── package-frame.html
├── mxml-tags.html
├── index.html
├── index-list.html
├── package-list.html
├── appendixes.html
├── cookies.js
├── print.css
├── all-classes.html
├── title-bar.html
├── package-summary.html
├── all-index-B.html
├── all-index-J.html
├── all-index-K.html
├── all-index-Q.html
├── all-index-U.html
├── all-index-W.html
├── all-index-X.html
├── all-index-Y.html
└── all-index-Z.html
├── bin
└── PureMVC_AS3_MultiCore_1_0_5.swc
├── src
└── org
│ └── puremvc
│ └── as3
│ └── multicore
│ ├── interfaces
│ ├── ICommand.as
│ ├── IProxy.as
│ ├── IModel.as
│ ├── INotifier.as
│ ├── IController.as
│ ├── INotification.as
│ ├── IObserver.as
│ ├── IView.as
│ ├── IFacade.as
│ └── IMediator.as
│ ├── patterns
│ ├── command
│ │ ├── SimpleCommand.as
│ │ └── MacroCommand.as
│ ├── proxy
│ │ └── Proxy.as
│ ├── mediator
│ │ └── Mediator.as
│ └── observer
│ │ ├── Observer.as
│ │ ├── Notifier.as
│ │ └── Notification.as
│ └── core
│ ├── Model.as
│ └── Controller.as
├── LICENSE
├── VERSION
└── README.md
/asdoc/images/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PureMVC/puremvc-as3-multicore-framework/HEAD/asdoc/images/logo.jpg
--------------------------------------------------------------------------------
/asdoc/images/collapsed.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PureMVC/puremvc-as3-multicore-framework/HEAD/asdoc/images/collapsed.gif
--------------------------------------------------------------------------------
/asdoc/images/expanded.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PureMVC/puremvc-as3-multicore-framework/HEAD/asdoc/images/expanded.gif
--------------------------------------------------------------------------------
/asdoc/images/inherit-arrow.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PureMVC/puremvc-as3-multicore-framework/HEAD/asdoc/images/inherit-arrow.gif
--------------------------------------------------------------------------------
/asdoc/images/titleTableTop.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PureMVC/puremvc-as3-multicore-framework/HEAD/asdoc/images/titleTableTop.jpg
--------------------------------------------------------------------------------
/asdoc/images/detailHeaderRule.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PureMVC/puremvc-as3-multicore-framework/HEAD/asdoc/images/detailHeaderRule.jpg
--------------------------------------------------------------------------------
/asdoc/images/inheritedSummary.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PureMVC/puremvc-as3-multicore-framework/HEAD/asdoc/images/inheritedSummary.gif
--------------------------------------------------------------------------------
/asdoc/images/titleTableBottom.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PureMVC/puremvc-as3-multicore-framework/HEAD/asdoc/images/titleTableBottom.jpg
--------------------------------------------------------------------------------
/asdoc/images/titleTableMiddle.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PureMVC/puremvc-as3-multicore-framework/HEAD/asdoc/images/titleTableMiddle.jpg
--------------------------------------------------------------------------------
/asdoc/images/detailSectionHeader.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PureMVC/puremvc-as3-multicore-framework/HEAD/asdoc/images/detailSectionHeader.jpg
--------------------------------------------------------------------------------
/bin/PureMVC_AS3_MultiCore_1_0_5.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PureMVC/puremvc-as3-multicore-framework/HEAD/bin/PureMVC_AS3_MultiCore_1_0_5.swc
--------------------------------------------------------------------------------
/src/org/puremvc/as3/multicore/interfaces/ICommand.as:
--------------------------------------------------------------------------------
1 | /*
2 | PureMVC MultiCore - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved.
3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License
4 | */
5 | package org.puremvc.as3.multicore.interfaces
6 | {
7 | /**
8 | * The interface definition for a PureMVC Command.
9 | *
10 | * @see org.puremvc.as3.multicore.interfaces INotification
11 | */
12 | public interface ICommand extends INotifier
13 | {
14 | /**
15 | * Execute the ICommand's logic to handle a given INotification.
16 | *
17 | * @param note an INotification to handle.
18 | */
19 | function execute( notification:INotification ) : void;
20 | }
21 | }
--------------------------------------------------------------------------------
/asdoc/org/puremvc/as3/multicore/patterns/proxy/class-list.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
| Classes | 17 |
| Proxy | 20 |
| Classes | 17 |
| Facade | 20 |
| Classes | 17 |
| Mediator | 20 |
| Classes | 17 |
| MacroCommand | 20 |
| SimpleCommand | 23 |
| Classes | 17 |
| Controller | 20 |
| Model | 23 |
| View | 26 |
| Classes | 17 |
| Notification | 20 |
| Notifier | 23 |
| Observer | 26 |
ICommand implementation.
13 | *
14 | *
15 | * Your subclass should override the execute
16 | * method where your business logic will handle the INotification.
INotification.
27 | *
28 | *
29 | * In the Command Pattern, an application use-case typically
30 | * begins with some user action, which results in an INotification being broadcast, which
31 | * is handled by business logic in the execute method of an
32 | * ICommand.
INotification to handle.
35 | */
36 | public function execute( notification:INotification ) : void
37 | {
38 |
39 | }
40 |
41 | }
42 | }
--------------------------------------------------------------------------------
/asdoc/org/puremvc/as3/multicore/interfaces/class-list.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | | Interfaces | 17 |
| ICommand | 20 |
| IController | 23 |
| IFacade | 26 |
| IMediator | 29 |
| IModel | 32 |
| INotification | 35 |
| INotifier | 38 |
| IObserver | 41 |
| IProxy | 44 |
| IView | 47 |
| 50 | |
12 | * In PureMVC, IProxy implementors assume these responsibilities:
18 | * Additionally, IProxys typically:
INotifications when their model data changes.public static const called NAME, if they are not instantiated multiple times.
11 | * In PureMVC, IModel implementors provide
12 | * access to IProxy objects by named lookup.
15 | * An IModel assumes these responsibilities:
IProxy instancesIProxy instancesIProxy instance with the Model.
26 | *
27 | * @param proxyName the name to associate with this IProxy instance.
28 | * @param proxy an object reference to be held by the Model.
29 | */
30 | function registerProxy( proxy:IProxy ) : void;
31 |
32 | /**
33 | * Retrieve an IProxy instance from the Model.
34 | *
35 | * @param proxyName
36 | * @return the IProxy instance previously registered with the given proxyName.
37 | */
38 | function retrieveProxy( proxyName:String ) : IProxy;
39 |
40 | /**
41 | * Remove an IProxy instance from the Model.
42 | *
43 | * @param proxyName name of the IProxy instance to be removed.
44 | * @return the IProxy that was removed from the Model
45 | */
46 | function removeProxy( proxyName:String ) : IProxy;
47 |
48 | /**
49 | * Check if a Proxy is registered
50 | *
51 | * @param proxyName
52 | * @return whether a Proxy is currently registered with the given proxyName.
53 | */
54 | function hasProxy( proxyName:String ) : Boolean;
55 |
56 | }
57 | }
--------------------------------------------------------------------------------
/src/org/puremvc/as3/multicore/interfaces/INotifier.as:
--------------------------------------------------------------------------------
1 | /*
2 | PureMVC MultiCore - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved.
3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License
4 | */
5 | package org.puremvc.as3.multicore.interfaces
6 | {
7 | /**
8 | * The interface definition for a PureMVC Notifier.
9 | *
10 | *
11 | * MacroCommand, Command, Mediator and Proxy
12 | * all have a need to send Notifications.
15 | * The INotifier interface provides a common method called
16 | * sendNotification that relieves implementation code of
17 | * the necessity to actually construct Notifications.
20 | * The Notifier class, which all of the above mentioned classes
21 | * extend, also provides an initialized reference to the Facade
22 | * Singleton, which is required for the convienience method
23 | * for sending Notifications, but also eases implementation as these
24 | * classes have frequent Facade interactions and usually require
25 | * access to the facade anyway.
INotification.
34 | *
35 | * 36 | * Convenience method to prevent having to construct new 37 | * notification instances in our implementation code.
38 | * 39 | * @param notificationName the name of the notification to send 40 | * @param body the body of the notification (optional) 41 | * @param type the type of the notification (optional) 42 | */ 43 | function sendNotification( notificationName:String, body:Object=null, type:String=null ):void; 44 | 45 | /** 46 | * Initialize this INotifier instance. 47 | *48 | * This is how a Notifier gets its multitonKey. 49 | * Calls to sendNotification or to access the 50 | * facade will fail until after this method 51 | * has been called.
52 | * 53 | * @param key the multitonKey for this INotifier to use 54 | */ 55 | function initializeNotifier( key:String ): void; 56 | } 57 | } -------------------------------------------------------------------------------- /asdoc/index-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 || A | 27 |N | 28 | 29 |
| B | 34 |O | 35 | 36 |
| C | 41 |P | 42 | 43 |
| D | 48 |Q | 49 | 50 |
| E | 55 |R | 56 | 57 |
| F | 62 |S | 63 | 64 |
| G | 69 |T | 70 | 71 |
| H | 76 |U | 77 | 78 |
| I | 83 |V | 84 | 85 |
| J | 90 |W | 91 | 92 |
| K | 97 |X | 98 | 99 |
| L | 104 |Y | 105 | 106 |
| M | 111 |Z | 112 | 113 |
| org.puremvc.as3.multicore.core
18 | 19 | |
20 |
| org.puremvc.as3.multicore.interfaces
23 | 24 | |
25 |
| org.puremvc.as3.multicore.patterns.command
28 | 29 | |
30 |
| org.puremvc.as3.multicore.patterns.facade
33 | 34 | |
35 |
| org.puremvc.as3.multicore.patterns.mediator
38 | 39 | |
40 |
| org.puremvc.as3.multicore.patterns.observer
43 | 44 | |
45 |
| org.puremvc.as3.multicore.patterns.proxy | 48 |
| Appendix | Description | 37 |
|---|
IProxy implementation.
13 | *
14 | *
15 | * In PureMVC, Proxy classes are used to manage parts of the
16 | * application's data model.
19 | * A Proxy might simply manage a reference to a local data object,
20 | * in which case interacting with it might involve setting and
21 | * getting of its data in synchronous fashion.
24 | * Proxy classes are also used to encapsulate the application's
25 | * interaction with remote services to save or retrieve data, in which case,
26 | * we adopt an asyncronous idiom; setting data (or calling a method) on the
27 | * Proxy and listening for a Notification to be sent
28 | * when the Proxy has retrieved the data from the service.
11 | * In PureMVC, an IController implementor
12 | * follows the 'Command and Controller' strategy, and
13 | * assumes these responsibilities:
14 | *
ICommands
16 | * are intended to handle which INotifications.IObserver with
18 | * the View for each INotification
19 | * that it has an ICommand mapping for.ICommand
21 | * to handle a given INotification when notified by the View.ICommand's execute
23 | * method, passing in the INotification.ICommand class as the handler
34 | * for a particular INotification.
35 | *
36 | * @param notificationName the name of the INotification
37 | * @param commandClassRef the Class of the ICommand
38 | */
39 | function registerCommand( notificationName : String, commandClassRef : Class ) : void;
40 |
41 | /**
42 | * Execute the ICommand previously registered as the
43 | * handler for INotifications with the given notification name.
44 | *
45 | * @param notification the INotification to execute the associated ICommand for
46 | */
47 | function executeCommand( notification : INotification ) : void;
48 |
49 | /**
50 | * Remove a previously registered ICommand to INotification mapping.
51 | *
52 | * @param notificationName the name of the INotification to remove the ICommand mapping for
53 | */
54 | function removeCommand( notificationName : String ):void;
55 |
56 | /**
57 | * Check if a Command is registered for a given Notification
58 | *
59 | * @param notificationName
60 | * @return whether a Command is currently registered for the given notificationName.
61 | */
62 | function hasCommand( notificationName:String ) : Boolean;
63 |
64 | }
65 | }
--------------------------------------------------------------------------------
/asdoc/cookies.js:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // ADOBE SYSTEMS INCORPORATED
4 | // Copyright 2006-2007 Adobe Systems Incorporated
5 | // All Rights Reserved.
6 | //
7 | // NOTICE: Adobe permits you to use, modify, and distribute this file
8 | // in accordance with the terms of the license agreement accompanying it.
9 | //
10 | ////////////////////////////////////////////////////////////////////////////////
11 |
12 | /**
13 | * Read the JavaScript cookies tutorial at:
14 | * http://www.netspade.com/articles/javascript/cookies.xml
15 | */
16 |
17 | /**
18 | * Sets a Cookie with the given name and value.
19 | *
20 | * name Name of the cookie
21 | * value Value of the cookie
22 | * [expires] Expiration date of the cookie (default: end of current session)
23 | * [path] Path where the cookie is valid (default: path of calling document)
24 | * [domain] Domain where the cookie is valid
25 | * (default: domain of calling document)
26 | * [secure] Boolean value indicating if the cookie transmission requires a
27 | * secure transmission
28 | */
29 | function setCookie(name, value, expires, path, domain, secure)
30 | {
31 | document.cookie= name + "=" + escape(value) +
32 | ((expires) ? "; expires=" + expires.toGMTString() : "") +
33 | ((path) ? "; path=" + path : "") +
34 | ((domain) ? "; domain=" + domain : "") +
35 | ((secure) ? "; secure" : "");
36 | }
37 |
38 | /**
39 | * Gets the value of the specified cookie.
40 | *
41 | * name Name of the desired cookie.
42 | *
43 | * Returns a string containing value of specified cookie,
44 | * or null if cookie does not exist.
45 | */
46 | function getCookie(name)
47 | {
48 | var dc = document.cookie;
49 | var prefix = name + "=";
50 | var begin = dc.indexOf("; " + prefix);
51 | if (begin == -1)
52 | {
53 | begin = dc.indexOf(prefix);
54 | if (begin != 0) return null;
55 | }
56 | else
57 | {
58 | begin += 2;
59 | }
60 | var end = document.cookie.indexOf(";", begin);
61 | if (end == -1)
62 | {
63 | end = dc.length;
64 | }
65 | return unescape(dc.substring(begin + prefix.length, end));
66 | }
67 |
68 | /**
69 | * Deletes the specified cookie.
70 | *
71 | * name name of the cookie
72 | * [path] path of the cookie (must be same as path used to create cookie)
73 | * [domain] domain of the cookie (must be same as domain used to create cookie)
74 | */
75 | function deleteCookie(name, path, domain)
76 | {
77 | if (getCookie(name))
78 | {
79 | document.cookie = name + "=" +
80 | ((path) ? "; path=" + path : "") +
81 | ((domain) ? "; domain=" + domain : "") +
82 | "; expires=Thu, 01-Jan-70 00:00:01 GMT";
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/asdoc/print.css:
--------------------------------------------------------------------------------
1 | /*
2 | ////////////////////////////////////////////////////////////////////////////////
3 | //
4 | // ADOBE SYSTEMS INCORPORATED
5 | // Copyright 2005-2007 Adobe Systems Incorporated
6 | // All Rights Reserved.
7 | //
8 | // NOTICE: Adobe permits you to use, modify, and distribute this file
9 | // in accordance with the terms of the license agreement accompanying it.
10 | //
11 | ////////////////////////////////////////////////////////////////////////////////
12 | */
13 |
14 | body {
15 | color: #000000;
16 | background: #ffffff;
17 | font-family: "Times New Roman", Times, serif;
18 | font-size: 12pt;
19 | }
20 | a {
21 | text-decoration: none;
22 | color: #000000;
23 | }
24 | pre {
25 | white-space: -moz-pre-wrap; /* Mozilla */
26 | white-space: -pre-wrap; /* Opera 4-6 */
27 | white-space: -o-pre-wrap; /* Opera 7 */
28 | word-wrap: break-word; /* IE */
29 | }
30 | .titleTableTopNav, .titleTableSubNav, .logoImage {
31 | display: none;
32 | }
33 | .packageFrame {
34 | display: none;
35 | }
36 | .titleTableSubTitle {
37 | font-weight: bold;
38 | }
39 | .classHeaderTableLabel {
40 | padding-right: 10px;
41 | vertical-align: top;
42 | }
43 | .showHideLinks {
44 | display: none;
45 | }
46 | html>body code {
47 | font-size: 10pt;
48 | }
49 | .summaryTableTitle, .detailSectionHeader {
50 | font-size: 14pt;
51 | font-weight: bold;
52 | padding-top: 15px;
53 | padding-bottom: 5px;
54 | }
55 | .summaryTable {
56 | border: 1px solid #000000;
57 | border-collapse: collapse;
58 | width: 100%;
59 | }
60 | .summaryTableDescription {
61 | padding-bottom: 20px;
62 | }
63 | .summaryTableSignatureCol, .summaryTableOwnerCol, .summaryTableLastCol, .summaryTableCol {
64 | border: 1px solid #000000;
65 | }
66 | .summaryTablePaddingCol {
67 | border: 1px solid #000000;
68 | border-right: 0px;
69 | }
70 | .summaryTableInheritanceCol, .summaryTableOperatorCol, .summaryTableStatementCol, .summaryTableSecondCol {
71 | border: 1px solid #000000;
72 | border-left: 0px;
73 | }
74 | .summaryTableLastCol {
75 | vertical-align: top;
76 | }
77 | .detailHeader {
78 | font-size: 13pt;
79 | padding-top: 100px;
80 | }
81 | .detailHeaderName {
82 | font-weight: bold;
83 | }
84 | .detailHeaderType {
85 | padding-left: 5px;
86 | }
87 | .detailHeaderRule {
88 | background: #FF0000;
89 | }
90 | .seeAlso {
91 | padding-bottom: 20px;
92 | margin-top: -20px;
93 | }
94 | .innertable {
95 | border-collapse: collapse;
96 | }
97 | .innertable td,.innertable th {
98 | border: 1px solid #000000;
99 | padding-left: 5px;
100 | padding-right: 5px;
101 | }
102 | .listing {
103 | font-size: 10pt;
104 | }
105 | .feedbackLink {
106 | display: none;
107 | }
108 | .copyright {
109 | font-size: 10pt;
110 | }
--------------------------------------------------------------------------------
/src/org/puremvc/as3/multicore/interfaces/INotification.as:
--------------------------------------------------------------------------------
1 | /*
2 | PureMVC MultiCore - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved.
3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License
4 | */
5 | package org.puremvc.as3.multicore.interfaces
6 | {
7 | /**
8 | * The interface definition for a PureMVC Notification.
9 | *
10 | * 11 | * PureMVC does not rely upon underlying event models such 12 | * as the one provided with Flash, and ActionScript 3 does 13 | * not have an inherent event model.
14 | * 15 | *16 | * The Observer Pattern as implemented within PureMVC exists 17 | * to support event-driven communication between the 18 | * application and the actors of the MVC triad.
19 | * 20 | *
21 | * Notifications are not meant to be a replacement for Events
22 | * in Flex/Flash/AIR. Generally, IMediator implementors
23 | * place event listeners on their view components, which they
24 | * then handle in the usual way. This may lead to the broadcast of Notifications to
25 | * trigger ICommands or to communicate with other IMediators. IProxy and ICommand
26 | * instances communicate with each other and IMediators
27 | * by broadcasting INotifications.
30 | * A key difference between Flash Events and PureMVC
31 | * Notifications is that Events follow the
32 | * 'Chain of Responsibility' pattern, 'bubbling' up the display hierarchy
33 | * until some parent component handles the Event, while
34 | * PureMVC Notifications follow a 'Publish/Subscribe'
35 | * pattern. PureMVC classes need not be related to each other in a
36 | * parent/child relationship in order to communicate with one another
37 | * using Notifications.
38 | *
39 | * @see org.puremvc.as3.multicore.interfaces.IView IView
40 | * @see org.puremvc.as3.multicore.interfaces.IObserver IObserver
41 | */
42 | public interface INotification
43 | {
44 |
45 | /**
46 | * Get the name of the INotification instance.
47 | * No setter, should be set by constructor only
48 | */
49 | function getName():String;
50 |
51 | /**
52 | * Set the body of the INotification instance
53 | */
54 | function setBody( body:Object ):void;
55 |
56 | /**
57 | * Get the body of the INotification instance
58 | */
59 | function getBody():Object;
60 |
61 | /**
62 | * Set the type of the INotification instance
63 | */
64 | function setType( type:String ):void;
65 |
66 | /**
67 | * Get the type of the INotification instance
68 | */
69 | function getType():String;
70 |
71 | /**
72 | * Get the string representation of the INotification instance
73 | */
74 | function toString():String;
75 | }
76 | }
--------------------------------------------------------------------------------
/asdoc/all-classes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
| Controller | 17 |
| Facade | 20 |
| ICommand | 23 |
| IController | 26 |
| IFacade | 29 |
| IMediator | 32 |
| IModel | 35 |
| INotification | 38 |
| INotifier | 41 |
| IObserver | 44 |
| IProxy | 47 |
| IView | 50 |
| MacroCommand | 53 |
| Mediator | 56 |
| Model | 59 |
| Notification | 62 |
| Notifier | 65 |
| Observer | 68 |
| Proxy | 71 |
| SimpleCommand | 74 |
| View | 77 |
12 | * In PureMVC, IObserver implementors assume these responsibilities:
13 | *
21 | * PureMVC does not rely upon underlying event 22 | * models such as the one provided with Flash, 23 | * and ActionScript 3 does not have an inherent 24 | * event model.
25 | * 26 | *27 | * The Observer Pattern as implemented within 28 | * PureMVC exists to support event driven communication 29 | * between the application and the actors of the 30 | * MVC triad.
31 | * 32 | *33 | * An Observer is an object that encapsulates information 34 | * about an interested object with a notification method that 35 | * should be called when an INotification is broadcast. The Observer then 36 | * acts as a proxy for notifying the interested object. 37 | * 38 | *
39 | * Observers can receive Notifications by having their
40 | * notifyObserver method invoked, passing
41 | * in an object implementing the INotification interface, such
42 | * as a subclass of Notification.
53 | * The notification method should take one parameter of type INotification
INotification to pass to the interested object's notification method
70 | */
71 | function notifyObserver( notification:INotification ):void;
72 |
73 | /**
74 | * Compare the given object to the notificaiton context object.
75 | *
76 | * @param object the object to compare.
77 | * @return boolean indicating if the notification context and the object are the same.
78 | */
79 | function compareNotifyContext( object:Object ):Boolean;
80 | }
81 | }
--------------------------------------------------------------------------------
/asdoc/org/puremvc/as3/multicore/patterns/proxy/package-detail.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | | Class | Description | 40 ||
|---|---|---|
| Proxy |
43 | A base IProxy implementation. |
44 |
| Class | Description | 40 ||
|---|---|---|
| Facade |
43 | A base Multiton IFacade implementation. |
44 |
| Class | Description | 40 ||
|---|---|---|
| Mediator |
43 | A base IMediator implementation. |
44 |
IMediator implementation.
12 | *
13 | * @see org.puremvc.as3.multicore.core.View View
14 | */
15 | public class Mediator extends Notifier implements IMediator, INotifier
16 | {
17 |
18 | /**
19 | * The name of the Mediator.
20 | *
21 | *
22 | * Typically, a Mediator will be written to serve
23 | * one specific control or group controls and so,
24 | * will not have a need to be dynamically named.
Mediator.
38 | * @return the Mediator name
39 | */
40 | public function getMediatorName():String
41 | {
42 | return mediatorName;
43 | }
44 |
45 | /**
46 | * Set the IMediator's view component.
47 | *
48 | * @param Object the view component
49 | */
50 | public function setViewComponent( viewComponent:Object ):void
51 | {
52 | this.viewComponent = viewComponent;
53 | }
54 |
55 | /**
56 | * Get the Mediator's view component.
57 | *
58 | * 59 | * Additionally, an implicit getter will usually 60 | * be defined in the subclass that casts the view 61 | * object to a type, like this:
62 | * 63 | *INotification names this
79 | * Mediator is interested in being notified of.
80 | *
81 | * @return Array the list of INotification names
82 | */
83 | public function listNotificationInterests():Array
84 | {
85 | return [ ];
86 | }
87 |
88 | /**
89 | * Handle INotifications.
90 | *
91 | *
92 | * Typically this will be handled in a switch statement,
93 | * with one 'case' entry per INotification
94 | * the Mediator is interested in.
95 | */
96 | public function handleNotification( notification:INotification ):void {}
97 |
98 | /**
99 | * Called by the View when the Mediator is registered
100 | */
101 | public function onRegister( ):void {}
102 |
103 | /**
104 | * Called by the View when the Mediator is removed
105 | */
106 | public function onRemove( ):void {}
107 |
108 | // the mediator name
109 | protected var mediatorName:String;
110 |
111 | // The view component
112 | protected var viewComponent:Object;
113 | }
114 | }
--------------------------------------------------------------------------------
/asdoc/org/puremvc/as3/multicore/patterns/command/package-detail.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
| Class | Description | 40 ||
|---|---|---|
| MacroCommand |
43 | A base ICommand implementation that executes other ICommands. |
44 | |
| SimpleCommand |
47 | A base ICommand implementation. |
48 |
| Class | Description | 40 ||
|---|---|---|
| Controller |
43 | A Multiton IController implementation. |
44 | |
| Model |
47 | A Multiton IModel implementation. |
48 | |
| View |
51 | A Multiton IView implementation. |
52 |
IObserver implementation.
11 | *
12 | *
13 | * An Observer is an object that encapsulates information
14 | * about an interested object with a method that should
15 | * be called when a particular INotification is broadcast.
18 | * In PureMVC, the Observer class assumes these responsibilities:
19 | *
38 | * The notification method on the interested object should take
39 | * one parameter of type INotification
54 | * The notification method should take one parameter of type INotification.
this) of the interested object.
87 | */
88 | private function getNotifyContext():Object
89 | {
90 | return context;
91 | }
92 |
93 | /**
94 | * Notify the interested object.
95 | *
96 | * @param notification the INotification to pass to the interested object's notification method.
97 | */
98 | public function notifyObserver( notification:INotification ):void
99 | {
100 | this.getNotifyMethod().apply(this.getNotifyContext(),[notification]);
101 | }
102 |
103 | /**
104 | * Compare an object to the notification context.
105 | *
106 | * @param object the object to compare
107 | * @return boolean indicating if the object and the notification context are the same
108 | */
109 | public function compareNotifyContext( object:Object ):Boolean
110 | {
111 | return object === this.context;
112 | }
113 | }
114 | }
--------------------------------------------------------------------------------
/asdoc/org/puremvc/as3/multicore/patterns/observer/package-detail.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | | Class | Description | 40 ||
|---|---|---|
| Notification |
43 | A base INotification implementation. |
44 | |
| Notifier |
47 | A Base INotifier implementation. |
48 | |
| Observer |
51 | A base IObserver implementation. |
52 |
INotifier implementation.
12 | *
13 | *
14 | * MacroCommand, Command, Mediator and Proxy
15 | * all have a need to send Notifications.
16 | *
17 | * The INotifier interface provides a common method called
18 | * sendNotification that relieves implementation code of
19 | * the necessity to actually construct Notifications.
22 | * The Notifier class, which all of the above mentioned classes
23 | * extend, provides an initialized reference to the Facade
24 | * Multiton, which is required for the convienience method
25 | * for sending Notifications, but also eases implementation as these
26 | * classes have frequent Facade interactions and usually require
27 | * access to the facade anyway.
30 | * NOTE: In the MultiCore version of the framework, there is one caveat to
31 | * notifiers, they cannot send notifications or reach the facade until they
32 | * have a valid multitonKey.
33 | *
34 | * The multitonKey is set:
35 | * * on a Command when it is executed by the Controller
36 | * * on a Mediator is registered with the View
37 | * * on a Proxy is registered with the Model.
38 | *
39 | * @see org.puremvc.as3.multicore.patterns.proxy.Proxy Proxy
40 | * @see org.puremvc.as3.multicore.patterns.facade.Facade Facade
41 | * @see org.puremvc.as3.multicore.patterns.mediator.Mediator Mediator
42 | * @see org.puremvc.as3.multicore.patterns.command.MacroCommand MacroCommand
43 | * @see org.puremvc.as3.multicore.patterns.command.SimpleCommand SimpleCommand
44 | */
45 | public class Notifier implements INotifier
46 | {
47 | /**
48 | * Create and send an INotification.
49 | *
50 | *
51 | * Keeps us from having to construct new INotification 52 | * instances in our implementation code. 53 | * @param notificationName the name of the notiification to send 54 | * @param body the body of the notification (optional) 55 | * @param type the type of the notification (optional) 56 | */ 57 | public function sendNotification( notificationName:String, body:Object=null, type:String=null ):void 58 | { 59 | if (facade != null) 60 | facade.sendNotification( notificationName, body, type ); 61 | } 62 | 63 | /** 64 | * Initialize this INotifier instance. 65 | *
66 | * This is how a Notifier gets its multitonKey. 67 | * Calls to sendNotification or to access the 68 | * facade will fail until after this method 69 | * has been called.
70 | * 71 | *72 | * Mediators, Commands or Proxies may override 73 | * this method in order to send notifications 74 | * or access the Multiton Facade instance as 75 | * soon as possible. They CANNOT access the facade 76 | * in their constructors, since this method will not 77 | * yet have been called.
78 | * 79 | * @param key the multitonKey for this INotifier to use 80 | */ 81 | public function initializeNotifier( key:String ):void 82 | { 83 | multitonKey = key; 84 | } 85 | 86 | // Return the Multiton Facade instance 87 | protected function get facade():IFacade 88 | { 89 | if ( multitonKey == null ) throw Error( MULTITON_MSG ); 90 | return Facade.getInstance( multitonKey ); 91 | } 92 | 93 | // The Multiton Key for this app 94 | protected var multitonKey : String; 95 | 96 | // Message Constants 97 | protected const MULTITON_MSG : String = "multitonKey for this Notifier not yet initialized!"; 98 | 99 | } 100 | } -------------------------------------------------------------------------------- /asdoc/title-bar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 || PureMVC AS3 Framework - [MultiCore Version] | 25 |26 | All Packages | All Classes | Index | No Frames 27 | | 28 | 29 |30 | 31 | | 32 | 33 |
| 38 | | 39 | 40 | | 41 | 42 ||
| 47 | 48 | | ||
ICommand implementation that executes other ICommands.
13 | *
14 | *
15 | * A MacroCommand maintains an list of
16 | * ICommand Class references called SubCommands.
19 | * When execute is called, the MacroCommand
20 | * instantiates and calls execute on each of its SubCommands turn.
21 | * Each SubCommand will be passed a reference to the original
22 | * INotification that was passed to the MacroCommand's
23 | * execute method.
26 | * Unlike SimpleCommand, your subclass
27 | * should not override execute, but instead, should
28 | * override the initializeMacroCommand method,
29 | * calling addSubCommand once for each SubCommand
30 | * to be executed.
33 | * 34 | * @see org.puremvc.as3.multicore.core.Controller Controller 35 | * @see org.puremvc.as3.multicore.patterns.observer.Notification Notification 36 | * @see org.puremvc.as3.multicore.patterns.command.SimpleCommand SimpleCommand 37 | */ 38 | public class MacroCommand extends Notifier implements ICommand, INotifier 39 | { 40 | 41 | private var subCommands:Array; 42 | 43 | /** 44 | * Constructor. 45 | * 46 | *
47 | * You should not need to define a constructor,
48 | * instead, override the initializeMacroCommand
49 | * method.
52 | * If your subclass does define a constructor, be
53 | * sure to call super().
MacroCommand.
63 | *
64 | *
65 | * In your subclass, override this method to
66 | * initialize the MacroCommand's SubCommand
67 | * list with ICommand class references like
68 | * this:
81 | * Note that SubCommands may be any ICommand implementor,
82 | * MacroCommands or SimpleCommands are both acceptable.
83 | */
84 | protected function initializeMacroCommand():void
85 | {
86 | }
87 |
88 | /**
89 | * Add a SubCommand.
90 | *
91 | *
92 | * The SubCommands will be called in First In/First Out (FIFO) 93 | * order.
94 | * 95 | * @param commandClassRef a reference to theClass of the ICommand.
96 | */
97 | protected function addSubCommand( commandClassRef:Class ): void
98 | {
99 | subCommands.push(commandClassRef);
100 | }
101 |
102 | /**
103 | * Execute this MacroCommand's SubCommands.
104 | *
105 | *
106 | * The SubCommands will be called in First In/First Out (FIFO)
107 | * order.
108 | *
109 | * @param notification the INotification object to be passsed to each SubCommand.
110 | */
111 | public final function execute( notification:INotification ) : void
112 | {
113 | while ( subCommands.length > 0) {
114 | var commandClassRef : Class = subCommands.shift();
115 | var commandInstance : ICommand = new commandClassRef();
116 | commandInstance.initializeNotifier( multitonKey );
117 | commandInstance.execute( notification );
118 | }
119 | }
120 |
121 | }
122 | }
--------------------------------------------------------------------------------
/src/org/puremvc/as3/multicore/patterns/observer/Notification.as:
--------------------------------------------------------------------------------
1 | /*
2 | PureMVC MultiCore - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved.
3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License
4 | */
5 | package org.puremvc.as3.multicore.patterns.observer
6 | {
7 | import org.puremvc.as3.multicore.interfaces.*;
8 |
9 | /**
10 | * A base INotification implementation.
11 | *
12 | *
13 | * PureMVC does not rely upon underlying event models such 14 | * as the one provided with Flash, and ActionScript 3 does 15 | * not have an inherent event model.
16 | * 17 | *18 | * The Observer Pattern as implemented within PureMVC exists 19 | * to support event-driven communication between the 20 | * application and the actors of the MVC triad.
21 | * 22 | *
23 | * Notifications are not meant to be a replacement for Events
24 | * in Flex/Flash/Apollo. Generally, IMediator implementors
25 | * place event listeners on their view components, which they
26 | * then handle in the usual way. This may lead to the broadcast of Notifications to
27 | * trigger ICommands or to communicate with other IMediators. IProxy and ICommand
28 | * instances communicate with each other and IMediators
29 | * by broadcasting INotifications.
32 | * A key difference between Flash Events and PureMVC
33 | * Notifications is that Events follow the
34 | * 'Chain of Responsibility' pattern, 'bubbling' up the display hierarchy
35 | * until some parent component handles the Event, while
36 | * PureMVC Notifications follow a 'Publish/Subscribe'
37 | * pattern. PureMVC classes need not be related to each other in a
38 | * parent/child relationship in order to communicate with one another
39 | * using Notifications.
40 | *
41 | * @see org.puremvc.as3.multicore.patterns.observer.Observer Observer
42 | *
43 | */
44 | public class Notification implements INotification
45 | {
46 |
47 | /**
48 | * Constructor.
49 | *
50 | * @param name name of the Notification instance. (required)
51 | * @param body the Notification body. (optional)
52 | * @param type the type of the Notification (optional)
53 | */
54 | public function Notification( name:String, body:Object=null, type:String=null )
55 | {
56 | this.name = name;
57 | this.body = body;
58 | this.type = type;
59 | }
60 |
61 | /**
62 | * Get the name of the Notification instance.
63 | *
64 | * @return the name of the Notification instance.
65 | */
66 | public function getName():String
67 | {
68 | return name;
69 | }
70 |
71 | /**
72 | * Set the body of the Notification instance.
73 | */
74 | public function setBody( body:Object ):void
75 | {
76 | this.body = body;
77 | }
78 |
79 | /**
80 | * Get the body of the Notification instance.
81 | *
82 | * @return the body object.
83 | */
84 | public function getBody():Object
85 | {
86 | return body;
87 | }
88 |
89 | /**
90 | * Set the type of the Notification instance.
91 | */
92 | public function setType( type:String ):void
93 | {
94 | this.type = type;
95 | }
96 |
97 | /**
98 | * Get the type of the Notification instance.
99 | *
100 | * @return the type
101 | */
102 | public function getType():String
103 | {
104 | return type;
105 | }
106 |
107 | /**
108 | * Get the string representation of the Notification instance.
109 | *
110 | * @return the string representation of the Notification instance.
111 | */
112 | public function toString():String
113 | {
114 | var msg:String = "Notification Name: "+getName();
115 | msg += "\nBody:"+(( body == null )?"null":body.toString());
116 | msg += "\nType:"+(( type == null )?"null":type);
117 | return msg;
118 | }
119 |
120 | // the name of the notification instance
121 | private var name : String;
122 | // the type of the notification instance
123 | private var type : String;
124 | // the body of the notification instance
125 | private var body : Object;
126 |
127 | }
128 | }
--------------------------------------------------------------------------------
/src/org/puremvc/as3/multicore/interfaces/IView.as:
--------------------------------------------------------------------------------
1 | /*
2 | PureMVC MultiCore - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved.
3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License
4 | */
5 | package org.puremvc.as3.multicore.interfaces
6 | {
7 |
8 | /**
9 | * The interface definition for a PureMVC View.
10 | *
11 | *
12 | * In PureMVC, IView implementors assume these responsibilities:
15 | * In PureMVC, the View class assumes these responsibilities:
16 | *
IMediator instances.IMediators.INotification in the application.IObservers to an INotification's observer list.INotification.IObservers of a given INotification when it broadcast.IObserver to be notified
34 | * of INotifications with a given name.
35 | *
36 | * @param notificationName the name of the INotifications to notify this IObserver of
37 | * @param observer the IObserver to register
38 | */
39 | function registerObserver( notificationName:String, observer:IObserver ) : void;
40 |
41 | /**
42 | * Remove a group of observers from the observer list for a given Notification name.
43 | *
44 | * @param notificationName which observer list to remove from
45 | * @param notifyContext removed the observers with this object as their notifyContext
46 | */
47 | function removeObserver( notificationName:String, notifyContext:Object ):void;
48 |
49 | /**
50 | * Notify the IObservers for a particular INotification.
51 | *
52 | *
53 | * All previously attached IObservers for this INotification's
54 | * list are notified and are passed a reference to the INotification in
55 | * the order in which they were registered.
INotification to notify IObservers of.
58 | */
59 | function notifyObservers( note:INotification ) : void;
60 |
61 | /**
62 | * Register an IMediator instance with the View.
63 | *
64 | *
65 | * Registers the IMediator so that it can be retrieved by name,
66 | * and further interrogates the IMediator for its
67 | * INotification interests.
69 | * If the IMediator returns any INotification
70 | * names to be notified about, an Observer is created encapsulating
71 | * the IMediator instance's handleNotification method
72 | * and registering it as an Observer for all INotifications the
73 | * IMediator is interested in.
IMediator instance
76 | * @param mediator a reference to the IMediator instance
77 | */
78 | function registerMediator( mediator:IMediator ) : void;
79 |
80 | /**
81 | * Retrieve an IMediator from the View.
82 | *
83 | * @param mediatorName the name of the IMediator instance to retrieve.
84 | * @return the IMediator instance previously registered with the given mediatorName.
85 | */
86 | function retrieveMediator( mediatorName:String ) : IMediator;
87 |
88 | /**
89 | * Remove an IMediator from the View.
90 | *
91 | * @param mediatorName name of the IMediator instance to be removed.
92 | * @return the IMediator that was removed from the View
93 | */
94 | function removeMediator( mediatorName:String ) : IMediator;
95 |
96 | /**
97 | * Check if a Mediator is registered or not
98 | *
99 | * @param mediatorName
100 | * @return whether a Mediator is registered with the given mediatorName.
101 | */
102 | function hasMediator( mediatorName:String ) : Boolean;
103 |
104 | }
105 |
106 | }
--------------------------------------------------------------------------------
/asdoc/package-summary.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | | Package | Description | 37 ||
|---|---|---|
| org.puremvc.as3.multicore.core | 40 | | |
| org.puremvc.as3.multicore.interfaces | 43 | | |
| org.puremvc.as3.multicore.patterns.command | 46 | | |
| org.puremvc.as3.multicore.patterns.facade | 49 | | |
| org.puremvc.as3.multicore.patterns.mediator | 52 | | |
| org.puremvc.as3.multicore.patterns.observer | 55 | | |
| org.puremvc.as3.multicore.patterns.proxy | 58 | |
IModel implementation.
12 | *
13 | *
14 | * In PureMVC, the Model class provides
15 | * access to model objects (Proxies) by named lookup.
16 | *
17 | *
18 | * The Model assumes these responsibilities:
IProxy instances.IProxy instances.
27 | * Your application must register IProxy instances
28 | * with the Model. Typically, you use an
29 | * ICommand to create and register IProxy
30 | * instances once the Facade has initialized the Core
31 | * actors.
42 | * This IModel implementation is a Multiton,
43 | * so you should not call the constructor
44 | * directly, but instead call the static Multiton
45 | * Factory method Model.getInstance( multitonKey )
46 | *
47 | * @throws Error Error if instance for this Multiton key instance has already been constructed
48 | *
49 | */
50 | public function Model( key:String )
51 | {
52 | if (instanceMap[ key ] != null) throw Error(MULTITON_MSG);
53 | multitonKey = key;
54 | instanceMap[ multitonKey ] = this;
55 | proxyMap = new Array();
56 | initializeModel();
57 | }
58 |
59 | /**
60 | * Initialize the Model instance.
61 | *
62 | *
63 | * Called automatically by the constructor, this 64 | * is your opportunity to initialize the Singleton 65 | * instance in your subclass without overriding the 66 | * constructor.
67 | * 68 | * @return void 69 | */ 70 | protected function initializeModel( ) : void 71 | { 72 | } 73 | 74 | /** 75 | *Model Multiton Factory method.
76 | *
77 | * @return the instance for this Multiton key
78 | */
79 | public static function getInstance( key:String ) : IModel
80 | {
81 | if (instanceMap[ key ] == null) instanceMap[key] = new Model( key );
82 | return instanceMap[key];
83 | }
84 |
85 | /**
86 | * Register an IProxy with the Model.
87 | *
88 | * @param proxy an IProxy to be held by the Model.
89 | */
90 | public function registerProxy( proxy:IProxy ) : void
91 | {
92 | proxy.initializeNotifier( multitonKey );
93 | proxyMap[ proxy.getProxyName() ] = proxy;
94 | proxy.onRegister();
95 | }
96 |
97 | /**
98 | * Retrieve an IProxy from the Model.
99 | *
100 | * @param proxyName
101 | * @return the IProxy instance previously registered with the given proxyName.
102 | */
103 | public function retrieveProxy( proxyName:String ) : IProxy
104 | {
105 | return proxyMap[ proxyName ];
106 | }
107 |
108 | /**
109 | * Check if a Proxy is registered
110 | *
111 | * @param proxyName
112 | * @return whether a Proxy is currently registered with the given proxyName.
113 | */
114 | public function hasProxy( proxyName:String ) : Boolean
115 | {
116 | return proxyMap[ proxyName ] != null;
117 | }
118 |
119 | /**
120 | * Remove an IProxy from the Model.
121 | *
122 | * @param proxyName name of the IProxy instance to be removed.
123 | * @return the IProxy that was removed from the Model
124 | */
125 | public function removeProxy( proxyName:String ) : IProxy
126 | {
127 | var proxy:IProxy = proxyMap [ proxyName ] as IProxy;
128 | if ( proxy )
129 | {
130 | proxyMap[ proxyName ] = null;
131 | proxy.onRemove();
132 | }
133 | return proxy;
134 | }
135 |
136 | /**
137 | * Remove an IModel instance
138 | *
139 | * @param multitonKey of IModel instance to remove
140 | */
141 | public static function removeModel( key:String ):void
142 | {
143 | delete instanceMap[ key ];
144 | }
145 |
146 | // Mapping of proxyNames to IProxy instances
147 | protected var proxyMap : Array;
148 |
149 | // Singleton instance
150 | protected static var instanceMap:Array = new Array();
151 |
152 | // The Multiton Key for this Core
153 | protected var multitonKey : String;
154 |
155 | // Message Constants
156 | protected const MULTITON_MSG:String = "Model instance for this Multiton key already constructed!";
157 |
158 | }
159 |
160 | }
161 |
--------------------------------------------------------------------------------
/src/org/puremvc/as3/multicore/interfaces/IFacade.as:
--------------------------------------------------------------------------------
1 | /*
2 | PureMVC MultiCore - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved.
3 | Your reuse is governed by the Creative Commons Attribution 3.0 United States License
4 | */
5 | package org.puremvc.as3.multicore.interfaces
6 | {
7 |
8 | /**
9 | * The interface definition for a PureMVC Facade.
10 | *
11 | * 12 | * The Facade Pattern suggests providing a single 13 | * class to act as a central point of communication 14 | * for a subsystem.
15 | * 16 | *17 | * In PureMVC, the Facade acts as an interface between 18 | * the core MVC actors (Model, View, Controller) and 19 | * the rest of your application.
20 | * 21 | * @see org.puremvc.as3.multicore.interfaces.IModel IModel 22 | * @see org.puremvc.as3.multicore.interfaces.IView IView 23 | * @see org.puremvc.as3.multicore.interfaces.IController IController 24 | * @see org.puremvc.as3.multicore.interfaces.ICommand ICommand 25 | * @see org.puremvc.as3.multicore.interfaces.INotification INotification 26 | */ 27 | public interface IFacade extends INotifier 28 | { 29 | 30 | /** 31 | * Register anIProxy with the Model by name.
32 | *
33 | * @param proxy the IProxy to be registered with the Model.
34 | */
35 | function registerProxy( proxy:IProxy ) : void;
36 |
37 | /**
38 | * Retrieve a IProxy from the Model by name.
39 | *
40 | * @param proxyName the name of the IProxy instance to be retrieved.
41 | * @return the IProxy previously regisetered by proxyName with the Model.
42 | */
43 | function retrieveProxy( proxyName:String ) : IProxy;
44 |
45 | /**
46 | * Remove an IProxy instance from the Model by name.
47 | *
48 | * @param proxyName the IProxy to remove from the Model.
49 | * @return the IProxy that was removed from the Model
50 | */
51 | function removeProxy( proxyName:String ) : IProxy;
52 |
53 | /**
54 | * Check if a Proxy is registered
55 | *
56 | * @param proxyName
57 | * @return whether a Proxy is currently registered with the given proxyName.
58 | */
59 | function hasProxy( proxyName:String ) : Boolean;
60 |
61 | /**
62 | * Register an ICommand with the Controller.
63 | *
64 | * @param noteName the name of the INotification to associate the ICommand with.
65 | * @param commandClassRef a reference to the Class of the ICommand.
66 | */
67 | function registerCommand( noteName : String, commandClassRef : Class ) : void;
68 |
69 | /**
70 | * Remove a previously registered ICommand to INotification mapping from the Controller.
71 | *
72 | * @param notificationName the name of the INotification to remove the ICommand mapping for
73 | */
74 | function removeCommand( notificationName:String ): void;
75 |
76 | /**
77 | * Check if a Command is registered for a given Notification
78 | *
79 | * @param notificationName
80 | * @return whether a Command is currently registered for the given notificationName.
81 | */
82 | function hasCommand( notificationName:String ) : Boolean;
83 |
84 | /**
85 | * Register an IMediator instance with the View.
86 | *
87 | * @param mediator a reference to the IMediator instance
88 | */
89 | function registerMediator( mediator:IMediator ) : void;
90 |
91 | /**
92 | * Retrieve an IMediator instance from the View.
93 | *
94 | * @param mediatorName the name of the IMediator instance to retrievve
95 | * @return the IMediator previously registered with the given mediatorName.
96 | */
97 | function retrieveMediator( mediatorName:String ) : IMediator;
98 |
99 | /**
100 | * Remove a IMediator instance from the View.
101 | *
102 | * @param mediatorName name of the IMediator instance to be removed.
103 | * @return the IMediator instance previously registered with the given mediatorName.
104 | */
105 | function removeMediator( mediatorName:String ) : IMediator;
106 |
107 | /**
108 | * Check if a Mediator is registered or not
109 | *
110 | * @param mediatorName
111 | * @return whether a Mediator is registered with the given mediatorName.
112 | */
113 | function hasMediator( mediatorName:String ) : Boolean;
114 |
115 | /**
116 | * Notify Observers.
117 | * 118 | * This method is left public mostly for backward 119 | * compatibility, and to allow you to send custom 120 | * notification classes using the facade.
121 | *122 | * Usually you should just call sendNotification 123 | * and pass the parameters, never having to 124 | * construct the notification yourself.
125 | * 126 | * @param notification theINotification to have the View notify Observers of.
127 | */
128 | function notifyObservers( notification:INotification ):void;
129 |
130 | }
131 | }
--------------------------------------------------------------------------------
/asdoc/org/puremvc/as3/multicore/interfaces/package-detail.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | | Interface | Description | 40 ||
|---|---|---|
| ICommand | 43 | The interface definition for a PureMVC Command. | 44 ||
| IController | 47 | The interface definition for a PureMVC Controller. | 48 ||
| IFacade | 51 | The interface definition for a PureMVC Facade. | 52 ||
| IMediator | 55 | The interface definition for a PureMVC Mediator. | 56 ||
| IModel | 59 | The interface definition for a PureMVC Model. | 60 ||
| INotification | 63 | The interface definition for a PureMVC Notification. | 64 ||
| INotifier | 67 | The interface definition for a PureMVC Notifier. | 68 ||
| IObserver | 71 | The interface definition for a PureMVC Observer. | 72 ||
| IProxy | 75 | The interface definition for a PureMVC Proxy. | 76 ||
| IView | 79 | The interface definition for a PureMVC View. | 80 |
12 | * In PureMVC, IMediator implementors assume these responsibilities:
INotifications
15 | * the IMediator has interest in.
20 | * Additionally, IMediators typically:
21 | *
INotifications, interacting with of
27 | * the rest of the PureMVC app.
28 | *
30 | * When an IMediator is registered with the IView,
31 | * the IView will call the IMediator's
32 | * listNotificationInterests method. The IMediator will
33 | * return an Array of INotification names which
34 | * it wishes to be notified about.
37 | * The IView will then create an Observer object
38 | * encapsulating that IMediator's (handleNotification) method
39 | * and register it as an Observer for each INotification name returned by
40 | * listNotificationInterests.
43 | * A concrete IMediator implementor usually looks something like this:
44 | * 45 | *IMediator instance name
106 | *
107 | * @return the IMediator instance name
108 | */
109 | function getMediatorName():String;
110 |
111 | /**
112 | * Get the IMediator's view component.
113 | *
114 | * @return Object the view component
115 | */
116 | function getViewComponent():Object;
117 |
118 | /**
119 | * Set the IMediator's view component.
120 | *
121 | * @param Object the view component
122 | */
123 | function setViewComponent( viewComponent:Object ):void;
124 |
125 | /**
126 | * List INotification interests.
127 | *
128 | * @return an Array of the INotification names this IMediator has an interest in.
129 | */
130 | function listNotificationInterests( ):Array;
131 |
132 | /**
133 | * Handle an INotification.
134 | *
135 | * @param notification the INotification to be handled
136 | */
137 | function handleNotification( notification:INotification ):void;
138 |
139 | /**
140 | * Called by the View when the Mediator is registered
141 | */
142 | function onRegister( ):void;
143 |
144 | /**
145 | * Called by the View when the Mediator is removed
146 | */
147 | function onRemove( ):void;
148 |
149 | }
150 | }
--------------------------------------------------------------------------------
/asdoc/all-index-B.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 36 ||
| 39 | | |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 42 |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 36 ||
| 39 | | |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 42 |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 36 ||
| 39 | | |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 42 |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 36 ||
| 39 | | |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 42 |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 36 ||
| 39 | | |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 42 |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 36 ||
| 39 | | |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 42 |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 36 ||
| 39 | | |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 42 |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 36 ||
| 39 | | |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 42 |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 36 ||
| 39 | | |
| A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | 42 |
IController implementation.
12 | *
13 | *
14 | * In PureMVC, the Controller class follows the
15 | * 'Command and Controller' strategy, and assumes these
16 | * responsibilities:
17 | *
ICommands
19 | * are intended to handle which INotifications.IObserver with
21 | * the View for each INotification
22 | * that it has an ICommand mapping for.ICommand
24 | * to handle a given INotification when notified by the View.ICommand's execute
26 | * method, passing in the INotification.
30 | * Your application must register ICommands with the
31 | * Controller.
32 | *
33 | * The simplest way is to subclass Facade,
34 | * and use its initializeController method to add your
35 | * registrations.
36 | *
37 | * @see org.puremvc.as3.multicore.core.View View
38 | * @see org.puremvc.as3.multicore.patterns.observer.Observer Observer
39 | * @see org.puremvc.as3.multicore.patterns.observer.Notification Notification
40 | * @see org.puremvc.as3.multicore.patterns.command.SimpleCommand SimpleCommand
41 | * @see org.puremvc.as3.multicore.patterns.command.MacroCommand MacroCommand
42 | */
43 | public class Controller implements IController
44 | {
45 |
46 | /**
47 | * Constructor.
48 | *
49 | *
50 | * This IController implementation is a Multiton,
51 | * so you should not call the constructor
52 | * directly, but instead call the static Factory method,
53 | * passing the unique key for this instance
54 | * Controller.getInstance( multitonKey )
55 | *
56 | * @throws Error Error if instance for this Multiton key has already been constructed
57 | *
58 | */
59 | public function Controller( key:String )
60 | {
61 | if (instanceMap[ key ] != null) throw Error(MULTITON_MSG);
62 | multitonKey = key;
63 | instanceMap[ multitonKey ] = this;
64 | commandMap = new Array();
65 | initializeController();
66 | }
67 |
68 | /**
69 | * Initialize the Multiton Controller instance.
70 | *
71 | *
Called automatically by the constructor.
72 | * 73 | *Note that if you are using a subclass of View
74 | * in your application, you should also subclass Controller
75 | * and override the initializeController method in the
76 | * following way:
Controller Multiton Factory method.
95 | *
96 | * @return the Multiton instance of Controller
97 | */
98 | public static function getInstance( key:String ) : IController
99 | {
100 | if ( instanceMap[ key ] == null ) instanceMap[ key ] = new Controller( key );
101 | return instanceMap[ key ];
102 | }
103 |
104 | /**
105 | * If an ICommand has previously been registered
106 | * to handle a the given INotification, then it is executed.
107 | *
108 | * @param note an INotification
109 | */
110 | public function executeCommand( note : INotification ) : void
111 | {
112 | var commandClassRef : Class = commandMap[ note.getName() ];
113 | if ( commandClassRef == null ) return;
114 |
115 | var commandInstance : ICommand = new commandClassRef();
116 | commandInstance.initializeNotifier( multitonKey );
117 | commandInstance.execute( note );
118 | }
119 |
120 | /**
121 | * Register a particular ICommand class as the handler
122 | * for a particular INotification.
123 | *
124 | *
125 | * If an ICommand has already been registered to
126 | * handle INotifications with this name, it is no longer
127 | * used, the new ICommand is used instead.
INotification
133 | * @param commandClassRef the Class of the ICommand
134 | */
135 | public function registerCommand( notificationName : String, commandClassRef : Class ) : void
136 | {
137 | if ( commandMap[ notificationName ] == null ) {
138 | view.registerObserver( notificationName, new Observer( executeCommand, this ) );
139 | }
140 | commandMap[ notificationName ] = commandClassRef;
141 | }
142 |
143 | /**
144 | * Check if a Command is registered for a given Notification
145 | *
146 | * @param notificationName
147 | * @return whether a Command is currently registered for the given notificationName.
148 | */
149 | public function hasCommand( notificationName:String ) : Boolean
150 | {
151 | return commandMap[ notificationName ] != null;
152 | }
153 |
154 | /**
155 | * Remove a previously registered ICommand to INotification mapping.
156 | *
157 | * @param notificationName the name of the INotification to remove the ICommand mapping for
158 | */
159 | public function removeCommand( notificationName : String ) : void
160 | {
161 | // if the Command is registered...
162 | if ( hasCommand( notificationName ) )
163 | {
164 | // remove the observer
165 | view.removeObserver( notificationName, this );
166 |
167 | // remove the command
168 | commandMap[ notificationName ] = null;
169 | }
170 | }
171 |
172 | /**
173 | * Remove an IController instance
174 | *
175 | * @param multitonKey of IController instance to remove
176 | */
177 | public static function removeController( key:String ):void
178 | {
179 | delete instanceMap[ key ];
180 | }
181 |
182 | // Local reference to View
183 | protected var view : IView;
184 |
185 | // Mapping of Notification names to Command Class references
186 | protected var commandMap : Array;
187 |
188 | // The Multiton Key for this Core
189 | protected var multitonKey : String;
190 |
191 | // Singleton instance
192 | protected static var instanceMap : Array = new Array();
193 |
194 | // Message Constants
195 | protected const MULTITON_MSG : String = "Controller instance for this Multiton key already constructed!";
196 |
197 | }
198 | }
--------------------------------------------------------------------------------
/asdoc/org/puremvc/as3/multicore/interfaces/ICommand.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | | Package | org.puremvc.as3.multicore.interfaces | 36 |
| Interface | public interface ICommand extends INotifier | 39 |
| Implementors | MacroCommand, SimpleCommand | 42 |
48 | See also 49 |
50 |
Hide Inherited Public Methods
62 |
Show Inherited Public Methods
65 | | Method | Defined by | 70 |||
|---|---|---|---|
|
73 |
74 | execute(notification:INotification):void
75 |
76 | Execute the
77 | ICommand's logic to handle a given INotification. | ICommand | 78 |||
![]() |
81 |
82 | initializeNotifier(key:String):void
83 |
84 | Initialize this INotifier instance.
85 | | INotifier | 86 ||
![]() |
89 |
90 | sendNotification(notificationName:String, body:Object = null, type:String = null):void
91 |
92 | Send a
93 | INotification. | INotifier | 94 ||
| execute | () | method | 108 |
public function execute(notification:INotification):void
112 | Execute the ICommand's logic to handle a given INotification.
113 |
114 |
notification:INotification — an INotification to handle.
118 | |
119 |