Menu

[r324]: / cairngorm3 / trunk / libraries / ModuleTest / src / CairngormModuleLibSample.mxml  Maximize  Restore  History

Download this file

99 lines (74 with data), 4.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:example="example.*"
layout="vertical" width="100%" height="100%" xmlns:spicefactory="http://www.spicefactory.org/parsley" xmlns:cairngorm="com.adobe.cairngorm.*">
<mx:Script>
<![CDATA[
import example.api.BroadcastMessage;
import example.api.ClearLogMessage;
import example.api.PingMessage;
import mx.logging.LogEventLevel;
import mx.modules.IModuleInfo;
[Bindable]
[Inject(id="moduleA")]
public var moduleA:IModuleInfo;
[Bindable]
[Inject(id="moduleB")]
public var moduleB:IModuleInfo;
[MessageDispatcher]
public var dispatcher:Function;
protected function dispatchPingMessage(moduleId:String=null):void
{
dispatcher( new PingMessage(moduleId) );
}
protected function dispatchBroadcastMessage():void
{
dispatcher( new BroadcastMessage() );
}
private var moduleCount:int = 5;
protected function button1_clickHandler(event:MouseEvent):void
{
var modulePod:ModulePod = new ModulePod();
modulePod.percentWidth=100;
modulePod.percentHeight=100;
modulePod.label=modulePod.moduleId="moduleA"+moduleCount++;
modulePod.moduleInfo=moduleA;
tabNav.addChild(modulePod);
}
]]>
</mx:Script>
<spicefactory:ContextBuilder config="{ CairngormModuleLibSampleContext }" />
<mx:TraceTarget level="{ LogEventLevel.DEBUG }" includeCategory="true">
<mx:filters>
<mx:Array>
<mx:String>com.adobe.cairngorm.*</mx:String>
<mx:String>org.spicefactory.*</mx:String>
</mx:Array>
</mx:filters>
</mx:TraceTarget>
<cairngorm:CairngormModuleLib />
<spicefactory:Configure />
<mx:HBox width="100%">
<mx:Button label="Ping moduleA" click="dispatchPingMessage('moduleA')" />
<mx:Button label="Ping moduleA2" click="dispatchPingMessage('moduleA2')" />
<mx:Button label="Ping moduleB" click="dispatchPingMessage('moduleB')" />
<mx:Button label="Ping all ModuleA" click="dispatchPingMessage()" />
<mx:Button label="Broadcast All" click="dispatchBroadcastMessage()" />
<mx:Spacer width="10" />
<mx:Button label="CLEAR ALL LOGS" click="dispatcher( new ClearLogMessage() )" />
<mx:Spacer width="100%" />
<mx:Button label="Add new instance of ModuleA" click="button1_clickHandler(event)" />
<mx:TextInput id="moduleIdInput" width="150" text="moduleA3"/>
<mx:Button label="Ping" click="dispatchPingMessage(moduleIdInput.text)" />
</mx:HBox>
<mx:HBox width="100%" height="100%">
<mx:VBox width="350" height="100%">
<example:ModulePod width="100%" height="33%" moduleId="moduleA" moduleInfo="{ moduleA }" label="moduleA" />
<example:ModulePod width="100%" height="33%" moduleId="moduleA2" moduleInfo="{ moduleA }" label="moduleA2" />
<example:ModulePod width="100%" height="33%" moduleId="moduleB" moduleInfo="{ moduleB }" label="moduleB" />
</mx:VBox>
<mx:TabNavigator width="100%" height="400" id="tabNav">
<example:ModulePod width="100%" height="100%" moduleId="moduleA3" moduleInfo="{ moduleA }" label="moduleA3" />
<example:ModulePod width="100%" height="100%" moduleId="moduleA4" moduleInfo="{ moduleA }" label="moduleA4" />
</mx:TabNavigator>
</mx:HBox>
</mx:Application>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.