Permalink
Browse files

Added getA, set up for first swc of 0.1.0 release

  • Loading branch information...
1 parent 6752c0b commit 0231a96e1eabb8ea213ecd60533d24e337c1bdd4 @Stray committed Dec 8, 2010
View
BIN bin/robotEyes_0.1.swc
Binary file not shown.
View
BIN bin/roboteyesDemoApp-debug.swf
Binary file not shown.
View
BIN bin/roboteyesDemoAppRunner.swf
Binary file not shown.
View
15 rakefile.rb
@@ -6,7 +6,7 @@
############################################
# Configure your Project Model
project_model :model do |m|
- m.project_name = 'roboteyesDemoApp'
+ m.project_name = 'robotEyesDemoApp'
m.language = 'as3'
m.background_color = '#FFFFFF'
m.width = 800
@@ -41,7 +41,18 @@
document :doc
desc 'Compile a SWC file'
-swc :swc
+swc :swc do |t|
+ t.include_classes = "com.newloop.roboteyes.getA"
+ t.include_classes << " com.newloop.roboteyes.inViewOf"
+ t.include_classes << " com.newloop.roboteyes.core.RobotEyes"
+ t.include_classes << " com.newloop.roboteyes.core.RobotEyesChief"
+ t.include_classes << " com.newloop.roboteyes.core.RobotEyesMaster"
+ t.include_classes << " com.newloop.roboteyes.drivers.DisplayObjectDriver"
+ t.include_classes << " com.newloop.roboteyes.drivers.DisplayObjectDriverList"
+ t.include_classes << " com.newloop.roboteyes.drivers.InteractiveObjectDriver"
+ t.include_classes << " com.newloop.roboteyes.drivers.TextFieldDriver"
+ t.include_classes << " com.newloop.roboteyes.errors.RobotEyesError"
+end
desc 'Compile and run the test harness for CI'
ci :cruise
View
3 src/com/newloop/roboteyes/core/RobotEyes.as
@@ -24,6 +24,7 @@ package com.newloop.roboteyes.core {
public function get testApplication():*{
return _testApplication;
- }
+ }
+
}
}
View
25 src/com/newloop/roboteyes/core/RobotEyesChief.as
@@ -70,6 +70,10 @@ package com.newloop.roboteyes.core {
return findAnyInstanceOf(uiClazz, useViewRoot);
}
+ public function getSome(uiClazz:Class, useViewRoot:DisplayObjectContainer = null):DisplayObjectDriverList{
+ return findInstancesOf(uiClazz, useViewRoot);
+ }
+
public function createDriverFor(uiItem:DisplayObject):DisplayObjectDriver{
if(uiItem is TextField){
return new TextFieldDriver(uiItem as TextField);
@@ -141,15 +145,34 @@ package com.newloop.roboteyes.core {
useViewRoot = _viewRoot;
}
+ var nextChild:DisplayObject;
+
var iLength:uint = useViewRoot.numChildren;
for (var i:uint = 0; i<iLength; i++){
- var nextChild:DisplayObject = useViewRoot.getChildAt(i) as DisplayObject;
+ nextChild = useViewRoot.getChildAt(i) as DisplayObject;
if(nextChild is uiClazz){
return createDriverFor(nextChild);
}
}
+ for(i=0; i<iLength; i++){
+ nextChild = useViewRoot.getChildAt(i) as DisplayObject;
+
+ if(nextChild is DisplayObjectContainer){
+ try {
+ var grandChildResult:DisplayObjectDriver = findAnyInstanceOf(uiClazz, nextChild as DisplayObjectContainer);
+ if(grandChildResult != null)
+ {
+ return grandChildResult;
+ }
+ } catch(e:RobotEyesError) {
+ //
+ }
+
+ }
+ }
+
var e:RobotEyesError = new RobotEyesError("RobotEyes couldn't find a " + uiClazz + " inside " + useViewRoot.toString());
throw(e);
View
4 src/com/newloop/roboteyes/core/RobotEyesMaster.as
@@ -71,6 +71,10 @@ package com.newloop.roboteyes.core {
return _robotEyesChief.getAny(uiClazz, viewRoot);
}
+ public static function getSome(uiClazz:Class, viewRoot:DisplayObjectContainer = null):DisplayObjectDriverList{
+ return _robotEyesChief.getSome(uiClazz, viewRoot);
+ }
+
public static function createDriverFor(uiItem:DisplayObject):DisplayObjectDriver{
return _robotEyesChief.createDriverFor(uiItem);
}
View
11 src/com/newloop/roboteyes/drivers/DisplayObjectDriver.as
@@ -74,6 +74,17 @@ package com.newloop.roboteyes.drivers {
}
+ public function getSome(uiClazz:Class):DisplayObjectDriverList{
+
+ if(_view is DisplayObjectContainer){
+ return RobotEyesMaster.getSome(uiClazz, _view as DisplayObjectContainer);
+
+ }
+
+ return null;
+
+ }
+
public function getAny(uiClazz:Class):DisplayObjectDriver{
if(_view is DisplayObjectContainer){
View
17 src/com/newloop/roboteyes/drivers/DisplayObjectDriverList.as
@@ -74,6 +74,23 @@ package com.newloop.roboteyes.drivers {
return null;
}
+
+ public function countInstancesWithProperty(propName:String, propValue:*):uint{
+ var matchCount:uint = 0;
+
+ var iLength:uint = _matchingInstancesArray.length;
+ for (var i:uint = 0; i<iLength; i++){
+ var nextItem:DisplayObject = _matchingInstancesArray[i];
+ if(nextItem.hasOwnProperty(propName)){
+ if(nextItem[propName]==propValue){
+ matchCount++;
+ }
+ }
+ }
+
+ return matchCount;
+
+ }
//--------------------------------------
// EVENT HANDLERS
View
4 src/com/newloop/roboteyes/drivers/TextFieldDriver.as
@@ -32,6 +32,10 @@ package com.newloop.roboteyes.drivers {
return _textField.text == testText;
}
+ public function getText():String {
+ return _textField.text;
+ }
+
public function textIs(testText:String):Boolean{
return checkText(testText);
}
View
22 src/com/newloop/roboteyes/getA.as
@@ -0,0 +1,22 @@
+package com.newloop.roboteyes
+{
+
+ import com.newloop.roboteyes.core.RobotEyesMaster;
+ import com.newloop.roboteyes.drivers.DisplayObjectDriver;
+
+ /**
+ * Class description.
+ *
+ * @langversion ActionScript 3.0
+ * @playerversion Flash 9.0
+ *
+ * @author Lindsey Fallow
+ * @since 07.01.2010
+ */
+
+ public function getA(viewClazz:Class):DisplayObjectDriver
+ {
+ return RobotEyesMaster.getA(viewClazz);
+ }
+
+}
View
4 src/roboteyesDemoAppRunner.as
@@ -1,9 +1,9 @@
package {
import asunit.textui.TestRunner;
- public class roboteyesDemoAppRunner extends TestRunner {
+ public class robotEyesDemoAppRunner extends TestRunner {
- public function roboteyesDemoAppRunner() {
+ public function robotEyesDemoAppRunner() {
// start(clazz:Class, methodName:String, showTrace:Boolean)
// NOTE: sending a particular class and method name will
// execute setUp(), the method and NOT tearDown.

0 comments on commit 0231a96

Please sign in to comment.