Skip to content

Commit

Permalink
for marvin
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancisVarga committed Aug 26, 2010
1 parent 32e2f93 commit 71672f1
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 24 deletions.
29 changes: 29 additions & 0 deletions .settings/launch/WeLoveFDT_Robotlegs.launch
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.powerflasher.fdt.ui.MxmlcGroup">
<stringAttribute key="APP_ARGUMENTS" value=""/>
<stringAttribute key="ARGUMENTS" value=""/>
<booleanAttribute key="KILL_PREVIUOS_VIEWER" value="true"/>
<stringAttribute key="LAUNCHER_DEPENDENCIES" value="[Self]"/>
<stringAttribute key="MAIN_CLASS" value="src/com/welove/fdt/robotlegs/webinar/hfug/fromBerlin/WeLoveFDT_Robotlegs.as"/>
<stringAttribute key="OUTPUT" value="bin/WeLoveFDT_Robotlegs.swf"/>
<booleanAttribute key="PASS_CP" value="true"/>
<booleanAttribute key="PASS_MAIN_CLASS" value="true"/>
<booleanAttribute key="PASS_RSLS" value="false"/>
<booleanAttribute key="PASS_SWCS" value="true"/>
<intAttribute key="PLAYER_HEIGHT" value="400"/>
<intAttribute key="PLAYER_WIDTH" value="550"/>
<stringAttribute key="POST_COMPILE_ANT" value=""/>
<stringAttribute key="PRE_COMPILE_ANT" value=""/>
<stringAttribute key="PROJECT_NAME" value="WeLoveFDT_Robotlegs_Webinar"/>
<stringAttribute key="PUBLISHER_ID" value=""/>
<booleanAttribute key="START_SWF_ENABLED" value="true"/>
<stringAttribute key="START_SWF_LOCATION" value="bin/WeLoveFDT_Robotlegs.swf"/>
<stringAttribute key="START_SWF_WITH" value="Adobe Flash Player"/>
<booleanAttribute key="USE_PROJECT_COMPILER_ARGUMENTS" value="true"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/WeLoveFDT_Robotlegs_Webinar"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
</launchConfiguration>
Binary file added bin/WeLoveFDT_Robotlegs.swf
Binary file not shown.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin {
public class WeLoveFDT_Robotlegs extends Sprite { public class WeLoveFDT_Robotlegs extends Sprite {


public function WeLoveFDT_Robotlegs() { public function WeLoveFDT_Robotlegs() {
new ApplicationContext(); trace("++++++++++++++++++++++++++++++");
trace("WeLoveFDT_Robotlegs");
trace("++++++++++++++++++++++++++++++");
new ApplicationContext(this);
} }
} }
} }
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs {
import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.commands.RSSServiceCommand; import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.commands.RSSServiceCommand;
import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.events.RSSSerivceEvent; import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.events.RSSSerivceEvent;
import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.models.RSSModel; import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.models.RSSModel;
import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.services.RSSSerivce; import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.services.RSSService;
import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.views.ItemView; import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.views.MainContainer;
import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.views.MainContainerMediator;


import org.robotlegs.base.ContextEvent; import org.robotlegs.base.ContextEvent;
import org.robotlegs.mvcs.Context; import org.robotlegs.mvcs.Context;
Expand All @@ -21,13 +22,16 @@ package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs {
} }


