flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [3/4] git commit: [flex-asjs] [refs/heads/develop] - rename Sprite to SimpleApplication and create AS version
Date Fri, 21 Aug 2015 14:19:04 GMT
rename Sprite to SimpleApplication and create AS version


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f2777f4b
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f2777f4b
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f2777f4b

Branch: refs/heads/develop
Commit: f2777f4ba400385b37c59153bd9da7d1d63abef8
Parents: 47c9433
Author: Alex Harui <aharui@apache.org>
Authored: Thu Aug 20 18:07:16 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Aug 20 18:07:16 2015 -0700

----------------------------------------------------------------------
 frameworks/projects/Core/as/src/CoreClasses.as  |  1 +
 .../org/apache/flex/core/SimpleApplication.as   | 89 ++++++++++++++++++++
 .../Core/js/src/flash/display/Sprite.js         | 40 ---------
 .../org/apache/flex/core/SimpleApplication.js   | 49 +++++++++++
 4 files changed, 139 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2777f4b/frameworks/projects/Core/as/src/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/CoreClasses.as b/frameworks/projects/Core/as/src/CoreClasses.as
index ba8f22f..9e07c85 100644
--- a/frameworks/projects/Core/as/src/CoreClasses.as
+++ b/frameworks/projects/Core/as/src/CoreClasses.as
@@ -72,6 +72,7 @@ internal class CoreClasses
 	import org.apache.flex.core.IViewportModel; IViewportModel;
 	import org.apache.flex.core.IViewportScroller; IViewportScroller;
     import org.apache.flex.core.SimpleStatesImpl; SimpleStatesImpl;
+    import org.apache.flex.core.SimpleApplication; SimpleApplication;
     import org.apache.flex.core.DataBindingBase; DataBindingBase;
     import org.apache.flex.core.UIBase; UIBase;
     import org.apache.flex.core.UIButtonBase; UIButtonBase;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2777f4b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as
new file mode 100644
index 0000000..434b0b1
--- /dev/null
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as
@@ -0,0 +1,89 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.core
+{
+    import flash.display.DisplayObject;
+    import flash.display.Sprite;
+    import flash.display.StageAlign;
+    import flash.display.StageQuality;
+    import flash.display.StageScaleMode;
+    import flash.events.Event;
+    import flash.system.ApplicationDomain;
+    import flash.utils.getQualifiedClassName;
+    
+    import org.apache.flex.events.Event;
+    import org.apache.flex.events.IEventDispatcher;
+    import org.apache.flex.events.MouseEvent;
+    import org.apache.flex.events.utils.MouseEventConverter;
+    import org.apache.flex.utils.MXMLDataInterpreter;
+    
+    /**
+     *  The SimpleApplication class can be used as the main class and entry point
+     *  for low-level ActionScript-only FlexJS
+     *  applications.  It is not indended for use in MXML applications or most
+     *  of the FlexJS components as they expect a certain application lifecycle
+     *  in the org.apache.flex.core.Application class.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    public class SimpleApplication extends Sprite
+    {
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function SimpleApplication()
+        {
+            super();
+			if (stage)
+			{
+				stage.align = StageAlign.TOP_LEFT;
+				stage.scaleMode = StageScaleMode.NO_SCALE;
+                // should be opt-in
+				//stage.quality = StageQuality.HIGH_16X16_LINEAR;                
+			}
+			
+            loaderInfo.addEventListener(flash.events.Event.INIT, initHandler);
+        }
+        
+        private function initHandler(event:flash.events.Event):void
+        {
+			start();
+        }
+        
+        /**
+         *  The entry point.  Override this and put all of your code in here.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function start():void
+		{
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2777f4b/frameworks/projects/Core/js/src/flash/display/Sprite.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/flash/display/Sprite.js b/frameworks/projects/Core/js/src/flash/display/Sprite.js
deleted file mode 100644
index 968480b..0000000
--- a/frameworks/projects/Core/js/src/flash/display/Sprite.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-goog.provide('flash.display.Sprite');
-
-
-
-/**
- * @constructor
- */
-flash.display.Sprite = function() {
-};
-
-
-/**
- * Metadata
- *
- * @type {Object.<string, Array.<Object>>}
- */
-flash.display.Sprite.prototype.FLEXJS_CLASS_INFO =
-    { names: [{ name: 'Sprite',
-                qName: 'flash.display.Sprite' }] };
-
-
-/**
- * @export
- */
-flash.display.Sprite.prototype.start = function() {
-};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2777f4b/frameworks/projects/Core/js/src/org/apache/flex/core/SimpleApplication.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/SimpleApplication.js b/frameworks/projects/Core/js/src/org/apache/flex/core/SimpleApplication.js
new file mode 100644
index 0000000..545355f
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/SimpleApplication.js
@@ -0,0 +1,49 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+goog.provide('org.apache.flex.core.SimpleApplication');
+
+goog.require('org.apache.flex.core.HTMLElementWrapper');
+
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.HTMLElementWrapper}
+ */
+org.apache.flex.core.SimpleApplication = function() {
+  org.apache.flex.core.SimpleApplication.base(this, 'constructor');
+};
+goog.inherits(org.apache.flex.core.SimpleApplication,
+    org.apache.flex.core.HTMLElementWrapper);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.core.SimpleApplication.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'SimpleApplication',
+                qName: 'org.apache.flex.core.SimpleApplication' }] };
+
+
+/**
+ * @export
+ */
+org.apache.flex.core.SimpleApplication.prototype.start = function() {
+  this.element = document.getElementsByTagName('body')[0];
+  this.element.flexjs_wrapper = this;
+  this.element.className = 'SimpleApplication';
+};


Mime
View raw message