You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2016/11/05 07:47:04 UTC
[20/50] [abbrv] git commit: [flex-asjs]
[refs/heads/feature-autobuild/closure-classpath-sources] - move ContainerBase
Graphics classes
move ContainerBase Graphics classes
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/6fee345f
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/6fee345f
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/6fee345f
Branch: refs/heads/feature-autobuild/closure-classpath-sources
Commit: 6fee345f119756d032d3ce36911e13f8f80cb368
Parents: f241391
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 27 22:13:22 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Nov 1 07:46:53 2016 -0700
----------------------------------------------------------------------
.../main/flex/org/apache/flex/svg/DOMWrapper.as | 56 -----
.../org/apache/flex/svg/GraphicContainer.as | 209 -------------------
.../main/flex/org/apache/flex/svg/DOMWrapper.as | 56 +++++
.../org/apache/flex/svg/GraphicContainer.as | 209 +++++++++++++++++++
4 files changed, 265 insertions(+), 265 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6fee345f/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/DOMWrapper.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/DOMWrapper.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/DOMWrapper.as
deleted file mode 100644
index 7bb20ff..0000000
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/DOMWrapper.as
+++ /dev/null
@@ -1,56 +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.
- */
-
-package org.apache.flex.svg
-{
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- import org.apache.flex.core.ContainerBase;
-
- public class DOMWrapper extends ContainerBase
- {
-
- /**
- * Constructor
- *
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- public function DOMWrapper()
- {
- super();
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject') as WrappedHTMLElement;
- element.flexjs_wrapper = this;
- element.style.left = 0;
- element.style.top = 0;
- //element.offsetParent = null;
- positioner = element;
- positioner.style.position = 'relative';
-
- return element;
- }
-
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6fee345f/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
deleted file mode 100644
index 709d6ea..0000000
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
+++ /dev/null
@@ -1,209 +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.
- */
-package org.apache.flex.svg
-{
- import org.apache.flex.core.ContainerBase;
- import org.apache.flex.core.IChild;
- import org.apache.flex.core.IFlexJSElement;
- import org.apache.flex.core.ITransformHost;
-
- COMPILE::JS
- {
- import org.apache.flex.core.IContainer;
- import org.apache.flex.core.UIBase;
- }
-
- [DefaultProperty("mxmlContent")]
-
- COMPILE::SWF
- public class GraphicContainer extends ContainerBase implements ITransformHost
- {
- public function GraphicContainer()
- {
- super();
- }
-
- }
-
- COMPILE::JS
- public class GraphicContainer extends UIBase implements ITransformHost, IContainer
- {
- private var graphicGroup:ContainerBase;
-
- public function GraphicContainer()
- {
- super();
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- override protected function createElement():org.apache.flex.core.WrappedHTMLElement
- {
- element = document.createElementNS('http://www.w3.org/2000/svg', 'svg') as org.apache.flex.core.WrappedHTMLElement;
-
- positioner = element;
-
- // absolute positioned children need a non-null
- // position value in the parent. It might
- // get set to 'absolute' if the container is
- // also absolutely positioned
- positioner.style.position = 'relative';
- element.flexjs_wrapper = this;
-
- graphicGroup = new GraphicGroup();
- super.addElement(graphicGroup);
- return element;
- }
-
- COMPILE::JS
- override protected function setClassName(value:String):void
- {
- element.setAttribute('class', value);
- }
-
- override public function get transformElement():org.apache.flex.core.WrappedHTMLElement
- {
- return graphicGroup.element;
- }
-
- /**
- * @copy org.apache.flex.core.IParent#getElementAt()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function getElementAt(index:int):IChild
- {
- return graphicGroup.getElementAt(index);
- }
-
- /**
- * @copy org.apache.flex.core.IParent#addElement()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function addElement(c:IChild, dispatchEvent:Boolean = true):void
- {
- graphicGroup.addElement(c, dispatchEvent);
- if (dispatchEvent)
- this.dispatchEvent(new Event("childrenAdded"));
- }
-
- /**
- * @copy org.apache.flex.core.IParent#addElementAt()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
- {
- graphicGroup.addElementAt(c, index, dispatchEvent);
- if (dispatchEvent)
- this.dispatchEvent(new Event("childrenAdded"));
- }
-
- /**
- * @copy org.apache.flex.core.IParent#removeElement()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function removeElement(c:IChild, dispatchEvent:Boolean = true):void
- {
- graphicGroup.removeElement(c, dispatchEvent);
- if (dispatchEvent)
- this.dispatchEvent(new Event("childrenRemoved"));
- }
-
- /**
- * @copy org.apache.flex.core.IContainer#childrenAdded()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function childrenAdded():void
- {
- dispatchEvent(new Event("childrenAdded"));
- }
-
- /**
- * @copy org.apache.flex.core.IParent#getElementIndex()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function getElementIndex(c:IChild):int
- {
- return graphicGroup.getElementIndex(c);
- }
-
-
- /**
- * The number of elements in the parent.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function get numElements():int
- {
- return graphicGroup.numElements;
- }
- }
-}
-
-import org.apache.flex.core.ContainerBase;
-
-class GraphicGroup extends ContainerBase
-{
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():org.apache.flex.core.WrappedHTMLElement
- {
- element = document.createElementNS('http://www.w3.org/2000/svg', 'g') as org.apache.flex.core.WrappedHTMLElement;
-
- positioner = element;
-
- // absolute positioned children need a non-null
- // position value in the parent. It might
- // get set to 'absolute' if the container is
- // also absolutely positioned
- positioner.style.position = 'relative';
- element.flexjs_wrapper = this;
-
- /*addEventListener('childrenAdded',
- runLayoutHandler);
- addEventListener('elementRemoved',
- runLayoutHandler);*/
-
- return element;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6fee345f/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/DOMWrapper.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/DOMWrapper.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/DOMWrapper.as
new file mode 100644
index 0000000..7bb20ff
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/DOMWrapper.as
@@ -0,0 +1,56 @@
+/**
+ * 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.
+ */
+
+package org.apache.flex.svg
+{
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ import org.apache.flex.core.ContainerBase;
+
+ public class DOMWrapper extends ContainerBase
+ {
+
+ /**
+ * Constructor
+ *
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ public function DOMWrapper()
+ {
+ super();
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject') as WrappedHTMLElement;
+ element.flexjs_wrapper = this;
+ element.style.left = 0;
+ element.style.top = 0;
+ //element.offsetParent = null;
+ positioner = element;
+ positioner.style.position = 'relative';
+
+ return element;
+ }
+
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6fee345f/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/GraphicContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/GraphicContainer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/GraphicContainer.as
new file mode 100644
index 0000000..709d6ea
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/GraphicContainer.as
@@ -0,0 +1,209 @@
+/**
+ * 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.
+ */
+package org.apache.flex.svg
+{
+ import org.apache.flex.core.ContainerBase;
+ import org.apache.flex.core.IChild;
+ import org.apache.flex.core.IFlexJSElement;
+ import org.apache.flex.core.ITransformHost;
+
+ COMPILE::JS
+ {
+ import org.apache.flex.core.IContainer;
+ import org.apache.flex.core.UIBase;
+ }
+
+ [DefaultProperty("mxmlContent")]
+
+ COMPILE::SWF
+ public class GraphicContainer extends ContainerBase implements ITransformHost
+ {
+ public function GraphicContainer()
+ {
+ super();
+ }
+
+ }
+
+ COMPILE::JS
+ public class GraphicContainer extends UIBase implements ITransformHost, IContainer
+ {
+ private var graphicGroup:ContainerBase;
+
+ public function GraphicContainer()
+ {
+ super();
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ override protected function createElement():org.apache.flex.core.WrappedHTMLElement
+ {
+ element = document.createElementNS('http://www.w3.org/2000/svg', 'svg') as org.apache.flex.core.WrappedHTMLElement;
+
+ positioner = element;
+
+ // absolute positioned children need a non-null
+ // position value in the parent. It might
+ // get set to 'absolute' if the container is
+ // also absolutely positioned
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ graphicGroup = new GraphicGroup();
+ super.addElement(graphicGroup);
+ return element;
+ }
+
+ COMPILE::JS
+ override protected function setClassName(value:String):void
+ {
+ element.setAttribute('class', value);
+ }
+
+ override public function get transformElement():org.apache.flex.core.WrappedHTMLElement
+ {
+ return graphicGroup.element;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IParent#getElementAt()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function getElementAt(index:int):IChild
+ {
+ return graphicGroup.getElementAt(index);
+ }
+
+ /**
+ * @copy org.apache.flex.core.IParent#addElement()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function addElement(c:IChild, dispatchEvent:Boolean = true):void
+ {
+ graphicGroup.addElement(c, dispatchEvent);
+ if (dispatchEvent)
+ this.dispatchEvent(new Event("childrenAdded"));
+ }
+
+ /**
+ * @copy org.apache.flex.core.IParent#addElementAt()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
+ {
+ graphicGroup.addElementAt(c, index, dispatchEvent);
+ if (dispatchEvent)
+ this.dispatchEvent(new Event("childrenAdded"));
+ }
+
+ /**
+ * @copy org.apache.flex.core.IParent#removeElement()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function removeElement(c:IChild, dispatchEvent:Boolean = true):void
+ {
+ graphicGroup.removeElement(c, dispatchEvent);
+ if (dispatchEvent)
+ this.dispatchEvent(new Event("childrenRemoved"));
+ }
+
+ /**
+ * @copy org.apache.flex.core.IContainer#childrenAdded()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function childrenAdded():void
+ {
+ dispatchEvent(new Event("childrenAdded"));
+ }
+
+ /**
+ * @copy org.apache.flex.core.IParent#getElementIndex()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function getElementIndex(c:IChild):int
+ {
+ return graphicGroup.getElementIndex(c);
+ }
+
+
+ /**
+ * The number of elements in the parent.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function get numElements():int
+ {
+ return graphicGroup.numElements;
+ }
+ }
+}
+
+import org.apache.flex.core.ContainerBase;
+
+class GraphicGroup extends ContainerBase
+{
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():org.apache.flex.core.WrappedHTMLElement
+ {
+ element = document.createElementNS('http://www.w3.org/2000/svg', 'g') as org.apache.flex.core.WrappedHTMLElement;
+
+ positioner = element;
+
+ // absolute positioned children need a non-null
+ // position value in the parent. It might
+ // get set to 'absolute' if the container is
+ // also absolutely positioned
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ /*addEventListener('childrenAdded',
+ runLayoutHandler);
+ addEventListener('elementRemoved',
+ runLayoutHandler);*/
+
+ return element;
+ }
+}
\ No newline at end of file