override public function startup() : void { override public function startup() : void {

trace('startup: ' + (startup));

commandMap.mapEvent(ContextEvent.STARTUP_COMPLETE, InitialCommand, ContextEvent); commandMap.mapEvent(ContextEvent.STARTUP_COMPLETE, InitialCommand, ContextEvent);
commandMap.mapEvent(RSSSerivceEvent.LOAD_COMPLETE, RSSServiceCommand, RSSSerivceEvent); commandMap.mapEvent(RSSSerivceEvent.LOAD_COMPLETE, RSSServiceCommand, RSSSerivceEvent);


injector.mapSingleton(RSSSerivce); mediatorMap.mapView(MainContainer, MainContainerMediator);
injector.mapSingleton(RSSModel);


contextView.addChild(new ItemView()); injector.mapSingleton(RSSService);
injector.mapSingleton(RSSModel);


super.startup(); super.startup();
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.commands { package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.commands {
import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.events.RSSSerivceEvent; import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.services.RSSService;
import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.models.RSSModel;


import org.robotlegs.mvcs.Command; import org.robotlegs.mvcs.Command;


Expand All @@ -10,24 +9,13 @@ package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.commands {
public class InitialCommand extends Command { public class InitialCommand extends Command {


[Inject] [Inject]
public var event : RSSSerivceEvent; public var service : RSSService;

[Inject]
public var model : RSSModel;


override public function execute() : void { override public function execute() : void {


switch(event.type){ service.loadRSS("http://welovefdt.com/feed.xml");
case RSSSerivceEvent.LOAD_COMPLETE:
var rssList : Array = new Array();
_parseFunction(rssList);
break;
default:
}


} }


private function _parseFunction(rssList : Array) : void {
}
} }
} }
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.commands { package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.commands {
import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.views.MainContainer;
import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.events.RSSSerivceEvent; import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.events.RSSSerivceEvent;


import org.robotlegs.mvcs.Command; import org.robotlegs.mvcs.Command;
Expand All @@ -12,7 +13,26 @@ package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.commands {
public var event : RSSSerivceEvent; public var event : RSSSerivceEvent;


override public function execute() : void { override public function execute() : void {
var xmlObj : Object = event.resultData;

trace(event);

_parseRSSXML(event.resultData);

var mainContainer : MainContainer = new MainContainer();
contextView.addChild(mainContainer);

dispatch(new RSSSerivceEvent(RSSSerivceEvent.RSS_PARSED));

}

private function _parseRSSXML(xmlObj : Object):void
{
trace("_parseRSSXML()");

var xmlList : XMLList = new XMLList();
xmlList = new XML(xmlObj)["item"];

} }
} }
} }
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.events {
*/ */
public class RSSSerivceEvent extends Event { public class RSSSerivceEvent extends Event {
public static const LOAD_COMPLETE : String = "LOAD_COMPLETE"; public static const LOAD_COMPLETE : String = "LOAD_COMPLETE";
public static const RSS_PARSED : String = "RSS_PARSED";
public var resultData : *; public var resultData : *;
public function RSSSerivceEvent(type : String, bubbles : Boolean = false, cancelable : Boolean = false) { public function RSSSerivceEvent(type : String, bubbles : Boolean = false, cancelable : Boolean = false) {
super(type, bubbles, cancelable); super(type, bubbles, cancelable);
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.models {
*/ */
public class RSSModel extends Actor { public class RSSModel extends Actor {


var items : Vector.<IRSSItem> = new Vector.<IRSSItem>(); private var items : Vector.<IRSSItem> = new Vector.<IRSSItem>();


public function addItem(item :IRSSItem):void public function addItem(item :IRSSItem):void
{ {
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.services {
/** /**
* @author Francis Varga * @author Francis Varga
*/ */
public class RSSSerivce extends Actor { public class RSSService extends Actor {
public function loadRSS(url : String):void { public function loadRSS(url : String):void {
var loader : URLLoader = new URLLoader(); var loader : URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete); loader.addEventListener(Event.COMPLETE, onComplete);
Expand All @@ -26,6 +26,7 @@ package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.services {
} }


private function onIOError(event : IOErrorEvent) : void { private function onIOError(event : IOErrorEvent) : void {
trace(event.text);
} }
} }
} }
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.views {
import flash.display.Sprite;

/**
* @author Francis Varga
*/
public class MainContainer extends Sprite {
}
}
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.views {
import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.events.RSSSerivceEvent;
import com.welove.fdt.robotlegs.webinar.hfug.fromBerlin.mvcs.models.RSSModel;
import org.robotlegs.mvcs.Mediator;
/**
* @author Francis Varga
*/
public class MainContainerMediator extends Mediator {

[Inject]
public var model : RSSModel;

override public function onRegister() : void {

trace("onRegister");

addContextListener(RSSSerivceEvent.RSS_PARSED, onRSSParsed);

}

private function onRSSParsed(event : RSSSerivceEvent) : void {
}

}
}

0 comments on commit 71672f1

Please sign in to comment.