asproject 0.1.92 → 0.1.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/asclass_arguments.rb +1 -1
- data/lib/asproject.rb +3 -1
- data/lib/asproject/version.rb +1 -1
- data/lib/asproject_arguments.rb +5 -5
- data/lib/path_finder.rb +17 -7
- data/lib/tasks/asunit.rb +8 -0
- data/lib/tasks/flash_log.rb +2 -1
- data/lib/tasks/flash_player.rb +10 -6
- data/lib/tasks/mxmlc.rb +13 -2
- data/lib/tasks/remote_file_loader.rb +144 -0
- data/lib/tasks/remote_file_task.rb +2 -128
- data/lib/tasks/remote_library_task.rb +75 -0
- data/templates/asclass/as2/Class.as +1 -1
- data/templates/asproject/as2/{art → assets}/.crap_file +0 -0
- data/templates/asproject/as2/project/rakefile.rb +3 -2
- data/templates/asproject/as3/{art → assets}/.crap_file +0 -0
- data/templates/asproject/as3/project/rakefile.rb +3 -3
- data/templates/asproject/fdt/project/.as2_classpath +1 -1
- metadata +9 -129
- data/templates/asproject/asunit2/project/lib/asunit/AsUnitUi.swf +0 -0
- data/templates/asproject/asunit2/project/lib/asunit/Sys.as +0 -70
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanel.as +0 -182
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTest.as +0 -84
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTextArea.as +0 -111
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTextAreaTest.as +0 -26
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTitleBar.as +0 -81
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/ResizeHandle.as +0 -35
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/ScrollArrow.as +0 -34
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/ScrollHandle.as +0 -43
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/ScrollListener.as +0 -10
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/TextScroller.as +0 -169
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/shapes/Rectangle.as +0 -29
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/shapes/Triangle.as +0 -27
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/AsUnit.as +0 -19
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/Assert.as +0 -408
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/Assertion.as +0 -27
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/Reflection.as +0 -68
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/Test.as +0 -3
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestCase.as +0 -191
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestCaseXml.as +0 -31
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestFailure.as +0 -15
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestResult.as +0 -15
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestRunner.as +0 -41
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestSetup.as +0 -19
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/framework/TestSuite.as +0 -22
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/ui/Main.as +0 -325
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/ui/RemoteVersion.as +0 -24
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/ui/SuccessMeter.as +0 -32
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/Comparable.as +0 -7
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/EventListener.as +0 -29
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/EventSource.as +0 -89
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/LocalConnClient.as +0 -42
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/LocalConnGateway.as +0 -47
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/LocalConnServer.as +0 -61
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/LocalMessageBroker.as +0 -58
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/Observable.as +0 -11
- data/templates/asproject/asunit2/project/lib/asunit/com/asunit/util/TextFile.as +0 -30
- data/templates/asproject/asunit25/project/lib/asunit/AsUnitTestRunner.as +0 -13
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/AssertionFailedError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/AssertionPassedError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/ClassNotFoundError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/IllegalOperationError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/InstanceNotFoundError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/InvocationTargetError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/errors/UnimplementedFeatureError.as +0 -7
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/Assert.as +0 -376
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/AssertMock.as +0 -15
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/AssertTest.as +0 -59
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/ITestListener.as +0 -13
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/Test.as +0 -11
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestCase.as +0 -278
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestCaseMock.as +0 -23
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestCaseTest.as +0 -29
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestCaseXml.as +0 -38
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestFailure.as +0 -47
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestResult.as +0 -168
- data/templates/asproject/asunit25/project/lib/asunit/asunit/framework/TestSuite.as +0 -102
- data/templates/asproject/asunit25/project/lib/asunit/asunit/runner/BaseTestRunner.as +0 -101
- data/templates/asproject/asunit25/project/lib/asunit/asunit/runner/IResultPrinter.as +0 -8
- data/templates/asproject/asunit25/project/lib/asunit/asunit/textui/ResultPrinter.as +0 -254
- data/templates/asproject/asunit25/project/lib/asunit/asunit/textui/SuccessBar.as +0 -41
- data/templates/asproject/asunit25/project/lib/asunit/asunit/textui/TestRunner.as +0 -17
- data/templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIterator.as +0 -24
- data/templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as +0 -52
- data/templates/asproject/asunit25/project/lib/asunit/asunit/util/Iterator.as +0 -5
- data/templates/asproject/asunit3/project/lib/asunit/AsUnitTestRunner.as +0 -10
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/AbstractMemberCalledError.as +0 -10
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/AssertionFailedError.as +0 -10
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/ClassNotFoundError.as +0 -10
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/InstanceNotFoundError.as +0 -10
- data/templates/asproject/asunit3/project/lib/asunit/asunit/errors/UnimplementedFeatureError.as +0 -10
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/Assert.as +0 -271
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/AsynchronousTestCase.as +0 -52
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/AsynchronousTestCaseExample.as +0 -71
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/Test.as +0 -15
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestCase.as +0 -354
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestCaseExample.as +0 -73
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestFailure.as +0 -47
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestListener.as +0 -22
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestResult.as +0 -158
- data/templates/asproject/asunit3/project/lib/asunit/asunit/framework/TestSuite.as +0 -115
- data/templates/asproject/asunit3/project/lib/asunit/asunit/runner/BaseTestRunner.as +0 -15
- data/templates/asproject/asunit3/project/lib/asunit/asunit/runner/TestSuiteLoader.as +0 -9
- data/templates/asproject/asunit3/project/lib/asunit/asunit/runner/Version.as +0 -11
- data/templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexRunner.as +0 -19
- data/templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as +0 -55
- data/templates/asproject/asunit3/project/lib/asunit/asunit/textui/ResultPrinter.as +0 -245
- data/templates/asproject/asunit3/project/lib/asunit/asunit/textui/TestRunner.as +0 -121
- data/templates/asproject/asunit3/project/lib/asunit/asunit/util/ArrayIterator.as +0 -26
- data/templates/asproject/asunit3/project/lib/asunit/asunit/util/Iterator.as +0 -9
- data/templates/asproject/asunit3/project/lib/asunit/asunit/util/Properties.as +0 -30
data/templates/asproject/asunit2/project/lib/asunit/com/asunit/controls/LocalOutputPanelTest.as
DELETED
@@ -1,84 +0,0 @@
|
|
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
DELETED
@@ -1,111 +0,0 @@
|
|
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
|
-
}
|
@@ -1,26 +0,0 @@
|
|
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
DELETED
@@ -1,81 +0,0 @@
|
|
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
|
-
}
|
@@ -1,35 +0,0 @@
|
|
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
|
-
}
|
@@ -1,34 +0,0 @@
|
|
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
|
-
}
|
@@ -1,43 +0,0 @@
|
|
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
|
-
}
|
@@ -1,10 +0,0 @@
|
|
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
|
-
}
|
@@ -1,169 +0,0 @@
|
|
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
|
-
}
|