You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2019/09/10 00:22:18 UTC
[royale-asjs] 03/03: changes to get build to succeed in js-only
release package
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch release/0.9.6
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 9af15b6a5d69e5f8c4ecf62ad90ccaf435f128c1
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Sep 9 17:21:56 2019 -0700
changes to get build to succeed in js-only release package
---
.../src/main/config/compile-app-config.xml | 2 +
examples/crux/CruxQuickStartBasic/build.xml | 1 +
.../src/main/config/compile-app-config.xml | 14 -
examples/royale/ASDoc/build.xml | 13 +-
.../org/apache/royale/html/beads/SpinnerView.as | 416 +++++++++---------
.../royale/html/supportClasses/DropDownListList.as | 125 +++---
.../org/apache/royale/graphics/GradientBase.as | 469 +++++++++++----------
.../org/apache/royale/graphics/beads/BlendBead.as | 284 ++++++-------
8 files changed, 663 insertions(+), 661 deletions(-)
diff --git a/examples/crux/CruxGitHubCommitLogViewer/src/main/config/compile-app-config.xml b/examples/crux/CruxGitHubCommitLogViewer/src/main/config/compile-app-config.xml
index 32bf453..84451ba 100644
--- a/examples/crux/CruxGitHubCommitLogViewer/src/main/config/compile-app-config.xml
+++ b/examples/crux/CruxGitHubCommitLogViewer/src/main/config/compile-app-config.xml
@@ -51,11 +51,13 @@
<path-element>../../../../../../frameworks/js/libs/CruxJS.swc</path-element>
<path-element>../../../../../../frameworks/js/libs/MXRoyaleJS.swc</path-element>
</js-library-path>
+ <!--
<library-path append="true">
<path-element>../../../../../../frameworks/libs/Basic.swc</path-element>
<path-element>../../../../../../frameworks/libs/Crux.swc</path-element>
<path-element>../../../../../../frameworks/libs/MXRoyale.swc</path-element>
</library-path>
+ -->
<exclude-defaults-css-files>
<filename>MXRoyaleJS.swc:defaults.css</filename>
</exclude-defaults-css-files>
diff --git a/examples/crux/CruxQuickStartBasic/build.xml b/examples/crux/CruxQuickStartBasic/build.xml
index 60ff56d..7ee968b 100644
--- a/examples/crux/CruxQuickStartBasic/build.xml
+++ b/examples/crux/CruxQuickStartBasic/build.xml
@@ -27,6 +27,7 @@
<property environment="env"/>
<property file="${ROYALE_HOME}/build.properties"/>
<property name="ROYALE_HOME" value="${ROYALE_HOME}"/>
+ <property name="config_arg" value="flex" />
<include file="${basedir}/../../build_example.xml" />
diff --git a/examples/crux/CruxQuickStartBasic/src/main/config/compile-app-config.xml b/examples/crux/CruxQuickStartBasic/src/main/config/compile-app-config.xml
index 6505430..c04394d 100644
--- a/examples/crux/CruxQuickStartBasic/src/main/config/compile-app-config.xml
+++ b/examples/crux/CruxQuickStartBasic/src/main/config/compile-app-config.xml
@@ -23,10 +23,6 @@
<js-default-initializers>true</js-default-initializers>
<compiler>
- <targets>
- <target>JSRoyale</target>
- <target>SWF</target>
- </targets>
<keep-as3-metadata>
<name>Bindable</name>
<name>Transient</name>
@@ -43,16 +39,6 @@
<name>Inject</name>
</keep-code-with-metadata>
- <js-library-path append="true">
- <path-element>../../../../../../frameworks/js/libs/BasicJS.swc</path-element>
- <path-element>../../../../../../frameworks/js/libs/CruxJS.swc</path-element>
- <path-element>../../../../../../frameworks/js/libs/MXRoyaleJS.swc</path-element>
- </js-library-path>
- <library-path append="true">
- <path-element>../../../../../../frameworks/libs/Basic.swc</path-element>
- <path-element>../../../../../../frameworks/libs/Crux.swc</path-element>
- <path-element>../../../../../../frameworks/libs/MXRoyale.swc</path-element>
- </library-path>
<exclude-defaults-css-files>
<filename>MXRoyaleJS.swc:defaults.css</filename>
</exclude-defaults-css-files>
diff --git a/examples/royale/ASDoc/build.xml b/examples/royale/ASDoc/build.xml
index a33a27b..c06a61e 100644
--- a/examples/royale/ASDoc/build.xml
+++ b/examples/royale/ASDoc/build.xml
@@ -116,7 +116,18 @@
</fail>
</target>
- <target name="json.swf" unless="json.exists" >
+ <target name="check.swf.needed">
+ <condition property="swf.json.needed" value="true">
+ <and>
+ <not>
+ <isset property="json.exists" />
+ </not>
+ <isset property="env.AIR_HOME" />
+ </and>
+ </condition>
+ </target>
+
+ <target name="json.swf" depends="check.swf.needed" if="swf.json.needed" >
<echo message="ROYALE_COMPILER_HOME: ${ROYALE_COMPILER_HOME}"/>
<java jar="${ROYALE_COMPILER_HOME}/lib/asdoc.jar" resultProperty="errorCodeSWF"
fork="true">
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/SpinnerView.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/SpinnerView.as
index a4290c4..2e5d5e8 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/SpinnerView.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/SpinnerView.as
@@ -1,208 +1,208 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// 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.royale.html.beads
-{
-COMPILE::SWF {
- import flash.display.DisplayObject;
-}
-
- import org.apache.royale.core.BeadViewBase;
- import org.apache.royale.core.IBeadModel;
- import org.apache.royale.core.IBeadView;
- import org.apache.royale.core.IRangeModel;
- import org.apache.royale.core.IStrand;
- import org.apache.royale.core.ILayoutChild;
- import org.apache.royale.core.UIBase;
- import org.apache.royale.events.Event;
- import org.apache.royale.events.IEventDispatcher;
- import org.apache.royale.html.Button;
- import org.apache.royale.html.beads.controllers.ButtonAutoRepeatController;
-
-COMPILE::JS {
- import org.apache.royale.html.beads.controllers.SpinnerMouseController;
- import org.apache.royale.html.supportClasses.SpinnerButton;
-}
-
- /**
- * The SpinnerView class creates the visual elements of the org.apache.royale.html.Spinner
- * component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.0
- */
- public class SpinnerView extends BeadViewBase implements ISpinnerView, IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.0
- */
- public function SpinnerView()
- {
- }
-
- private var rangeModel:IRangeModel;
-
- COMPILE::JS {
- public var _increment:SpinnerButton;
- public var _decrement:SpinnerButton;
- private var controller:SpinnerMouseController;
- }
-
- COMPILE::SWF {
- private var _decrement:DisplayObject;
- private var _increment:DisplayObject;
- }
-
- /**
- * @copy org.apache.royale.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.9
- * @royaleignorecoercion org.apache.royale.core.UIBase
- * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
-
- COMPILE::SWF {
- _increment = new Button();
- Button(_increment).addBead(new UpArrowButtonView());
- Button(_increment).addBead(new ButtonAutoRepeatController());
- _decrement = new Button();
- Button(_decrement).addBead(new DownArrowButtonView());
- Button(_decrement).addBead(new ButtonAutoRepeatController());
-
- Button(_increment).x = 0;
- Button(_increment).y = 0;
- Button(_decrement).x = 0;
- Button(_decrement).y = Button(_increment).height;
-
- UIBase(_strand).$sprite_addChild(_decrement);
- UIBase(_strand).$sprite_addChild(_increment);
- rangeModel = _strand.getBeadByType(IBeadModel) as IRangeModel;
- }
- IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
- IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
- COMPILE::JS {
- var host:UIBase = value as UIBase;
- // depending on the surrounding layout, the element can be offset without this.
- host.element.style.position = "absolute";
-
- _increment = new SpinnerButton();
- _increment.text = '\u25B2';
- _increment.positioner.style.display = 'block';
-
- _decrement = new SpinnerButton();
- _decrement.text = '\u25BC';
- _decrement.positioner.style.display = 'block';
- host.addElement(_increment);
- host.addElement(_decrement);
-
-// add this in CSS!
- controller = new SpinnerMouseController();
- host.addBead(controller);
- }
-
- COMPILE::SWF
- {
- var host:ILayoutChild = ILayoutChild(value);
-
- // Complete the setup if the height is sized to content or has been explicitly set
- // and the width is sized to content or has been explicitly set
- if ((host.isHeightSizedToContent() || !isNaN(host.explicitHeight)) &&
- (host.isWidthSizedToContent() || !isNaN(host.explicitWidth)))
- sizeChangeHandler(null);
- }
- COMPILE::JS
- {
- // always run size change since there are no size change events
- sizeChangeHandler(null);
- }
- }
-
- /**
- * The component for decrementing the org.apache.royale.html.Spinner value.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.0
- */
- COMPILE::SWF
- public function get decrement():DisplayObject
- {
- return _decrement;
- }
- COMPILE::JS
- public function get decrement():SpinnerButton
- {
- return _decrement;
- }
-
- /**
- * The component for incrementing the org.apache.royale.html.Spinner value.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.0
- */
- COMPILE::SWF
- public function get increment():DisplayObject
- {
- return _increment;
- }
- COMPILE::JS
- public function get increment():SpinnerButton
- {
- return _increment;
- }
-
- /**
- * @private
- * @royaleignorecoercion org.apache.royale.core.UIBase
- */
- private function sizeChangeHandler( event:Event ) : void
- {
- var w:Number = UIBase(_strand).width;
- var h:Number = UIBase(_strand).height / 2;
- _increment.width = w;
- _increment.height = h;
- COMPILE::SWF
- {
- _increment.y = 0;
- }
- _decrement.width = w;
- _decrement.height = h;
- COMPILE::SWF
- {
- _decrement.y = h;
- }
- }
- }
-}
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.royale.html.beads
+{
+COMPILE::SWF {
+ import flash.display.DisplayObject;
+ import org.apache.royale.html.beads.controllers.ButtonAutoRepeatController;
+}
+
+ import org.apache.royale.core.BeadViewBase;
+ import org.apache.royale.core.IBeadModel;
+ import org.apache.royale.core.IBeadView;
+ import org.apache.royale.core.IRangeModel;
+ import org.apache.royale.core.IStrand;
+ import org.apache.royale.core.ILayoutChild;
+ import org.apache.royale.core.UIBase;
+ import org.apache.royale.events.Event;
+ import org.apache.royale.events.IEventDispatcher;
+ import org.apache.royale.html.Button;
+
+COMPILE::JS {
+ import org.apache.royale.html.beads.controllers.SpinnerMouseController;
+ import org.apache.royale.html.supportClasses.SpinnerButton;
+}
+
+ /**
+ * The SpinnerView class creates the visual elements of the org.apache.royale.html.Spinner
+ * component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public class SpinnerView extends BeadViewBase implements ISpinnerView, IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function SpinnerView()
+ {
+ }
+
+ private var rangeModel:IRangeModel;
+
+ COMPILE::JS {
+ public var _increment:SpinnerButton;
+ public var _decrement:SpinnerButton;
+ private var controller:SpinnerMouseController;
+ }
+
+ COMPILE::SWF {
+ private var _decrement:DisplayObject;
+ private var _increment:DisplayObject;
+ }
+
+ /**
+ * @copy org.apache.royale.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9
+ * @royaleignorecoercion org.apache.royale.core.UIBase
+ * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ COMPILE::SWF {
+ _increment = new Button();
+ Button(_increment).addBead(new UpArrowButtonView());
+ Button(_increment).addBead(new ButtonAutoRepeatController());
+ _decrement = new Button();
+ Button(_decrement).addBead(new DownArrowButtonView());
+ Button(_decrement).addBead(new ButtonAutoRepeatController());
+
+ Button(_increment).x = 0;
+ Button(_increment).y = 0;
+ Button(_decrement).x = 0;
+ Button(_decrement).y = Button(_increment).height;
+
+ UIBase(_strand).$sprite_addChild(_decrement);
+ UIBase(_strand).$sprite_addChild(_increment);
+ rangeModel = _strand.getBeadByType(IBeadModel) as IRangeModel;
+ }
+ IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
+ COMPILE::JS {
+ var host:UIBase = value as UIBase;
+ // depending on the surrounding layout, the element can be offset without this.
+ host.element.style.position = "absolute";
+
+ _increment = new SpinnerButton();
+ _increment.text = '\u25B2';
+ _increment.positioner.style.display = 'block';
+
+ _decrement = new SpinnerButton();
+ _decrement.text = '\u25BC';
+ _decrement.positioner.style.display = 'block';
+ host.addElement(_increment);
+ host.addElement(_decrement);
+
+// add this in CSS!
+ controller = new SpinnerMouseController();
+ host.addBead(controller);
+ }
+
+ COMPILE::SWF
+ {
+ var host:ILayoutChild = ILayoutChild(value);
+
+ // Complete the setup if the height is sized to content or has been explicitly set
+ // and the width is sized to content or has been explicitly set
+ if ((host.isHeightSizedToContent() || !isNaN(host.explicitHeight)) &&
+ (host.isWidthSizedToContent() || !isNaN(host.explicitWidth)))
+ sizeChangeHandler(null);
+ }
+ COMPILE::JS
+ {
+ // always run size change since there are no size change events
+ sizeChangeHandler(null);
+ }
+ }
+
+ /**
+ * The component for decrementing the org.apache.royale.html.Spinner value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ COMPILE::SWF
+ public function get decrement():DisplayObject
+ {
+ return _decrement;
+ }
+ COMPILE::JS
+ public function get decrement():SpinnerButton
+ {
+ return _decrement;
+ }
+
+ /**
+ * The component for incrementing the org.apache.royale.html.Spinner value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ COMPILE::SWF
+ public function get increment():DisplayObject
+ {
+ return _increment;
+ }
+ COMPILE::JS
+ public function get increment():SpinnerButton
+ {
+ return _increment;
+ }
+
+ /**
+ * @private
+ * @royaleignorecoercion org.apache.royale.core.UIBase
+ */
+ private function sizeChangeHandler( event:Event ) : void
+ {
+ var w:Number = UIBase(_strand).width;
+ var h:Number = UIBase(_strand).height / 2;
+ _increment.width = w;
+ _increment.height = h;
+ COMPILE::SWF
+ {
+ _increment.y = 0;
+ }
+ _decrement.width = w;
+ _decrement.height = h;
+ COMPILE::SWF
+ {
+ _decrement.y = h;
+ }
+ }
+ }
+}
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/DropDownListList.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/DropDownListList.as
index 3b93ea8..3af0ce1 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/DropDownListList.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/DropDownListList.as
@@ -1,63 +1,62 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// 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.royale.html.supportClasses
-{
- import org.apache.royale.core.IPopUp;
- import org.apache.royale.html.SimpleList;
- import org.apache.royale.html.beads.SolidBackgroundBead;
-
- //--------------------------------------
- // Events
- //--------------------------------------
-
- /**
- * @copy org.apache.royale.core.ISelectionModel#change
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.0
- */
- [Event(name="change", type="org.apache.royale.events.Event")]
-
- /**
- * The DropDownListList class is the List class used internally
- * by DropDownList as the dropdown/popup.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.0
- */
- public class DropDownListList extends SimpleList implements IPopUp
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.0
- */
- public function DropDownListList()
- {
- super();
- }
- }
-}
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.royale.html.supportClasses
+{
+ import org.apache.royale.core.IPopUp;
+ import org.apache.royale.html.SimpleList;
+
+ //--------------------------------------
+ // Events
+ //--------------------------------------
+
+ /**
+ * @copy org.apache.royale.core.ISelectionModel#change
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ [Event(name="change", type="org.apache.royale.events.Event")]
+
+ /**
+ * The DropDownListList class is the List class used internally
+ * by DropDownList as the dropdown/popup.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public class DropDownListList extends SimpleList implements IPopUp
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function DropDownListList()
+ {
+ super();
+ }
+ }
+}
diff --git a/frameworks/projects/Graphics/src/main/royale/org/apache/royale/graphics/GradientBase.as b/frameworks/projects/Graphics/src/main/royale/org/apache/royale/graphics/GradientBase.as
index b1ac46f..3fb7914 100644
--- a/frameworks/projects/Graphics/src/main/royale/org/apache/royale/graphics/GradientBase.as
+++ b/frameworks/projects/Graphics/src/main/royale/org/apache/royale/graphics/GradientBase.as
@@ -1,233 +1,236 @@
-/*
- *
- * 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.royale.graphics
-{
- import org.apache.royale.graphics.utils.CompoundTransform;
-
- public class GradientBase
- {
-
- protected var colors:Array /* of uint */ = [];
-
- protected var ratios:Array /* of Number */ = [];
-
- protected var alphas:Array /* of Number */ = [];
-
- /**
- * Holds the matrix and the convenience transform properties (<code>x</code>, <code>y</code>, and <code>rotation</code>).
- * The compoundTransform is only created when the <code>matrix</code> property is set.
- *
- * @langversion 3.0
- * @playerversion Flash 9
- * @playerversion AIR 1.1
- */
- COMPILE::SWF
- protected var compoundTransform:CompoundTransform;
-
- /**
- * Value of the width and height of the untransformed gradient
- *
- * @langversion 3.0
- * @playerversion Flash 10
- * @playerversion AIR 1.5
- */
- public static const GRADIENT_DIMENSION:Number = 1638.4;
-
- /**
- * generate uid
- */
- public function get newId():String
- {
- return 'gradient' + Math.floor((Math.random() * 100000) + 1);
- }
-
- /**
- * Storage for the entries property.
- */
- private var _entries:Array = [];
-
- /**
- * @private
- * Storage for the rotation property.
- */
- private var _rotation:Number = 0.0;
-
- /**
- * An Array of GradientEntry objects
- * defining the fill patterns for the gradient fill.
- *
- */
- public function get entries():Array
- {
- return _entries;
- }
-
- /**
- * @private
- */
- public function set entries(value:Array):void
- {
- _entries = value;
- COMPILE::SWF
- {
- processEntries();
- }
- }
-
- /**
- * By default, the LinearGradientStroke defines a transition
- * from left to right across the control.
- * Use the <code>rotation</code> property to control the transition direction.
- * For example, a value of 180.0 causes the transition
- * to occur from right to left, rather than from left to right.
- *
- * @default 0.0
- *
- * @langversion 3.0
- * @playerversion Flash 9
- * @playerversion AIR 1.1
- * @productversion Royale 1.0.0
- */
- public function get rotation():Number
- {
- return _rotation;
- }
-
- /**
- * @private
- */
- public function set rotation(value:Number):void
- {
- _rotation = value;
- }
-
-
- private var _x:Number = 0;
-
- /**
- * The distance by which to translate each point along the x axis.
- */
- public function get x():Number
- {
- return _x;
- }
-
- /**
- * @private
- */
- public function set x(value:Number):void
- {
- _x = value;
- }
-
- private var _y:Number = 0;
-
- /**
- * The distance by which to translate each point along the y axis.
- */
- public function get y():Number
- {
- return _y;
- }
-
- /**
- * @private
- */
- public function set y(value:Number):void
- {
- _y = value;
- }
-
- COMPILE::SWF
- protected function toRad(a:Number):Number {
- return a*Math.PI/180;
- }
-
- COMPILE::SWF
- protected function get rotationInRadians():Number
- {
- return rotation / 180 * Math.PI;
- }
-
- /**
- * @private
- * Extract the gradient information in the public <code>entries</code>
- * Array into the internal <code>colors</code>, <code>ratios</code>,
- * and <code>alphas</code> arrays.
- */
- COMPILE::SWF
- private function processEntries():void
- {
- colors = [];
- ratios = [];
- alphas = [];
-
- if (!_entries || _entries.length == 0)
- return;
-
- var ratioConvert:Number = 255;
-
- var i:int;
-
- var n:int = _entries.length;
- for (i = 0; i < n; i++)
- {
- var e:GradientEntry = _entries[i];
- colors.push(e.color);
- alphas.push(e.alpha);
- ratios.push(e.ratio * ratioConvert);
- }
-
- if (isNaN(ratios[0]))
- ratios[0] = 0;
-
- if (isNaN(ratios[n - 1]))
- ratios[n - 1] = 255;
-
- i = 1;
-
- while (true)
- {
- while (i < n && !isNaN(ratios[i]))
- {
- i++;
- }
-
- if (i == n)
- break;
-
- var start:int = i - 1;
-
- while (i < n && isNaN(ratios[i]))
- {
- i++;
- }
-
- var br:Number = ratios[start];
- var tr:Number = ratios[i];
-
- for (var j:int = 1; j < i - start; j++)
- {
- ratios[j] = br + j * (tr - br) / (i - start);
- }
- }
- }
-
- }
-}
+/*
+ *
+ * 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.royale.graphics
+{
+ COMPILE::SWF
+ {
+ import org.apache.royale.graphics.utils.CompoundTransform;
+ }
+
+ public class GradientBase
+ {
+
+ protected var colors:Array /* of uint */ = [];
+
+ protected var ratios:Array /* of Number */ = [];
+
+ protected var alphas:Array /* of Number */ = [];
+
+ /**
+ * Holds the matrix and the convenience transform properties (<code>x</code>, <code>y</code>, and <code>rotation</code>).
+ * The compoundTransform is only created when the <code>matrix</code> property is set.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ */
+ COMPILE::SWF
+ protected var compoundTransform:CompoundTransform;
+
+ /**
+ * Value of the width and height of the untransformed gradient
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ */
+ public static const GRADIENT_DIMENSION:Number = 1638.4;
+
+ /**
+ * generate uid
+ */
+ public function get newId():String
+ {
+ return 'gradient' + Math.floor((Math.random() * 100000) + 1);
+ }
+
+ /**
+ * Storage for the entries property.
+ */
+ private var _entries:Array = [];
+
+ /**
+ * @private
+ * Storage for the rotation property.
+ */
+ private var _rotation:Number = 0.0;
+
+ /**
+ * An Array of GradientEntry objects
+ * defining the fill patterns for the gradient fill.
+ *
+ */
+ public function get entries():Array
+ {
+ return _entries;
+ }
+
+ /**
+ * @private
+ */
+ public function set entries(value:Array):void
+ {
+ _entries = value;
+ COMPILE::SWF
+ {
+ processEntries();
+ }
+ }
+
+ /**
+ * By default, the LinearGradientStroke defines a transition
+ * from left to right across the control.
+ * Use the <code>rotation</code> property to control the transition direction.
+ * For example, a value of 180.0 causes the transition
+ * to occur from right to left, rather than from left to right.
+ *
+ * @default 0.0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 1.0.0
+ */
+ public function get rotation():Number
+ {
+ return _rotation;
+ }
+
+ /**
+ * @private
+ */
+ public function set rotation(value:Number):void
+ {
+ _rotation = value;
+ }
+
+
+ private var _x:Number = 0;
+
+ /**
+ * The distance by which to translate each point along the x axis.
+ */
+ public function get x():Number
+ {
+ return _x;
+ }
+
+ /**
+ * @private
+ */
+ public function set x(value:Number):void
+ {
+ _x = value;
+ }
+
+ private var _y:Number = 0;
+
+ /**
+ * The distance by which to translate each point along the y axis.
+ */
+ public function get y():Number
+ {
+ return _y;
+ }
+
+ /**
+ * @private
+ */
+ public function set y(value:Number):void
+ {
+ _y = value;
+ }
+
+ COMPILE::SWF
+ protected function toRad(a:Number):Number {
+ return a*Math.PI/180;
+ }
+
+ COMPILE::SWF
+ protected function get rotationInRadians():Number
+ {
+ return rotation / 180 * Math.PI;
+ }
+
+ /**
+ * @private
+ * Extract the gradient information in the public <code>entries</code>
+ * Array into the internal <code>colors</code>, <code>ratios</code>,
+ * and <code>alphas</code> arrays.
+ */
+ COMPILE::SWF
+ private function processEntries():void
+ {
+ colors = [];
+ ratios = [];
+ alphas = [];
+
+ if (!_entries || _entries.length == 0)
+ return;
+
+ var ratioConvert:Number = 255;
+
+ var i:int;
+
+ var n:int = _entries.length;
+ for (i = 0; i < n; i++)
+ {
+ var e:GradientEntry = _entries[i];
+ colors.push(e.color);
+ alphas.push(e.alpha);
+ ratios.push(e.ratio * ratioConvert);
+ }
+
+ if (isNaN(ratios[0]))
+ ratios[0] = 0;
+
+ if (isNaN(ratios[n - 1]))
+ ratios[n - 1] = 255;
+
+ i = 1;
+
+ while (true)
+ {
+ while (i < n && !isNaN(ratios[i]))
+ {
+ i++;
+ }
+
+ if (i == n)
+ break;
+
+ var start:int = i - 1;
+
+ while (i < n && isNaN(ratios[i]))
+ {
+ i++;
+ }
+
+ var br:Number = ratios[start];
+ var tr:Number = ratios[i];
+
+ for (var j:int = 1; j < i - start; j++)
+ {
+ ratios[j] = br + j * (tr - br) / (i - start);
+ }
+ }
+ }
+
+ }
+}
diff --git a/frameworks/projects/Graphics/src/main/royale/org/apache/royale/graphics/beads/BlendBead.as b/frameworks/projects/Graphics/src/main/royale/org/apache/royale/graphics/beads/BlendBead.as
index a6f5fae..a9238f0 100644
--- a/frameworks/projects/Graphics/src/main/royale/org/apache/royale/graphics/beads/BlendBead.as
+++ b/frameworks/projects/Graphics/src/main/royale/org/apache/royale/graphics/beads/BlendBead.as
@@ -1,142 +1,142 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// 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.royale.graphics.beads
-{
-
- import org.apache.royale.core.IBead;
- import org.apache.royale.core.IStrand;
- import org.apache.royale.graphics.utils.shaderClasses.ColorBurnShader;
- import org.apache.royale.graphics.utils.shaderClasses.ColorDodgeShader;
- import org.apache.royale.graphics.utils.shaderClasses.ColorShader;
- import org.apache.royale.graphics.utils.shaderClasses.ExclusionShader;
- import org.apache.royale.graphics.utils.shaderClasses.HueShader;
- import org.apache.royale.graphics.utils.shaderClasses.LuminosityShader;
- import org.apache.royale.graphics.utils.shaderClasses.SaturationShader;
- import org.apache.royale.graphics.utils.shaderClasses.SoftLightShader;
-
- COMPILE::SWF
- {
- import flash.display.Shader;
- import flash.display.BlendMode;
- import org.apache.royale.core.IRenderedObject;
- import org.apache.royale.core.IStyleableObject;
- import org.apache.royale.core.ValuesManager;
- }
-
- /**
- * The BlendBead class translates HTML mixBlendMode CSS values to flash.
- * The JS implementation is degenerated and exists only to enable output
- * agnostic compilation.
- *
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.0
- */
-
-
- public class BlendBead implements IBead
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.0
- */
- public function BlendBead()
- {
- }
-
- COMPILE::SWF
- private static var MAP:Object = {
- normal: BlendMode.NORMAL,
- multiply : BlendMode.MULTIPLY,
- screen: BlendMode.SCREEN,
- overlay: BlendMode.OVERLAY,
- darken: BlendMode.DARKEN,
- lighten: BlendMode.LIGHTEN,
- 'hard-light': BlendMode.HARDLIGHT,
- difference: BlendMode.DIFFERENCE
- }
-
-
- /**
- * @copy org.apache.royale.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.0
- */
- public function set strand(value:IStrand):void
- {
- COMPILE::SWF
- {
- var host:IRenderedObject = value as IRenderedObject;
- var blendModeValue:String = ValuesManager.valuesImpl.getValue(IStyleableObject(value), "mix-blend-mode") as String;
- var simpleBlendModeValue:String = MAP[blendModeValue];
- if (!simpleBlendModeValue)
- {
- getBlendMode(blendModeValue, host);
- } else
- {
- host.$displayObject.blendMode = simpleBlendModeValue;
- }
- }
- }
-
- COMPILE::SWF
- private function getBlendMode(blendModeValue:String, host:IRenderedObject):void
- {
- var shader:Shader = null;
- switch (blendModeValue)
- {
- case 'hue':
- shader = new HueShader();
- break;
- case 'saturation':
- shader = new SaturationShader();
- break;
- case 'color':
- shader = new ColorShader();
- break;
- case 'luminosity':
- shader = new LuminosityShader();
- break;
- case 'exclusion':
- shader = new ExclusionShader();
- break;
- case 'color-dodge':
- shader = new ColorDodgeShader();
- break;
- case 'color-burn':
- shader = new ColorBurnShader();
- break;
- case 'soft-light':
- shader = new SoftLightShader();
- break;
- }
- host.$displayObject.blendMode = "normal";
- host.$displayObject.blendShader = shader;
- }
- }
-}
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.royale.graphics.beads
+{
+
+ import org.apache.royale.core.IBead;
+ import org.apache.royale.core.IStrand;
+
+ COMPILE::SWF
+ {
+ import flash.display.Shader;
+ import flash.display.BlendMode;
+ import org.apache.royale.core.IRenderedObject;
+ import org.apache.royale.core.IStyleableObject;
+ import org.apache.royale.core.ValuesManager;
+ import org.apache.royale.graphics.utils.shaderClasses.ColorBurnShader;
+ import org.apache.royale.graphics.utils.shaderClasses.ColorDodgeShader;
+ import org.apache.royale.graphics.utils.shaderClasses.ColorShader;
+ import org.apache.royale.graphics.utils.shaderClasses.ExclusionShader;
+ import org.apache.royale.graphics.utils.shaderClasses.HueShader;
+ import org.apache.royale.graphics.utils.shaderClasses.LuminosityShader;
+ import org.apache.royale.graphics.utils.shaderClasses.SaturationShader;
+ import org.apache.royale.graphics.utils.shaderClasses.SoftLightShader;
+ }
+
+ /**
+ * The BlendBead class translates HTML mixBlendMode CSS values to flash.
+ * The JS implementation is degenerated and exists only to enable output
+ * agnostic compilation.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+
+
+ public class BlendBead implements IBead
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function BlendBead()
+ {
+ }
+
+ COMPILE::SWF
+ private static var MAP:Object = {
+ normal: BlendMode.NORMAL,
+ multiply : BlendMode.MULTIPLY,
+ screen: BlendMode.SCREEN,
+ overlay: BlendMode.OVERLAY,
+ darken: BlendMode.DARKEN,
+ lighten: BlendMode.LIGHTEN,
+ 'hard-light': BlendMode.HARDLIGHT,
+ difference: BlendMode.DIFFERENCE
+ }
+
+
+ /**
+ * @copy org.apache.royale.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ COMPILE::SWF
+ {
+ var host:IRenderedObject = value as IRenderedObject;
+ var blendModeValue:String = ValuesManager.valuesImpl.getValue(IStyleableObject(value), "mix-blend-mode") as String;
+ var simpleBlendModeValue:String = MAP[blendModeValue];
+ if (!simpleBlendModeValue)
+ {
+ getBlendMode(blendModeValue, host);
+ } else
+ {
+ host.$displayObject.blendMode = simpleBlendModeValue;
+ }
+ }
+ }
+
+ COMPILE::SWF
+ private function getBlendMode(blendModeValue:String, host:IRenderedObject):void
+ {
+ var shader:Shader = null;
+ switch (blendModeValue)
+ {
+ case 'hue':
+ shader = new HueShader();
+ break;
+ case 'saturation':
+ shader = new SaturationShader();
+ break;
+ case 'color':
+ shader = new ColorShader();
+ break;
+ case 'luminosity':
+ shader = new LuminosityShader();
+ break;
+ case 'exclusion':
+ shader = new ExclusionShader();
+ break;
+ case 'color-dodge':
+ shader = new ColorDodgeShader();
+ break;
+ case 'color-burn':
+ shader = new ColorBurnShader();
+ break;
+ case 'soft-light':
+ shader = new SoftLightShader();
+ break;
+ }
+ host.$displayObject.blendMode = "normal";
+ host.$displayObject.blendShader = shader;
+ }
+ }
+}