-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changing all Windmill references to FlexPilot.
- Loading branch information
mde
committed
Mar 31, 2010
1 parent
c9e147e
commit b87d88f
Showing
24 changed files
with
242 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,12 +14,12 @@ Copyright 2009, Matthew Eernisse ([email protected]) and Slide, Inc. | |
limitations under the License. | ||
*/ | ||
|
||
package org.windmill { | ||
import org.windmill.WMLocator; | ||
import org.windmill.WMLogger; | ||
package org.flex_pilot { | ||
import org.flex_pilot.FPLocator; | ||
import org.flex_pilot.FPLogger; | ||
import flash.utils.getQualifiedClassName; | ||
|
||
public dynamic class WMAssert { | ||
public dynamic class FPAssert { | ||
|
||
public static var assertTemplates:Object = { | ||
assertTrue: { | ||
|
@@ -99,8 +99,8 @@ package org.windmill { | |
}; | ||
|
||
public static function init():void { | ||
for (var p:String in WMAssert.assertTemplates) { | ||
WMAssert[p] = WMAssert.createAssert(p); | ||
for (var p:String in FPAssert.assertTemplates) { | ||
FPAssert[p] = FPAssert.createAssert(p); | ||
} | ||
} | ||
|
||
|
@@ -137,7 +137,7 @@ package org.windmill { | |
// The actual assert method, e.g, 'equals' | ||
var meth:String = args.shift(); | ||
// The assert object | ||
var asrt:Object = WMAssert.assertTemplates[meth]; | ||
var asrt:Object = FPAssert.assertTemplates[meth]; | ||
// The assert expresion | ||
var expr:Function = asrt.expr; | ||
// Validate the args passed | ||
|
@@ -165,7 +165,7 @@ package org.windmill { | |
} | ||
|
||
public static function assertDisplayObject(params:Object):Boolean { | ||
var obj:* = WMLocator.lookupDisplayObject(params); | ||
var obj:* = FPLocator.lookupDisplayObject(params); | ||
if (!!obj) { | ||
return true; | ||
} | ||
|
@@ -176,26 +176,26 @@ package org.windmill { | |
} | ||
|
||
public static function assertProperty(params:Object):Boolean { | ||
return WMAssert.doBaseAssert(params); | ||
return FPAssert.doBaseAssert(params); | ||
} | ||
|
||
public static function assertText(params:Object):Boolean { | ||
return WMAssert.assertTextGeneric(params, true); | ||
return FPAssert.assertTextGeneric(params, true); | ||
} | ||
|
||
public static function assertTextIn(params:Object):Boolean { | ||
return WMAssert.assertTextGeneric(params, false); | ||
return FPAssert.assertTextGeneric(params, false); | ||
} | ||
|
||
private static function assertTextGeneric(params:Object, | ||
exact:Boolean):Boolean { | ||
return WMAssert.doBaseAssert(params, { | ||
return FPAssert.doBaseAssert(params, { | ||
attrName: ['htmlText', 'label'], | ||
preMatchProcess: function (str:String):String { | ||
return str.replace(/^\s*|\s*$/g, ''); | ||
}, | ||
matchType: exact ? WMAssert.matchTypes.EXACT : | ||
WMAssert.matchTypes.CONTAINS | ||
matchType: exact ? FPAssert.matchTypes.EXACT : | ||
FPAssert.matchTypes.CONTAINS | ||
}); | ||
} | ||
|
||
|
@@ -204,9 +204,9 @@ package org.windmill { | |
private static function doBaseAssert(params:Object, | ||
opts:Object = null):Boolean { | ||
// Ref to the object to do the lookup on | ||
var obj:* = WMLocator.lookupDisplayObject(params); | ||
var obj:* = FPLocator.lookupDisplayObject(params); | ||
// Exact vs. 'in' (contains) match | ||
var matchType:String = WMAssert.matchTypes.EXACT; | ||
var matchType:String = FPAssert.matchTypes.EXACT; | ||
var attrName:String; | ||
var expectedVal:String; | ||
// Explicitly passing in the attr name, or a list of | ||
|
@@ -278,11 +278,11 @@ package org.windmill { | |
// Check for a match | ||
var ret:Boolean = false; | ||
var errMsg:String; | ||
if (matchType == WMAssert.matchTypes.EXACT) { | ||
if (matchType == FPAssert.matchTypes.EXACT) { | ||
ret = attrVal == expectedVal; | ||
errMsg = 'Expected "' + expectedVal + '", got "' + attrVal + '"'; | ||
} | ||
else if (matchType == WMAssert.matchTypes.CONTAINS) { | ||
else if (matchType == FPAssert.matchTypes.CONTAINS) { | ||
ret = attrVal.indexOf(expectedVal) > -1; | ||
errMsg = '"' + attrVal + '" did not contain "' + expectedVal + '"'; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,28 +14,28 @@ Copyright 2009, Matthew Eernisse ([email protected]) and Slide, Inc. | |
limitations under the License. | ||
*/ | ||
|
||
package org.windmill { | ||
package org.flex_pilot { | ||
import flash.display.Loader; | ||
import flash.net.URLRequest; | ||
import flash.events.Event; | ||
import flash.system.ApplicationDomain; | ||
import flash.system.SecurityDomain; | ||
import flash.system.LoaderContext; | ||
|
||
public class WMBootstrap { | ||
public static var windmillLibPath:String = '/flash/org/windmill/Windmill.swf'; | ||
public class FPBootstrap { | ||
public static var flex_pilotLibPath:String = '/flash/org/flex_pilot/FlexPilot.swf'; | ||
public static var wm:*; | ||
public static function init(context:*, domains:* = null):void { | ||
var loader:Loader = new Loader(); | ||
var url:String = WMBootstrap.windmillLibPath; | ||
var url:String = FPBootstrap.flex_pilotLibPath; | ||
var req:URLRequest = new URLRequest(url); | ||
var con:LoaderContext = new LoaderContext(false, | ||
ApplicationDomain.currentDomain, | ||
SecurityDomain.currentDomain); | ||
loader.contentLoaderInfo.addEventListener( | ||
Event.COMPLETE, function ():void { | ||
wm = ApplicationDomain.currentDomain.getDefinition( | ||
"org.windmill.Windmill") as Class; | ||
"org.flex_pilot.FlexPilot") as Class; | ||
wm.init({ context: context, domains: domains }); | ||
}); | ||
loader.load(req, con); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,31 +14,31 @@ Copyright 2009, Matthew Eernisse ([email protected]) and Slide, Inc. | |
limitations under the License. | ||
*/ | ||
|
||
package org.windmill { | ||
import org.windmill.events.*; | ||
import org.windmill.WMLocator; | ||
package org.flex_pilot { | ||
import org.flex_pilot.events.*; | ||
import org.flex_pilot.FPLocator; | ||
import flash.events.* | ||
import mx.events.* | ||
import flash.utils.*; | ||
import flash.geom.Point; | ||
|
||
public class WMController { | ||
public function WMController():void {} | ||
public class FPController { | ||
public function FPController():void {} | ||
|
||
public static function mouseOver(params:Object):void { | ||
var obj:* = WMLocator.lookupDisplayObject(params); | ||
var obj:* = FPLocator.lookupDisplayObject(params); | ||
Events.triggerMouseEvent(obj, MouseEvent.MOUSE_OVER); | ||
Events.triggerMouseEvent(obj, MouseEvent.ROLL_OVER); | ||
} | ||
|
||
public static function mouseOut(params:Object):void { | ||
var obj:* = WMLocator.lookupDisplayObject(params); | ||
var obj:* = FPLocator.lookupDisplayObject(params); | ||
Events.triggerMouseEvent(obj, MouseEvent.MOUSE_OUT); | ||
Events.triggerMouseEvent(obj, MouseEvent.ROLL_OUT); | ||
} | ||
|
||
public static function click(params:Object):void { | ||
var obj:* = WMLocator.lookupDisplayObject(params); | ||
var obj:* = FPLocator.lookupDisplayObject(params); | ||
// Give it focus | ||
Events.triggerFocusEvent(obj, FocusEvent.FOCUS_IN); | ||
// Down, (TextEvent.LINK,) up, click | ||
|
@@ -47,7 +47,7 @@ package org.windmill { | |
// If this is a link, do the TextEvent hokey-pokey | ||
// All events fire on the containing DisplayObject | ||
if ('link' in params) { | ||
var link:String = WMLocator.locateLinkHref(params.link, | ||
var link:String = FPLocator.locateLinkHref(params.link, | ||
obj.htmlText); | ||
Events.triggerTextEvent(obj, TextEvent.LINK, { | ||
text: link }); | ||
|
@@ -58,10 +58,10 @@ package org.windmill { | |
|
||
// Click alias functions | ||
public static function check(params:Object):void { | ||
return WMController.click(params); | ||
return FPController.click(params); | ||
} | ||
public static function radio(params:Object):void { | ||
return WMController.click(params); | ||
return FPController.click(params); | ||
} | ||
|
||
public static function dragDropElemToElem(params:Object):void { | ||
|
@@ -73,17 +73,17 @@ package org.windmill { | |
break; | ||
} | ||
} | ||
var dest:* = WMLocator.lookupDisplayObject(destParams); | ||
var dest:* = FPLocator.lookupDisplayObject(destParams); | ||
var destCoords:Point = new Point(0, 0); | ||
destCoords = dest.localToGlobal(destCoords); | ||
params.coords = '(' + destCoords.x + ',' + destCoords.y + ')'; | ||
dragDropToCoords(params); | ||
} | ||
|
||
public static function dragDropToCoords(params:Object):void { | ||
var obj:* = WMLocator.lookupDisplayObject(params); | ||
var obj:* = FPLocator.lookupDisplayObject(params); | ||
var startCoordsLocal:Point = new Point(0, 0); | ||
var endCoordsAbs:Point = WMController.parseCoords(params.coords); | ||
var endCoordsAbs:Point = FPController.parseCoords(params.coords); | ||
// Convert local X/Y to global | ||
var startCoordsAbs:Point = obj.localToGlobal(startCoordsLocal); | ||
// Move mouse over to the dragged obj | ||
|
@@ -169,7 +169,7 @@ package org.windmill { | |
} | ||
|
||
public static function doubleClick(params:Object):void { | ||
var obj:* = WMLocator.lookupDisplayObject(params); | ||
var obj:* = FPLocator.lookupDisplayObject(params); | ||
// Give it focus | ||
Events.triggerFocusEvent(obj, FocusEvent.FOCUS_IN); | ||
// First click | ||
|
@@ -179,7 +179,7 @@ package org.windmill { | |
// If this is a link, do the TextEvent hokey-pokey | ||
// All events fire on the containing DisplayObject | ||
if ('link' in params) { | ||
var link:String = WMLocator.locateLinkHref(params.link, | ||
var link:String = FPLocator.locateLinkHref(params.link, | ||
obj.htmlText); | ||
Events.triggerTextEvent(obj, TextEvent.LINK, { | ||
text: link }); | ||
|
@@ -201,7 +201,7 @@ package org.windmill { | |
|
||
public static function type(params:Object):void { | ||
// Look up the item to write to | ||
var obj:* = WMLocator.lookupDisplayObject(params); | ||
var obj:* = FPLocator.lookupDisplayObject(params); | ||
// Text to type out | ||
var str:String = params.text; | ||
// Char | ||
|
@@ -233,7 +233,7 @@ package org.windmill { | |
|
||
public static function select(params:Object):void { | ||
// Look up the item to write to | ||
var obj:* = WMLocator.lookupDisplayObject(params); | ||
var obj:* = FPLocator.lookupDisplayObject(params); | ||
var sel:* = obj.selectedItem; | ||
var item:*; | ||
// Give the item focus | ||
|
@@ -279,7 +279,7 @@ package org.windmill { | |
} | ||
public static function getTextValue(params:Object):String { | ||
// Look up the item where we want to get the property | ||
var obj:* = WMLocator.lookupDisplayObject(params); | ||
var obj:* = FPLocator.lookupDisplayObject(params); | ||
var attrs:Object=['htmlText', 'label']; | ||
var res:String = 'undefined'; | ||
var attr:String; | ||
|
@@ -294,7 +294,7 @@ package org.windmill { | |
|
||
public static function getPropertyValue(params:Object, opts:Object = null):String { | ||
// Look up the item where we want to get the property | ||
var obj:* = WMLocator.lookupDisplayObject(params); | ||
var obj:* = FPLocator.lookupDisplayObject(params); | ||
var attrName:String; | ||
var attrVal:String = 'undefined'; | ||
if (opts){ | ||
|
@@ -314,7 +314,7 @@ package org.windmill { | |
|
||
public static function getObjectCoords(params:Object):String { | ||
// Look up the item which coords we want to get | ||
var obj:* = WMLocator.lookupDisplayObject(params); | ||
var obj:* = FPLocator.lookupDisplayObject(params); | ||
var destCoords:Point = new Point(0, 0); | ||
destCoords = obj.localToGlobal(destCoords); | ||
var coords:String = '(' + String(destCoords.x) + ',' + String(destCoords.y) + ')'; | ||
|
Oops, something went wrong.