asproject 0.1.21
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +0 -0
- data/History.txt +0 -0
- data/MIT-LICENSE.txt +20 -0
- data/Manifest.txt +16 -0
- data/README.txt +3 -0
- data/TODO.txt +10 -0
- data/bin/asclass +16 -0
- data/bin/asproject +16 -0
- data/lib/asclass.rb +254 -0
- data/lib/asclass_arguments.rb +147 -0
- data/lib/asproject.rb +248 -0
- data/lib/asproject/version.rb +9 -0
- data/lib/asproject_arguments.rb +175 -0
- data/lib/asproject_base.rb +43 -0
- data/lib/asproject_utils.rb +57 -0
- data/lib/eclipse_project.rb +32 -0
- data/lib/path_finder.rb +286 -0
- data/lib/platform.rb +107 -0
- data/lib/project.rb +82 -0
- data/lib/template_resolver.rb +144 -0
- data/lib/test_suite_generator.rb +128 -0
- data/rakefile.rb +85 -0
- data/setup.rb +1585 -0
- data/templates/asclass/as2/Class.as +11 -0
- data/templates/asclass/as2/Component.as +8 -0
- data/templates/asclass/as2/Interface.as +3 -0
- data/templates/asclass/as2/TestCase.as +30 -0
- data/templates/asclass/as2/TestSuite.as +15 -0
- data/templates/asclass/as3/Class.as +9 -0
- data/templates/asclass/as3/Component.as +9 -0
- data/templates/asclass/as3/Component.mxml +1 -0
- data/templates/asclass/as3/Interface.as +6 -0
- data/templates/asclass/as3/TestCase.as +30 -0
- data/templates/asclass/as3/TestSuite.as +18 -0
- data/templates/asproject/as2/project/rakefile.rb +18 -0
- data/templates/asproject/as2/project/src/AsProject.as +13 -0
- data/templates/asproject/as2/project/test/AsProjectRunner.as +12 -0
- data/templates/asproject/as3/project/rakefile.rb +18 -0
- data/templates/asproject/as3/project/src/AsProject.as +9 -0
- data/templates/asproject/as3/project/src/AsProjectRunner.as +11 -0
- data/templates/asproject/asunit2/project/lib/asunit/AsUnitUi.swf +0 -0
- data/templates/asproject/asunit2/project/lib/asunit/Sys.as +70 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanel.as +182 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTest.as +84 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTextArea.as +111 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTextAreaTest.as +26 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTitleBar.as +81 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/ResizeHandle.as +35 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/ScrollArrow.as +34 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/ScrollHandle.as +43 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/ScrollListener.as +10 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/TextScroller.as +169 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/shapes/Rectangle.as +29 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/shapes/Triangle.as +27 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/AsUnit.as +19 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/Assert.as +408 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/Assertion.as +27 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/Reflection.as +68 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/Test.as +3 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestCase.as +191 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestCaseXml.as +31 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestFailure.as +15 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestResult.as +15 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestRunner.as +41 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestSetup.as +19 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestSuite.as +22 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/ui/Main.as +325 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/ui/RemoteVersion.as +24 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/ui/SuccessMeter.as +32 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/Comparable.as +7 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/EventListener.as +29 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/EventSource.as +89 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/LocalConnClient.as +42 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/LocalConnGateway.as +47 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/LocalConnServer.as +61 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/LocalMessageBroker.as +58 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/Observable.as +11 -0
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/TextFile.as +30 -0
- data/templates/asproject/asunit25/project/lib/asunit/AsUnitTestRunner.as +13 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/AssertionFailedError.as +7 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/AssertionPassedError.as +7 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/ClassNotFoundError.as +7 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/IllegalOperationError.as +7 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/InstanceNotFoundError.as +7 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/InvocationTargetError.as +7 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/UnimplementedFeatureError.as +7 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/Assert.as +376 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/AssertMock.as +15 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/AssertTest.as +59 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/ITestListener.as +13 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/Test.as +11 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestCase.as +277 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestCaseMock.as +23 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestCaseTest.as +29 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestCaseXml.as +38 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestFailure.as +47 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestResult.as +168 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestSuite.as +102 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/runner/BaseTestRunner.as +101 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/runner/IResultPrinter.as +8 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/textui/ResultPrinter.as +254 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/textui/SuccessBar.as +41 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/textui/TestRunner.as +17 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIterator.as +24 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as +52 -0
- data/templates/asproject/asunit25/project/lib/asunit/asunit/util/Iterator.as +5 -0
- data/templates/asproject/asunit3/project/lib/asunit/AsUnitTestRunner.as +10 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/AbstractMemberCalledError.as +10 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/AssertionFailedError.as +10 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/ClassNotFoundError.as +10 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/InstanceNotFoundError.as +10 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/UnimplementedFeatureError.as +10 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/Assert.as +271 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/AsynchronousTestCase.as +52 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/AsynchronousTestCaseExample.as +71 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/Test.as +15 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestCase.as +351 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestCaseExample.as +73 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestFailure.as +47 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestListener.as +22 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestResult.as +158 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestSuite.as +115 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/runner/BaseTestRunner.as +15 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/runner/TestSuiteLoader.as +9 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/runner/Version.as +11 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexRunner.as +19 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as +55 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/textui/ResultPrinter.as +245 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/textui/TestRunner.as +121 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/util/ArrayIterator.as +26 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/util/Iterator.as +9 -0
- data/templates/asproject/asunit3/project/lib/asunit/asunit/util/Properties.as +30 -0
- data/templates/asproject/asunit3/project/lib/asunit/mx/managers/LayoutManager.as +945 -0
- data/templates/asproject/config/project/config/asclass_config.rb +58 -0
- data/templates/asproject/fb2as/project/.actionScriptProperties +21 -0
- data/templates/asproject/fb2as/project/.project +29 -0
- data/templates/asproject/fdt/project/.as2_classpath +6 -0
- data/templates/asproject/fdt/project/.project +19 -0
- data/templates/ide/mate/Create Class.tmCommand +37 -0
- data/templates/ide/mate/Rebuild Test Suites.tmCommand +33 -0
- data/templates/ide/mate/Run Rake Task.tmCommand +127 -0
- metadata +266 -0
data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTest.as
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
|
2
|
+
import com.asunit.controls.*;
|
3
|
+
import com.asunit.framework.*;
|
4
|
+
|
5
|
+
class LocalOutputPanelTest extends TestCase {
|
6
|
+
public var className:String = "com.asunit.controls.LocalOutputPanelTest";
|
7
|
+
private var testInstance:LocalOutputPanel;
|
8
|
+
|
9
|
+
public function setUp():Void {
|
10
|
+
var dpth:Number = getValidDepth(_root);
|
11
|
+
testInstance = LocalOutputPanel.getInstance(_root, dpth);
|
12
|
+
// testInstance = LocalOutputPanel(_root.attachMovie(LocalOutputPanel.linkageId, "textArea_" + dpth, dpth));
|
13
|
+
}
|
14
|
+
|
15
|
+
public function tearDown():Void {
|
16
|
+
// testInstance.removeMovieClip();
|
17
|
+
}
|
18
|
+
|
19
|
+
public function testInstantiated():Void {
|
20
|
+
assertTrue("LocalOutputPanel instantiated", testInstance instanceof LocalOutputPanel);
|
21
|
+
Sys.println(">> hello");
|
22
|
+
Sys.println(">> hellojfhhfghlkkjhfwkjh wfkjhwekfjh wkjhw lkjhflkjhewff weflkj hwlkheff wkjhjefflkjhefwjehekjjh kjhdsfkjhdsfkjsjhdffkjsdhdffkljshdfkjsdhdfksjddf");
|
23
|
+
Sys.println(">> hello");
|
24
|
+
Sys.println(">> hello");
|
25
|
+
Sys.println(">> hello");
|
26
|
+
Sys.println(">> hello");
|
27
|
+
Sys.println(">> hello");
|
28
|
+
Sys.println(">> hello");
|
29
|
+
Sys.println(">> hello");
|
30
|
+
Sys.println(">> hello");
|
31
|
+
Sys.println(">> hello");
|
32
|
+
Sys.println(">> hello");
|
33
|
+
Sys.println(">> hello");
|
34
|
+
Sys.println(">> hello");
|
35
|
+
Sys.println(">> helloeeertert");
|
36
|
+
Sys.println(">> hello");
|
37
|
+
Sys.println(">> hello");
|
38
|
+
Sys.println(">> hello");
|
39
|
+
Sys.println(">> hello");
|
40
|
+
Sys.println(">> hello");
|
41
|
+
Sys.println(">> hello");
|
42
|
+
Sys.println(">> hello");
|
43
|
+
Sys.println(">> hello");
|
44
|
+
Sys.println(">> hello");
|
45
|
+
Sys.println(">> helloyerteryey");
|
46
|
+
Sys.println(">> hello");
|
47
|
+
Sys.println(">> hello");
|
48
|
+
Sys.println(">> hello");
|
49
|
+
Sys.println(">> hello");
|
50
|
+
Sys.println(">> hello");
|
51
|
+
Sys.println(">> hello");
|
52
|
+
Sys.println(">> hello");
|
53
|
+
Sys.println(">> hello");
|
54
|
+
Sys.println(">> hello");
|
55
|
+
Sys.println(">> hello");
|
56
|
+
Sys.println(">> hello");
|
57
|
+
Sys.println(">> hello");
|
58
|
+
Sys.println(">> hello");
|
59
|
+
Sys.println(">> hello");
|
60
|
+
Sys.println(">> hello");
|
61
|
+
Sys.println(">> hello23232");
|
62
|
+
Sys.println(">> hello");
|
63
|
+
Sys.println(">> hello");
|
64
|
+
Sys.println(">> hello");
|
65
|
+
Sys.println(">> hello");
|
66
|
+
Sys.println(">> hello");
|
67
|
+
Sys.println(">> hello");
|
68
|
+
Sys.println(">> hello");
|
69
|
+
Sys.println(">> hello");
|
70
|
+
Sys.println(">> hello");
|
71
|
+
Sys.println(">> hello");
|
72
|
+
Sys.println(">> hello");
|
73
|
+
Sys.println(">> hello");
|
74
|
+
Sys.println(">> hello");
|
75
|
+
Sys.println(">> hello");
|
76
|
+
Sys.println(">> hello");
|
77
|
+
Sys.println(">> hello");
|
78
|
+
Sys.println(">> hello");
|
79
|
+
Sys.println(">> hello");
|
80
|
+
Sys.println(">> hello");
|
81
|
+
Sys.println(">> hello232323");
|
82
|
+
Sys.println(">> hello");
|
83
|
+
}
|
84
|
+
}
|
data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTextArea.as
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
|
2
|
+
import com.asunit.controls.*;
|
3
|
+
import com.asunit.util.*;
|
4
|
+
|
5
|
+
class com.asunit.controls.LocalOutputPanelTextArea extends MovieClip {
|
6
|
+
public static var linkageId:String = "__Packages.com.asunit.controls.LocalOutputPanelTextArea"; public static var classRef:Function = LocalOutputPanelTextArea;
|
7
|
+
private var message:TextField;
|
8
|
+
private var txtFormat:TextFormat;
|
9
|
+
private var width:Number;
|
10
|
+
private var height:Number;
|
11
|
+
private var eventSrc:EventSource;
|
12
|
+
|
13
|
+
public function LocalOutputPanelTextArea() {
|
14
|
+
init();
|
15
|
+
}
|
16
|
+
|
17
|
+
public function init():Void {
|
18
|
+
createAssets();
|
19
|
+
}
|
20
|
+
|
21
|
+
public function createAssets():Void {
|
22
|
+
createTextField("message", 1, 0, 0, width, height);
|
23
|
+
message.border = true;
|
24
|
+
message.background = true;
|
25
|
+
message.backgroundColor = 0x000000;
|
26
|
+
message.textColor = 0x33FF00;
|
27
|
+
message.wordWrap = true;
|
28
|
+
message.selectable = true;
|
29
|
+
|
30
|
+
txtFormat = new TextFormat();
|
31
|
+
txtFormat.font = "Verdana";
|
32
|
+
txtFormat.leftMargin = 2;
|
33
|
+
txtFormat.rightMargin = 20;
|
34
|
+
txtFormat.size = 11;
|
35
|
+
}
|
36
|
+
|
37
|
+
public function println(msg:String):String {
|
38
|
+
message.text += msg + "\n";
|
39
|
+
message.setTextFormat(txtFormat);
|
40
|
+
message.scroll = message.maxscroll;
|
41
|
+
return msg;
|
42
|
+
}
|
43
|
+
|
44
|
+
public function set text(str:String):Void {
|
45
|
+
message.text = str;
|
46
|
+
message.setTextFormat(txtFormat);
|
47
|
+
eventSrc.broadcastMessage("onTextChanged", {event:"onTextChanged", source:this});
|
48
|
+
}
|
49
|
+
|
50
|
+
public function getTextField():TextField {
|
51
|
+
return message;
|
52
|
+
}
|
53
|
+
|
54
|
+
public function get text():String {
|
55
|
+
return message.text;
|
56
|
+
}
|
57
|
+
|
58
|
+
public function set htmlText(str:String):Void {
|
59
|
+
message.htmlText = str;
|
60
|
+
}
|
61
|
+
|
62
|
+
public function get htmlText():String {
|
63
|
+
return message.htmlText;
|
64
|
+
}
|
65
|
+
|
66
|
+
public function set scroll(num:Number):Void {
|
67
|
+
message.scroll = num;
|
68
|
+
}
|
69
|
+
|
70
|
+
public function get maxscroll():Number {
|
71
|
+
return message.maxscroll;
|
72
|
+
}
|
73
|
+
|
74
|
+
public function get bottomScroll():Number {
|
75
|
+
return message.bottomScroll;
|
76
|
+
}
|
77
|
+
|
78
|
+
public function setWidth(num:Number):Number {
|
79
|
+
width = Math.round(num);
|
80
|
+
message._width = width;
|
81
|
+
return message.width;
|
82
|
+
}
|
83
|
+
|
84
|
+
public function setHeight(num:Number):Number {
|
85
|
+
height = Math.round(num);
|
86
|
+
message._height = height;
|
87
|
+
return message.height;
|
88
|
+
}
|
89
|
+
|
90
|
+
public function get scroll():Number {
|
91
|
+
return message.scroll;
|
92
|
+
}
|
93
|
+
|
94
|
+
public function addEventListener(event:String, observer:Object, scope:Object):Void {
|
95
|
+
eventSrc.addEventListener(event, observer, scope);
|
96
|
+
}
|
97
|
+
|
98
|
+
public function addListener(observer:Object, scope:Object):Void {
|
99
|
+
eventSrc.addListener(observer, scope);
|
100
|
+
}
|
101
|
+
|
102
|
+
public function removeEventListener(event:String, observer:Object):Boolean {
|
103
|
+
return eventSrc.removeEventListener(event, observer);
|
104
|
+
}
|
105
|
+
|
106
|
+
public function removeListener(observer:Object):Boolean {
|
107
|
+
return eventSrc.removeListener(observer);
|
108
|
+
}
|
109
|
+
|
110
|
+
public static var serializable:Boolean = Object.registerClass(linkageId, classRef);
|
111
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
import com.asunit.controls.*;
|
3
|
+
import com.asunit.framework.*;
|
4
|
+
|
5
|
+
class LocalOutputPanelTextAreaTest extends TestCase {
|
6
|
+
private var className:String = "com.asunit.controls.LocalOutputPanelTextAreaTest";
|
7
|
+
private var testInstance:LocalOutputPanelTextArea;
|
8
|
+
|
9
|
+
public function setUp():Void {
|
10
|
+
var dpth:Number = getValidDepth(_root);
|
11
|
+
testInstance = LocalOutputPanelTextArea(_root.attachMovie(LocalOutputPanelTextArea.linkageId, "textArea_" + dpth, dpth));
|
12
|
+
}
|
13
|
+
|
14
|
+
public function tearDown():Void {
|
15
|
+
testInstance.removeMovieClip();
|
16
|
+
}
|
17
|
+
|
18
|
+
public function testInstantiated():Void {
|
19
|
+
assertTrue("LocalOutputPanelTextArea instantiated", testInstance instanceof LocalOutputPanelTextArea);
|
20
|
+
}
|
21
|
+
|
22
|
+
public function testMessage():Void {
|
23
|
+
testInstance.text = "hello world";
|
24
|
+
assertTrue("text retrieves", (testInstance.text == "hello world"));
|
25
|
+
}
|
26
|
+
}
|
data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTitleBar.as
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
|
2
|
+
import com.asunit.controls.*;
|
3
|
+
import com.asunit.controls.shapes.*;
|
4
|
+
|
5
|
+
class com.asunit.controls.LocalOutputPanelTitleBar extends Rectangle {
|
6
|
+
public static var linkageId:String = "__Packages.com.asunit.controls.LocalOutputPanelTitleBar";
|
7
|
+
public static var classRef:Function = LocalOutputPanelTitleBar;
|
8
|
+
private var controller:LocalOutputPanel;
|
9
|
+
private var title:TextField;
|
10
|
+
private var txtFormat:TextFormat;
|
11
|
+
|
12
|
+
public function LocalOutputPanelTitleBar() {
|
13
|
+
init();
|
14
|
+
}
|
15
|
+
|
16
|
+
public function init():Void {
|
17
|
+
onPress = doPress;
|
18
|
+
onRelease = doRelease;
|
19
|
+
createAssets();
|
20
|
+
}
|
21
|
+
|
22
|
+
public function createAssets():Void {
|
23
|
+
createTextField("title", 1, 0, 0, width, height);
|
24
|
+
title.wordWrap = true;
|
25
|
+
title.selectable = false;
|
26
|
+
|
27
|
+
txtFormat = new TextFormat();
|
28
|
+
txtFormat.font = "Verdana";
|
29
|
+
txtFormat.bold = true;
|
30
|
+
txtFormat.leftMargin = 2;
|
31
|
+
txtFormat.rightMargin = 20;
|
32
|
+
txtFormat.size = 10;
|
33
|
+
|
34
|
+
title.text = "AsUnit Output Panel [v." + controller.getVersion() + "]";
|
35
|
+
title.setTextFormat(txtFormat);
|
36
|
+
}
|
37
|
+
|
38
|
+
public function doPress():Void {
|
39
|
+
onMouseMove = doMouseMove;
|
40
|
+
}
|
41
|
+
|
42
|
+
public function doMouseMove():Void {
|
43
|
+
controller.beginDrag();
|
44
|
+
onRelease = doReleaseDrag;
|
45
|
+
onMouseMove = doMouseUpdate;
|
46
|
+
}
|
47
|
+
|
48
|
+
public function doMouseUpdate():Void {
|
49
|
+
updateAfterEvent();
|
50
|
+
}
|
51
|
+
|
52
|
+
public function doReleaseDrag():Void {
|
53
|
+
delete onMouseMove;
|
54
|
+
onRelease = doRelease;
|
55
|
+
controller.endDrag();
|
56
|
+
}
|
57
|
+
|
58
|
+
public function onReleaseOutside():Void {
|
59
|
+
doReleaseDrag();
|
60
|
+
}
|
61
|
+
|
62
|
+
public function doRelease():Void {
|
63
|
+
Sys.println(">> title released");
|
64
|
+
delete onMouseMove;
|
65
|
+
// controller.toggleVisible();
|
66
|
+
}
|
67
|
+
|
68
|
+
public function setWidth(num:Number):Number {
|
69
|
+
width = Math.round(num);
|
70
|
+
title._width = width;
|
71
|
+
refreshLayout();
|
72
|
+
return width;
|
73
|
+
}
|
74
|
+
|
75
|
+
public function refreshLayout():Void {
|
76
|
+
super.refreshLayout();
|
77
|
+
title.width = width;
|
78
|
+
}
|
79
|
+
|
80
|
+
public static var serializable:Boolean = Object.registerClass(linkageId, classRef);
|
81
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
import com.asunit.controls.*;
|
3
|
+
import com.asunit.controls.shapes.*;
|
4
|
+
|
5
|
+
class com.asunit.controls.ResizeHandle extends Rectangle {
|
6
|
+
public static var linkageId:String = "__Packages.com.asunit.controls.ResizeHandle";
|
7
|
+
public static var classRef:Function = ResizeHandle;
|
8
|
+
private var bgColor:Number = 0xCCCCCC;
|
9
|
+
private var controller:Object;
|
10
|
+
|
11
|
+
public function ResizeHandle() {
|
12
|
+
onPress = doPress;
|
13
|
+
onRelease = doRelease;
|
14
|
+
onReleaseOutside = doReleaseOutside;
|
15
|
+
}
|
16
|
+
|
17
|
+
public function doPress():Void {
|
18
|
+
onMouseMove = doMouseMove;
|
19
|
+
}
|
20
|
+
|
21
|
+
public function doReleaseOutside():Void {
|
22
|
+
onRelease();
|
23
|
+
}
|
24
|
+
|
25
|
+
public function doMouseMove():Void {
|
26
|
+
controller.onResizeHandleMoved();
|
27
|
+
updateAfterEvent();
|
28
|
+
}
|
29
|
+
|
30
|
+
public function doRelease():Void {
|
31
|
+
delete onMouseMove;
|
32
|
+
}
|
33
|
+
|
34
|
+
public static var serializable:Boolean = Object.registerClass(linkageId, classRef);
|
35
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
|
2
|
+
import com.asunit.controls.*;
|
3
|
+
import com.asunit.controls.shapes.*;
|
4
|
+
|
5
|
+
class com.asunit.controls.ScrollArrow extends Rectangle {
|
6
|
+
public static var linkageId:String = "__Packages.com.asunit.controls.ScrollArrow";
|
7
|
+
public static var classRef:Function = ScrollArrow;
|
8
|
+
private var controller:TextScroller;
|
9
|
+
private var bgColor:Number = 0xCCCCCC;
|
10
|
+
|
11
|
+
public function ScrollArrow() {
|
12
|
+
init();
|
13
|
+
}
|
14
|
+
|
15
|
+
public function init():Void {
|
16
|
+
onPress = doPress;
|
17
|
+
onRelease = doRelease;
|
18
|
+
onReleaseOutside = doReleaseOutside;
|
19
|
+
}
|
20
|
+
|
21
|
+
public function doPress():Void {
|
22
|
+
controller.onArrowPressed(this);
|
23
|
+
}
|
24
|
+
|
25
|
+
public function doReleaseOutside():Void {
|
26
|
+
onRelease();
|
27
|
+
}
|
28
|
+
|
29
|
+
public function doRelease():Void {
|
30
|
+
controller.onArrowReleased(this);
|
31
|
+
}
|
32
|
+
|
33
|
+
public static var serializable:Boolean = Object.registerClass(linkageId, classRef);
|
34
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
|
2
|
+
import com.asunit.controls.*;
|
3
|
+
import com.asunit.controls.shapes.*;
|
4
|
+
|
5
|
+
class com.asunit.controls.ScrollHandle extends Rectangle {
|
6
|
+
public static var linkageId:String = "__Packages.com.asunit.controls.ScrollHandle";
|
7
|
+
public static var classRef:Function = ScrollHandle;
|
8
|
+
private var controller:TextScroller;
|
9
|
+
private var bgColor:Number = 0xCCCCCC;
|
10
|
+
|
11
|
+
public function ScrollHandle() {
|
12
|
+
init();
|
13
|
+
}
|
14
|
+
|
15
|
+
public function init():Void {
|
16
|
+
onPress = doPress;
|
17
|
+
onRelease = doRelease;
|
18
|
+
onReleaseOutside = doReleaseOutside;
|
19
|
+
}
|
20
|
+
|
21
|
+
public function doPress():Void {
|
22
|
+
onMouseMove = doMouseMove;
|
23
|
+
controller.onScrollHandlePressed();
|
24
|
+
startDrag(this, false, 0, _parent.upArrow._y, 0, _parent.getHandleTravel());
|
25
|
+
}
|
26
|
+
|
27
|
+
public function doReleaseOutside():Void {
|
28
|
+
onRelease();
|
29
|
+
}
|
30
|
+
|
31
|
+
public function doMouseMove():Void {
|
32
|
+
controller.onScrollHandleMoved();
|
33
|
+
updateAfterEvent();
|
34
|
+
}
|
35
|
+
|
36
|
+
public function doRelease():Void {
|
37
|
+
stopDrag();
|
38
|
+
controller.onScrollHandleReleased();
|
39
|
+
delete onMouseMove;
|
40
|
+
}
|
41
|
+
|
42
|
+
public static var serializable:Boolean = Object.registerClass(linkageId, classRef);
|
43
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
import com.asunit.controls.*;
|
3
|
+
import com.asunit.util.*;
|
4
|
+
|
5
|
+
interface com.asunit.controls.ScrollListener extends Observable {
|
6
|
+
|
7
|
+
public function onScrollUp(event:Object):Void;
|
8
|
+
public function onScrollDown(event:Object):Void;
|
9
|
+
public function getTextField():TextField;
|
10
|
+
}
|
@@ -0,0 +1,169 @@
|
|
1
|
+
|
2
|
+
import com.asunit.controls.*;
|
3
|
+
import com.asunit.controls.shapes.*;
|
4
|
+
import com.asunit.util.*;
|
5
|
+
|
6
|
+
class com.asunit.controls.TextScroller extends Rectangle implements Observable {
|
7
|
+
public static var linkageId:String = "__Packages.com.asunit.controls.TextScroller";
|
8
|
+
public static var classRef:Function = TextScroller;
|
9
|
+
private var eventSrc:EventSource;
|
10
|
+
private var upArrow:ScrollArrow;
|
11
|
+
private var downArrow:ScrollArrow;
|
12
|
+
private var handle:ScrollHandle;
|
13
|
+
private var textSrc:TextField;
|
14
|
+
private var intervalId:Number;
|
15
|
+
private var controller:ScrollListener;
|
16
|
+
private var useHandCursor:Boolean = false;
|
17
|
+
private var handleMinHeight:Number = 20;
|
18
|
+
|
19
|
+
public function TextScroller() {
|
20
|
+
init();
|
21
|
+
}
|
22
|
+
|
23
|
+
public function init():Void {
|
24
|
+
eventSrc = new EventSource();
|
25
|
+
createAssets();
|
26
|
+
}
|
27
|
+
|
28
|
+
public function createAssets():Void {
|
29
|
+
var initObj:Object = new Object();
|
30
|
+
initObj.controller = this;
|
31
|
+
initObj.width = width;
|
32
|
+
initObj.height = width;
|
33
|
+
initObj._rotation = 180;
|
34
|
+
initObj._y = width;
|
35
|
+
initObj._x = width;
|
36
|
+
upArrow = ScrollArrow(attachMovie(ScrollArrow.linkageId, "upArrow", 3, initObj));
|
37
|
+
|
38
|
+
initObj._x = 0;
|
39
|
+
initObj._y = height-width;
|
40
|
+
initObj._rotation = 0;
|
41
|
+
downArrow = ScrollArrow(attachMovie(ScrollArrow.linkageId, "downArrow", 4, initObj));
|
42
|
+
|
43
|
+
initObj = new Object();
|
44
|
+
initObj.controller = this;
|
45
|
+
initObj._x = 0;
|
46
|
+
initObj._y = downArrow._y - downArrow._height;
|
47
|
+
initObj.height = width;
|
48
|
+
initObj.width = width;
|
49
|
+
handle = ScrollHandle(attachMovie(ScrollHandle.linkageId, "handle", 2, initObj));
|
50
|
+
}
|
51
|
+
|
52
|
+
public function onLoad():Void {
|
53
|
+
textSrc = controller.getTextField();
|
54
|
+
textSrc.addListener(this);
|
55
|
+
refreshLayout();
|
56
|
+
}
|
57
|
+
|
58
|
+
public function onUnLoad():Void {
|
59
|
+
controller.removeListener(this);
|
60
|
+
}
|
61
|
+
|
62
|
+
public function onScroller():Void {
|
63
|
+
refreshHandle();
|
64
|
+
}
|
65
|
+
|
66
|
+
public function doScrollUp():Void {
|
67
|
+
textSrc.scroll -= 1;
|
68
|
+
}
|
69
|
+
|
70
|
+
public function doScrollDown():Void {
|
71
|
+
textSrc.scroll += 1;
|
72
|
+
}
|
73
|
+
|
74
|
+
public function scrollTo():Void {
|
75
|
+
}
|
76
|
+
|
77
|
+
public function onArrowPressed(ref:ScrollArrow):Void {
|
78
|
+
onArrowClicked(ref._name);
|
79
|
+
clearInterval(intervalId);
|
80
|
+
intervalId = setInterval(this, "onArrowClicked", 300, ref._name);
|
81
|
+
}
|
82
|
+
|
83
|
+
public function onArrowClicked(arrowName:String):Void {
|
84
|
+
if(intervalId != undefined) {
|
85
|
+
clearInterval(intervalId);
|
86
|
+
intervalId = setInterval(this, "onArrowClicked", 5, arrowName);
|
87
|
+
}
|
88
|
+
|
89
|
+
if(arrowName == "upArrow") {
|
90
|
+
doScrollUp();
|
91
|
+
} else if(arrowName == "downArrow") {
|
92
|
+
doScrollDown();
|
93
|
+
}
|
94
|
+
refreshHandle();
|
95
|
+
}
|
96
|
+
|
97
|
+
public function onArrowReleased(ref:ScrollArrow):Void {
|
98
|
+
clearInterval(intervalId);
|
99
|
+
delete intervalId;
|
100
|
+
}
|
101
|
+
|
102
|
+
public function onScrollHandlePressed():Void {
|
103
|
+
textSrc.removeListener(this);
|
104
|
+
}
|
105
|
+
|
106
|
+
public function onScrollHandleReleased():Void {
|
107
|
+
textSrc.addListener(this);
|
108
|
+
}
|
109
|
+
|
110
|
+
public function onScrollHandleMoved():Void {
|
111
|
+
var amt:Number = handle._y - upArrow._y;
|
112
|
+
var total:Number = getHandleTravel() - upArrow._y;
|
113
|
+
var perc:Number = amt/total;
|
114
|
+
var scr:Number = (textSrc.maxscroll)*perc;
|
115
|
+
textSrc.scroll = scr;
|
116
|
+
}
|
117
|
+
|
118
|
+
public function addEventListener(event:String, observer:Object, scope:Object):Void {
|
119
|
+
eventSrc.addEventListener(event, observer, scope);
|
120
|
+
}
|
121
|
+
|
122
|
+
public function addListener(observer:Object, scope:Object):Void {
|
123
|
+
eventSrc.addListener(observer, scope);
|
124
|
+
}
|
125
|
+
|
126
|
+
public function removeEventListener(event:String, observer:Object):Boolean {
|
127
|
+
return eventSrc.removeEventListener(event, observer);
|
128
|
+
}
|
129
|
+
|
130
|
+
public function removeListener(observer:Object):Boolean {
|
131
|
+
return eventSrc.removeListener(observer);
|
132
|
+
}
|
133
|
+
|
134
|
+
public function refreshLayout():Void {
|
135
|
+
super.refreshLayout();
|
136
|
+
downArrow._y = height - width;
|
137
|
+
refreshHandle();
|
138
|
+
}
|
139
|
+
|
140
|
+
public function getHandleTravel():Number {
|
141
|
+
return height - (upArrow._height + handle._height);
|
142
|
+
}
|
143
|
+
|
144
|
+
public function refreshHandle():Void {
|
145
|
+
var scroll:Number = textSrc.scroll;
|
146
|
+
var bottomScroll:Number = textSrc.bottomScroll;
|
147
|
+
var tMaxscroll:Number = textSrc.maxscroll;
|
148
|
+
|
149
|
+
var amt:Number = bottomScroll-scroll;
|
150
|
+
var total:Number = tMaxscroll + amt;
|
151
|
+
var perc:Number = amt / total;
|
152
|
+
|
153
|
+
var availHeight = height - (upArrow.height*2);
|
154
|
+
handle._height = Math.min(availHeight, Math.max(handleMinHeight, Math.floor(availHeight*perc)));
|
155
|
+
|
156
|
+
var travel:Number = getHandleTravel();
|
157
|
+
perc = scroll / tMaxscroll;
|
158
|
+
var y:Number = Math.round((travel*perc));
|
159
|
+
handle._y = Math.max(upArrow._y, y);
|
160
|
+
}
|
161
|
+
|
162
|
+
public function setHeight(num:Number):Number {
|
163
|
+
height = Math.round(num);
|
164
|
+
refreshLayout();
|
165
|
+
return height;
|
166
|
+
}
|
167
|
+
|
168
|
+
public static var serializable:Boolean = Object.registerClass(linkageId, classRef);
|
169
|
+
}
|