You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/10/31 23:08:36 UTC
[01/14] git commit: [flex-asjs] [refs/heads/develop] - fix platform
wiper
Repository: flex-asjs
Updated Branches:
refs/heads/develop 83c26c9d0 -> f2a370c66
fix platform wiper
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/7340650a
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/7340650a
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/7340650a
Branch: refs/heads/develop
Commit: 7340650a2b246eae4cd16ff5db39e9b22d35d0e6
Parents: 24faad9
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 31 14:22:11 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 31 15:08:14 2014 -0700
----------------------------------------------------------------------
.../projects/FlexJSUI/src/org/apache/flex/effects/PlatformWiper.as | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7340650a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/effects/PlatformWiper.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/effects/PlatformWiper.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/effects/PlatformWiper.as
index b382745..f9d2486 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/effects/PlatformWiper.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/effects/PlatformWiper.as
@@ -78,9 +78,9 @@ public class PlatformWiper
*/
public function set target(value:IUIBase):void
{
- _target = value;
if (value == null)
DisplayObject(_target).scrollRect = null;
+ _target = value;
}
/**
[08/14] git commit: [flex-asjs] [refs/heads/develop] - deeper copy of
assets
Posted by ah...@apache.org.
deeper copy of assets
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/0cce95af
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/0cce95af
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/0cce95af
Branch: refs/heads/develop
Commit: 0cce95af538520ea6790d7cc30a23de0f60b97a9
Parents: 8813abb
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 31 15:02:52 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 31 15:08:15 2014 -0700
----------------------------------------------------------------------
examples/build_example.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0cce95af/examples/build_example.xml
----------------------------------------------------------------------
diff --git a/examples/build_example.xml b/examples/build_example.xml
index 09bfa5d..04f6687 100644
--- a/examples/build_example.xml
+++ b/examples/build_example.xml
@@ -69,8 +69,8 @@
<copy todir="${basedir}/bin-debug">
<fileset dir="${basedir}/src">
- <include name="*.png" />
- <include name="*.jpg" />
+ <include name="**/*.png" />
+ <include name="**/*.jpg" />
</fileset>
</copy>
</target>
[06/14] git commit: [flex-asjs] [refs/heads/develop] - add styles
that give out change events
Posted by ah...@apache.org.
add styles that give out change events
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3d3dfe2d
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3d3dfe2d
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3d3dfe2d
Branch: refs/heads/develop
Commit: 3d3dfe2d78124bb808a016ba251ef5219cd40d8a
Parents: 56727c5
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 31 14:20:15 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 31 15:08:14 2014 -0700
----------------------------------------------------------------------
.../as/projects/FlexJSJX/basic-manifest.xml | 1 +
.../org/apache/flex/core/BindableCSSStyles.as | 135 +++++++++++++++++++
2 files changed, 136 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3d3dfe2d/frameworks/as/projects/FlexJSJX/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/basic-manifest.xml b/frameworks/as/projects/FlexJSJX/basic-manifest.xml
index 14ba349..99d855f 100644
--- a/frameworks/as/projects/FlexJSJX/basic-manifest.xml
+++ b/frameworks/as/projects/FlexJSJX/basic-manifest.xml
@@ -67,6 +67,7 @@
<component id="NumberFormatter" class="org.apache.flex.html.accessories.NumberFormatter"/>
<component id="CurrencyFormatter" class="org.apache.flex.html.accessories.CurrencyFormatter"/>
+ <component id="BindableCSSStyles" class="org.apache.flex.core.BindableCSSStyles"/>
<component id="SimpleCSSStyles" class="org.apache.flex.core.SimpleCSSStyles"/>
<component id="MXMLBeadViewBase" class="org.apache.flex.core.MXMLBeadViewBase"/>
<component id="MXMLBeadViewBaseDataBinding" class="org.apache.flex.core.MXMLBeadViewBaseDataBinding"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3d3dfe2d/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/BindableCSSStyles.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/BindableCSSStyles.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/BindableCSSStyles.as
new file mode 100644
index 0000000..f601ade
--- /dev/null
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/BindableCSSStyles.as
@@ -0,0 +1,135 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The BindableCSSStyles class contains CSS style
+ * properties supported by SimpleCSSValuesImpl but
+ * dispatch change events when modified
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class BindableCSSStyles
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function BindableCSSStyles()
+ {
+ super();
+ }
+
+
+ private var _object:IStyleableObject;
+
+ /**
+ * The object to which these styles apply.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get object():IStyleableObject
+ {
+ return _object;
+ }
+
+ /**
+ * @private
+ */
+ public function set object(value:IStyleableObject):void
+ {
+ if (_object != value)
+ {
+ _object = value;
+ }
+ }
+
+ [Bindable]
+ public var top:*;
+ [Bindable]
+ public var bottom:*;
+ [Bindable]
+ public var left:*;
+ [Bindable]
+ public var right:*;
+ [Bindable]
+ public var padding:*;
+ [Bindable]
+ public var paddingLeft:*;
+ [Bindable]
+ public var paddingRight:*;
+ [Bindable]
+ public var paddingTop:*;
+ [Bindable]
+ public var paddingBottom:*;
+ [Bindable]
+ public var margin:*;
+ [Bindable]
+ public var marginLeft:*;
+ [Bindable]
+ public var marginRight:*;
+ [Bindable]
+ public var marginTop:*;
+ [Bindable]
+ public var marginBottom:*;
+ [Bindable]
+ public var horizontalCenter:*;
+ [Bindable]
+ public var verticalCenter:*;
+ [Bindable]
+ public var horizontalAlign:*;
+ [Bindable]
+ public var verticalAlign:*;
+ [Bindable]
+ public var fontFamily:*;
+ [Bindable]
+ public var fontSize:*;
+ [Bindable]
+ public var color:*;
+ [Bindable]
+ public var fontWeight:*;
+ [Bindable]
+ public var fontStyle:*;
+ [Bindable]
+ public var backgroundAlpha:*;
+ [Bindable]
+ public var backgroundColor:*;
+ [Bindable]
+ public var backgroundImage:*;
+ [Bindable]
+ public var borderColor:*;
+ [Bindable]
+ public var borderStyle:*;
+ [Bindable]
+ public var borderRadius:*;
+ }
+}
\ No newline at end of file
[13/14] FlexJSStore works well enough to try to make it work on JS.
Drag/Drop, ToolTips, States with Transitions are functional
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/data/catalog.xml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/data/catalog.xml b/examples/FlexJSStore/src/data/catalog.xml
new file mode 100755
index 0000000..423e177
--- /dev/null
+++ b/examples/FlexJSStore/src/data/catalog.xml
@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+ -->
+<catalog>
+
+ <product productId="1">
+ <name>Andrew Brilliam</name>
+ <description>15 years experience. 8 years with Flex. Specializing in Text Layout Framework</description>
+ <price>60.00</price>
+ <image>assets/pic/abrilliam.jpg</image>
+ <experience>15</experience>
+ <blazeds>false</blazeds>
+ <mobile>false</mobile>
+ <video>false</video>
+ <highlight1>Text Layout Framework</highlight1>
+ <highlight2>Parsley</highlight2>
+ </product>
+
+ <product productId="2">
+ <name>Annette Kotter</name>
+ <description>Specializing in custom components. PHP servers.</description>
+ <price>55</price>
+ <image>assets/pic/akotter.jpg</image>
+ <experience>3</experience>
+ <blazeds>true</blazeds>
+ <mobile>false</mobile>
+ <video>false</video>
+ <highlight1>Custom Components</highlight1>
+ <highlight2>PHP</highlight2>
+ </product>
+
+ <product productId="3">
+ <name>Ben Crater</name>
+ <description>Specializing in BlazeDS backends.</description>
+ <price>55</price>
+ <image>assets/pic/bcrater.jpg</image>
+ <experience>4</experience>
+ <blazeds>true</blazeds>
+ <mobile>false</mobile>
+ <video>false</video>
+ <highlight1>BlazeDS</highlight1>
+ <highlight2>Remote Object</highlight2>
+ </product>
+
+ <product productId="4">
+ <name>Beth Leporte</name>
+ <description>BlazeDS or PHP servers. Multimedia messagin.</description>
+ <price>70.00</price>
+ <image>assets/pic/bleporte.jpg</image>
+ <experience>6</experience>
+ <blazeds>true</blazeds>
+ <mobile>false</mobile>
+ <video>false</video>
+ <highlight1>Multimedia messaging</highlight1>
+ <highlight2>BlazeDS</highlight2>
+ </product>
+
+ <product productId="5">
+ <name>Brad Van Brocklin</name>
+ <description>Emphasis on mobile application development</description>
+ <price>80</price>
+ <image>assets/pic/bvanbrocklin.jpg</image>
+ <experience>6</experience>
+ <blazeds>false</blazeds>
+ <mobile>true</mobile>
+ <video>false</video>
+ <highlight1>Mobile</highlight1>
+ <highlight2>Android</highlight2>
+ </product>
+
+ <product productId="6">
+ <name>Carlos Carpenter</name>
+ <description>Built many mobile apps and video apps.</description>
+ <price>80</price>
+ <image>assets/pic/ccarpenter.jpg</image>
+ <experience>4</experience>
+ <blazeds>false</blazeds>
+ <mobile>true</mobile>
+ <video>true</video>
+ <highlight1>Mobile</highlight1>
+ <highlight2>Video</highlight2>
+ </product>
+
+ <product productId="7">
+ <name>Christine Lampberto</name>
+ <description>7 years experience building mobile applications.</description>
+ <price>90</price>
+ <image>assets/pic/clampberto.jpg</image>
+ <experience>7</experience>
+ <blazeds>true</blazeds>
+ <mobile>true</mobile>
+ <video>false</video>
+ <highlight1>BlazeDS</highlight1>
+ <highlight2>Mobile</highlight2>
+ </product>
+
+ <product productId="8">
+ <name>Dee Dee Avenon</name>
+ <description>I've been making video apps for over 5 years and mobile apps for about 3 years.</description>
+ <price>100</price>
+ <image>assets/pic/davenon.jpg</image>
+ <experience>10</experience>
+ <blazeds>false</blazeds>
+ <mobile>true</mobile>
+ <video>true</video>
+ <highlight1>Video Applications</highlight1>
+ <highlight2>Mobile Applications</highlight2>
+ </product>
+
+ <product productId="9">
+ <name>Denise McGoyal</name>
+ <description>Specializing in video sharing applicaions. MObile apps too.</description>
+ <price>100</price>
+ <image>assets/pic/dmcgoyal.jpg</image>
+ <experience>5</experience>
+ <blazeds>false</blazeds>
+ <mobile>true</mobile>
+ <video>true</video>
+ <highlight1>Video Applications</highlight1>
+ <highlight2>Mobile Applications</highlight2>
+ </product>
+
+ <product productId="10">
+ <name>Daniel Willhelm</name>
+ <description>I'm into mobile apps, video apps and social apps.</description>
+ <price>70</price>
+ <image>assets/pic/dwillhelm.jpg</image>
+ <experience>90</experience>
+ <blazeds>false</blazeds>
+ <mobile>true</mobile>
+ <video>true</video>
+ <highlight1>Video Applications</highlight1>
+ <highlight2>Mobile Applications</highlight2>
+ </product>
+
+ <product productId="11">
+ <name>Eunice Sunderland</name>
+ <description>My recent focus is on mobile apps, but I have considerable experience in video apps as well.</description>
+ <price>150</price>
+ <image>assets/pic/esunderland.jpg</image>
+ <experience>30</experience>
+ <blazeds>false</blazeds>
+ <mobile>true</mobile>
+ <video>true</video>
+ <highlight1>Video Applications</highlight1>
+ <highlight2>Mobile Applications</highlight2>
+ </product>
+
+ <product productId="12">
+ <name>Jane Proctor</name>
+ <description>I've been developing mobile companion apps for the past 3 years.</description>
+ <price>75</price>
+ <image>assets/pic/jproctor.jpg</image>
+ <experience>6</experience>
+ <blazeds>false</blazeds>
+ <mobile>true</mobile>
+ <video>true</video>
+ <highlight1>Video Applications</highlight1>
+ <highlight2>Mobile Applications</highlight2>
+ </product>
+
+ <product productId="13">
+ <name>Mark Fields</name>
+ <description>Video is my favorite thing. Mobile is also a favorite.</description>
+ <price>60</price>
+ <image>assets/pic/mfields.jpg</image>
+ <experience>70</experience>
+ <blazeds>false</blazeds>
+ <mobile>true</mobile>
+ <video>true</video>
+ <highlight1>Video Applications</highlight1>
+ <highlight2>Mobile Applications</highlight2>
+ </product>
+
+ <product productId="14">
+ <name>Patricia Dempsey</name>
+ <description>I've been cranking out mobile apps for the past 6 years. A few have involved video as well.</description>
+ <price>120</price>
+ <image>assets/pic/pdempsey.jpg</image>
+ <experience>7</experience>
+ <blazeds>false</blazeds>
+ <mobile>true</mobile>
+ <video>true</video>
+ <highlight1>Video Applications</highlight1>
+ <highlight2>Mobile Applications</highlight2>
+ </product>
+
+ <product productId="15">
+ <name>Paul Trandep</name>
+ <description>I've been working on a mobile app that incorporates music. It just shipped so now I'm looking for the next fun thing to work on.'</description>
+ <price>50</price>
+ <image>assets/pic/ptranep.jpg</image>
+ <experience>6</experience>
+ <blazeds>false</blazeds>
+ <mobile>true</mobile>
+ <video>true</video>
+ <highlight1>Video Applications</highlight1>
+ <highlight2>Mobile Applications</highlight2>
+ </product>
+
+ <product productId="16">
+ <name>Roscoe Crawley</name>
+ <description>My main specialty is in BlazeDS connected to Flex.</description>
+ <price>59</price>
+ <image>assets/pic/rcrawley.jpg</image>
+ <experience>9</experience>
+ <blazeds>true</blazeds>
+ <mobile>false</mobile>
+ <video>false</video>
+ <highlight1>BlazeDS</highlight1>
+ <highlight2>Remote Object</highlight2>
+ </product>
+
+ <product productId="17">
+ <name>Renee Dreifus</name>
+ <description>I can do it all: BlazeDS, Mobile, Video.</description>
+ <price>79</price>
+ <image>assets/pic/rdreifus.jpg</image>
+ <experience>90</experience>
+ <blazeds>true</blazeds>
+ <mobile>true</mobile>
+ <video>true</video>
+ <highlight1>Video Applications</highlight1>
+ <highlight2>Mobile Applications</highlight2>
+ </product>
+
+ <product productId="18">
+ <name>Tina Wong</name>
+ <description>I've been developing Flex apps since 1.5. Most of my recent work has been on mobile apps.</description>
+ <price>109</price>
+ <image>assets/pic/twong.jpg</image>
+ <experience>9</experience>
+ <blazeds>false</blazeds>
+ <mobile>true</mobile>
+ <video>true</video>
+ <highlight1>Video Applications</highlight1>
+ <highlight2>Mobile Applications</highlight2>
+ </product>
+
+</catalog>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/main.css
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/main.css b/examples/FlexJSStore/src/main.css
new file mode 100755
index 0000000..e092b58
--- /dev/null
+++ b/examples/FlexJSStore/src/main.css
@@ -0,0 +1,95 @@
+/*
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+*/
+
+@namespace basic "library://ns.apache.org/flexjs/basic";
+
+/*
+//----------------------------
+// Global styles
+//----------------------------
+*/
+.global {
+ IStatesImpl: ClassReference("org.apache.flex.core.StatesWithTransitionsImpl");
+ color: #170505;
+ fillAlphas: 1.00, 1.00; /* last pair are for OVER state */
+ fillColors: #FFFFFF, #DDDDDD, #FFFFFF, #EEEEEE;
+}
+
+global {
+ IStatesImpl: ClassReference("org.apache.flex.core.StatesWithTransitionsImpl");
+}
+
+/*
+//----------------------------
+// Type selectors
+//----------------------------
+
+HRule
+{
+ color: #666666;
+}
+*/
+
+/*
+//----------------------------
+// Named styles
+//----------------------------
+*/
+.glass {
+ borderColor: #767473;
+ fillAlphas: .60, .60, .60, .60;
+ fillColors: #888888, #F3F3F3, #9E9E9E, #FCFCFC;
+ highlightAlphas: .07, .45;
+}
+
+.glassSlider
+{
+ fillAlphas: .80, .80, .80, .80;
+ fillColors: #F3F3F3, #BBBBBB, #FCFCFC, #CCCCCC;
+}
+
+.listItem
+{
+ paddingLeft: 4;
+ paddingRight: 4;
+ horizontalGap: 5;
+ verticalAlign: "middle";
+ backgroundColor: #FFFFFF;
+ backgroundAlpha: .5;
+ borderStyle: "outset";
+}
+
+basic|Container
+{
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.NonVirtualBasicLayout");
+}
+
+.sectionHeader
+{
+ fontWeight: "bold";
+ fontSize: 11;
+}
+
+.homeSection
+{
+ cornerRadius: 4;
+ borderStyle: "solid";
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/productsView/CatalogTitleButtons.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/CatalogTitleButtons.mxml b/examples/FlexJSStore/src/productsView/CatalogTitleButtons.mxml
new file mode 100755
index 0000000..d2cca30
--- /dev/null
+++ b/examples/FlexJSStore/src/productsView/CatalogTitleButtons.mxml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:HContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ currentState="showFilter">
+ <basic:style>
+ <basic:SimpleCSSStyles verticalAlign="middle"
+ paddingTop="0"
+ paddingBottom="0" />
+ </basic:style>
+ <basic:beads>
+ <basic:ParentDocumentBead id="pdb" />
+ <basic:ContainerDataBinding />
+ </basic:beads>
+ <fx:Script>
+ <![CDATA[
+ [Bindable]
+ public var cartCount:int;
+
+ private function rollOverLabel(event:Event):void
+ {
+ Label(event.target).className = "catalogTitleButtonHighlighted";
+ }
+
+ private function rollOutLabel(event:Event):void
+ {
+ Label(event.target).className = "catalogTitleButtonDeselected";
+ }
+ ]]>
+ </fx:Script>
+ <fx:Binding source="ProductCatalogPanel(pdb.parentDocument).cartCount" destination="cartCount" />
+ <!-- two-way binding between the states of panel title buttons and the product view state -->
+ <fx:Binding source="ProductsView(ProductCatalogPanel(pdb.parentDocument).pdb.parentDocument).currentState" destination="currentState" />
+ <fx:Binding destination="ProductsView(ProductCatalogPanel(pdb.parentDocument).pdb.parentDocument).currentState" source="currentState" />
+
+ <basic:Label id="findPhones" text="Find Developers" click="currentState = 'showFilter'"
+ className.showFilter="catalogTitleButtonSelected"
+ className.showCart="catalogTitleButtonDeselected"
+ rollOver.showCart="rollOverLabel(event)"
+ rollOut.showCart="rollOutLabel(event)"/>
+ <basic:HRule height="{findPhones.height * .75}" alpha=".75" style="color:#333333" />
+ <basic:Label id="viewCart" text="View Cart ({cartCount} items)" click="currentState = 'showCart'"
+ className.showFilter="catalogTitleButtonDeselected"
+ className.showCart="catalogTitleButtonSelected"
+ rollOver.showFilter="rollOverLabel(event)"
+ rollOut.showFilter="rollOutLabel(event)"/>
+
+ <basic:states>
+ <mx:State name="showFilter" />
+ <mx:State name="showCart" />
+ </basic:states>
+</basic:HContainer>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/productsView/Grip.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/Grip.mxml b/examples/FlexJSStore/src/productsView/Grip.mxml
new file mode 100755
index 0000000..127c764
--- /dev/null
+++ b/examples/FlexJSStore/src/productsView/Grip.mxml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:VContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx" width="17" height="100%" >
+ <basic:style>
+ <basic:SimpleCSSStyles paddingTop="10" horizontalAlign="center" />
+ </basic:style>
+
+ <fx:Script>
+ <![CDATA[
+ [Bindable]
+ public var gripTip:String;
+
+ [Bindable]
+ public var gripIcon:String;
+ ]]>
+ </fx:Script>
+ <basic:beads>
+ <basic:ContainerDataBinding />
+ <basic:LayoutChangeNotifier watchedProperty="{icon.height}" initialValue="0" />
+ <basic:LayoutChangeNotifier watchedProperty="{grip.height}" initialValue="0" />
+ </basic:beads>
+
+ <basic:Image id="icon" source="{gripIcon}" />
+ <basic:Image id="grip" source="assets/grip.png" >
+ <basic:beads>
+ <basic:ToolTipBead toolTip="{gripTip}" />
+ </basic:beads>
+ </basic:Image>
+
+</basic:VContainer>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/productsView/ProductCart.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/ProductCart.mxml b/examples/FlexJSStore/src/productsView/ProductCart.mxml
new file mode 100755
index 0000000..00459f3
--- /dev/null
+++ b/examples/FlexJSStore/src/productsView/ProductCart.mxml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:Container xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:productsView="productsView.*"
+ >
+ <basic:style>
+ <basic:SimpleCSSStyles horizontalAlign="right"
+ paddingTop="8"
+ paddingBottom="8"
+ paddingRight="4"
+ paddingLeft="4" />
+ </basic:style>
+ <basic:beads>
+ <basic:ContainerDataBinding />
+ <basic:OneFlexibleChildVerticalLayout />
+ </basic:beads>
+ <fx:Script>
+ <![CDATA[
+
+ import org.apache.flex.html.SimpleAlert;
+
+ import samples.flexstore.Product;
+ import samples.flexstore.ProductListEvent;
+
+ [Bindable]
+ public var numProducts:int=0;
+
+ [Bindable]
+ private var total:Number = 0;
+
+ private const SHIPPING:Number = 1.99;
+
+ private function productListEventHandler(event:ProductListEvent):void
+ {
+ switch (event.type)
+ {
+ case ProductListEvent.ADD_PRODUCT:
+ event.product.qty = 0;
+ //fall through into the same logic as dup
+ case ProductListEvent.DUPLICATE_PRODUCT:
+ event.product.qty++;
+ total += event.product.price;
+ numProducts++;
+ break;
+ case ProductListEvent.PRODUCT_QTY_CHANGE:
+ case ProductListEvent.REMOVE_PRODUCT:
+ var items:Array = productList.items;
+ total = 0;
+ numProducts = 0;
+ for (var i:int=0; i < items.length; i++)
+ {
+ var product:Product = items[i].product;
+ total += product.qty * product.price;
+ numProducts += product.qty;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ ]]>
+ </fx:Script>
+ <fx:Declarations>
+ <basic:CurrencyFormatter currencySymbol="$" id="cf" fractionalDigits="2"/>
+ </fx:Declarations>
+
+ <basic:Label width="100%" text="Your Shopping Cart" className="sectionHeader"/>
+
+ <productsView:ProductList id="productList" height="100%" width="100%"
+ newItemStartX="-100" newItemStartY="-100"
+ addProduct="productListEventHandler(event)"
+ duplicateProduct="productListEventHandler(event)"
+ productQtyChange="productListEventHandler(event)"
+ removeProduct="productListEventHandler(event)"
+ showQuantity="true" />
+
+ <basic:Container style="paddingRight:0">
+ <basic:beads>
+ <basic:VerticalColumnLayout numColumns="2" />
+ </basic:beads>
+ <basic:Label text="Total:" width="100%" />
+ <basic:Label width="70" text="{cf.format(total)}" style="textAlign:'right'"/>
+
+ <basic:Label text="Service Fee:" width="100%" />
+ <basic:Label width="70" text="{cf.format(numProducts * SHIPPING)}" style="textAlign:'right'"/>
+
+ <basic:Label text="Grand Total:" style="fontWeight:'bold'" width="100%" />
+ <basic:Label width="70" text="{cf.format(total + (numProducts * SHIPPING))}" style="textAlign:'right'"/>
+
+ </basic:Container>
+
+ <basic:TextButton text="Submit Order" click="SimpleAlert.show('This feature is not implemented in this sample', 'Submit Order')"/>
+
+</basic:Container>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/productsView/ProductCatalogPanel.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/ProductCatalogPanel.mxml b/examples/FlexJSStore/src/productsView/ProductCatalogPanel.mxml
new file mode 100755
index 0000000..80ffadf
--- /dev/null
+++ b/examples/FlexJSStore/src/productsView/ProductCatalogPanel.mxml
@@ -0,0 +1,545 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:Panel xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ implements="org.apache.flex.core.IDragInitiator"
+ xmlns:productsView="productsView.*"
+ currentState="browse"
+ title.browse="Browse"
+ title.compare="Product Comparison"
+ title.details="Product Details"
+ className="catalogPanel"
+ >
+
+ <fx:Metadata>
+ [Event(name="purchase", type="samples.flexstore.ProductThumbEvent")]
+ [Event(name="compare", type="samples.flexstore.ProductThumbEvent")]
+ [Event(name="details", type="samples.flexstore.ProductThumbEvent")]
+ </fx:Metadata>
+
+ <fx:Script>
+ <![CDATA[
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.effects.Effect;
+ import org.apache.flex.effects.Fade;
+ import org.apache.flex.effects.Move;
+ import org.apache.flex.effects.Parallel;
+ import org.apache.flex.effects.Tween;
+ import org.apache.flex.events.DragEvent;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.net.dataConverters.LazyCollection;
+
+ import samples.flexstore.Product;
+ import samples.flexstore.ProductFilter;
+ import samples.flexstore.ProductFilterEvent;
+ import samples.flexstore.ProductThumbEvent;
+
+
+ private var accepted:Object = new Object();
+ private var thumbnails:Array;
+ private var filterCount:int;
+ private var thumbnailState:String = 'browse'; //either 'browse' or 'compare'
+
+ [Bindable]
+ public var cartCount:int;
+
+ //-----------------------------
+ // catalog
+ //-----------------------------
+
+ private var _catalog:LazyCollection;
+
+ [Bindable]
+ public function set catalog(c:LazyCollection):void
+ {
+ _catalog = c;
+ createThumbnails();
+ }
+
+ public function get catalog():LazyCollection
+ {
+ return _catalog;
+ }
+
+ //----------------------------------------------------------------------
+ // methods
+ //----------------------------------------------------------------------
+
+ private function createThumbnails():void
+ {
+ var i:int; //variables are hoisted up in scope so declare here to avoid warning
+ if (thumbnails != null)
+ {
+ for (i=0; i < thumbnails.length; i++)
+ {
+ thumbContent.removeElement(thumbnails[i]);
+ }
+ }
+
+ var row:int = 0;
+ var col:int = -1;
+ var n:int = catalog.length;
+ thumbnails = new Array(n);
+ filterCount = n;
+
+ for (i=0; i < n; i++)
+ {
+ var thumb:ProductCatalogThumbnail = new ProductCatalogThumbnail();
+ thumbnails[i] = thumb;
+ // thumbnails[i].showInAutomationHierarchy = true;
+ thumb.product = catalog.getItemAt(i) as Product;
+ accepted[thumb.product.productId.toString()] = true;
+ thumbContent.addElement(thumb);
+ thumb.addEventListener(ProductThumbEvent.PURCHASE, productThumbEventHandler);
+ thumb.addEventListener(ProductThumbEvent.COMPARE, productThumbEventHandler);
+ thumb.addEventListener(ProductThumbEvent.DETAILS, productThumbEventHandler);
+ thumb.addEventListener(DragEvent.DRAG_START,thumbDragStartHandler);
+ }
+
+ var lastMove:Effect = layoutCatalog();
+ if (lastMove)
+ {
+ lastMove.addEventListener(Tween.TWEEN_UPDATE, updateLayout);
+ }
+ }
+
+ private function updateLayout(event:org.apache.flex.events.Event):void
+ {
+ thumbContent.dispatchEvent(new org.apache.flex.events.Event("layoutNeeded"));
+ }
+
+ private function thumbDragStartHandler(event:MouseEvent):void
+ {
+ if (DragMouseController.dragging == false)
+ {
+ var thumb:ProductCatalogThumbnail = event.target as ProductCatalogThumbnail;
+ DragMouseController.dragSource = thumb.product;
+
+ var di:ProductCatalogThumbnail = new ProductCatalogThumbnail();
+ di.product = thumb.product;
+ di.currentState = thumb.currentState;
+ DragMouseController.dragImage = di;
+
+ DragMouseController.dragInitiator = this;
+ }
+ }
+
+ public function filter(productFilter:ProductFilter, live:Boolean):void
+ {
+ currentState = "browse";
+ thumbnailState = "browse";
+ var count:int=0;
+ var n:int = thumbnails.length;
+ var targets:Array = [];
+ for (var i:int = 0; i < n; i++)
+ {
+ var thumb:ProductCatalogThumbnail = thumbnails[i];
+ var product:Product = thumb.product;
+ if (productFilter.accept(product))
+ {
+ accepted[product.productId.toString()] = true;
+ thumb.alpha = 1;
+ count++;
+ }
+ else
+ {
+ accepted[product.productId.toString()] = false;
+ if (live)
+ {
+ thumb.alpha = .1;
+ }
+ else if (thumb.alpha == 1) //only fade if we hadn't started
+ {
+ targets.push(thumb);
+ }
+ }
+ }
+ productFilter.count = count;
+ filterCount = count;
+
+ if (targets.length > 0)
+ {
+ var p:Parallel = new Parallel();
+ n = targets.length;
+ for (i = 0; i < n; i++)
+ {
+ var fadeOut:Fade = new Fade(targets[i] as IUIBase);
+ fadeOut.alphaFrom = 1;
+ fadeOut.alphaTo = .1;
+ p.addChild(fadeOut);
+ }
+ p.play();
+ p.addEventListener(Effect.EFFECT_END,
+ function(event:org.apache.flex.events.Event):void
+ {
+ layoutCatalog();
+ });
+ }
+ else if (!live)
+ {
+ layoutCatalog();
+ }
+ }
+
+ private function layoutCatalog():Effect
+ {
+ var tileWidth:Number;
+ var tileHeight:Number;
+ var numCols:int;
+
+ if (filterCount > 9 || currentState == "compare")
+ {
+ numCols = 4;
+ tileWidth = ProductCatalogThumbnail.COL_WIDTH_4;
+ tileWidth = currentState == "compare"
+ ? ProductCatalogThumbnail.COMPARE_WIDTH
+ : ProductCatalogThumbnail.COL_WIDTH_4
+ tileHeight = currentState == "compare"
+ ? height - 4
+ : ProductCatalogThumbnail.COL_HEIGHT_4;
+ }
+ else if (filterCount > 4)
+ {
+ numCols = 3;
+ tileWidth = ProductCatalogThumbnail.COL_WIDTH_3;
+ tileHeight = ProductCatalogThumbnail.COL_HEIGHT_3;
+ }
+ else if (filterCount <= 9)
+ {
+ numCols = 2;
+ tileWidth = ProductCatalogThumbnail.COL_WIDTH_2;
+ tileHeight = ProductCatalogThumbnail.COL_HEIGHT_2;
+ }
+ else
+ {
+ }
+
+ var row:int = 0;
+ var col:int = -1;
+
+ var move:Move = null;
+
+ var n:int = catalog.length;
+ for (var i:int = 0 ; i < n ; i++)
+ {
+ var product:Product = catalog.getItemAt(i) as Product;
+ var thumb:ProductCatalogThumbnail = thumbnails[i];
+ if (accepted[product.productId.toString()])
+ {
+ thumb.currentState = "x" + numCols + "cols";
+ col++;
+ if (col > numCols - 1)
+ {
+ row++;
+ col = 0;
+ }
+
+ var xTo:Number = col * (tileWidth + ProductCatalogThumbnail.HORIZONTAL_GAP);
+ var yTo:Number = row * (tileHeight + ProductCatalogThumbnail.VERTICAL_GAP);
+
+ // If the thumbnail is already visible
+ // animate it to its new position.
+ if (thumb.visible)
+ {
+ // Animate only if the position is different
+ // from its current position.
+ if (thumb.x != xTo || thumb.y != yTo)
+ {
+ move = new Move(thumb);
+ move.xTo = xTo;
+ move.yTo = yTo;
+ move.play();
+ }
+ }
+
+ // If the thumbnail was not previously visible, sets its
+ // x and y coordinates. We'll make it reappear after all
+ // the visible thumbnails have reached their new position.
+ else
+ {
+ thumb.x = xTo;
+ thumb.y = yTo;
+// thumb.includeInLayout = true;
+ }
+ }
+ else
+ {
+ thumb.visible = false;
+// thumb.includeInLayout = false;
+ }
+ }
+
+ if (!move)
+ {
+ // No visible thumbnails were animated to a new position;
+ // fade in newly selected thumbnails right away.
+ fadeInThumbnails();
+ }
+ else
+ {
+ //since movement is happening get the scrollbar back to the top
+ scv.verticalScrollPosition = 0;
+ // Fade in newly selected thumbnails after the last
+ // visible thumbnail has moved to its new position.
+ move.addEventListener(Effect.EFFECT_END,
+ function(event:org.apache.flex.events.Event):void
+ {
+ fadeInThumbnails();
+ });
+ }
+ thumbContent.dispatchEvent(new org.apache.flex.events.Event("layoutNeeded"));
+ //return the last move to watch
+ return move;
+ }
+
+ //return the last effect so we could add effectEnd handler if desired
+ private function fadeInThumbnails():void
+ {
+ var n:int = thumbnails.length;
+ var targets:Array = [];
+ for (var i:int = 0; i < n ; i++)
+ {
+ var thumb:ProductCatalogThumbnail = thumbnails[i];
+ if (accepted[thumb.product.productId.toString()] && !thumb.visible)
+ {
+ thumb.alpha = 0;
+ thumb.visible = true;
+ targets.push(thumb);
+ }
+ }
+ if (targets.length > 0)
+ {
+ n = targets.length;
+ for (i = 0; i < n; i++)
+ {
+ var effect:Fade = new Fade(targets[i] as IUIBase);
+ effect.alphaTo = 1;
+ effect.play();
+ }
+ }
+ }
+
+ private function showDetails(product:Product):void
+ {
+ if (currentState == "details")
+ {
+ details.product = product;
+ return;
+ }
+
+ var row:int = -1;
+
+ //should be computed using border metrics instead of hard-coding the 20, but...
+ var xTo:Number = thumbContent.width - ProductCatalogThumbnail.COL_WIDTH_4 - 20;
+ var yTo:Number;
+
+ var move:Move;
+ var first:Boolean = true;
+ var selectedThumb:ProductCatalogThumbnail;
+
+ var n:int = thumbnails.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var thumb:ProductCatalogThumbnail = thumbnails[i];
+ if (thumb.visible)
+ {
+ row++;
+ yTo = row * (ProductCatalogThumbnail.COL_HEIGHT_4 + ProductCatalogThumbnail.VERTICAL_GAP);
+
+ thumb.currentState = "x4cols";
+
+ if (thumb.x != xTo || thumb.y != yTo)
+ {
+ move = new Move(thumb);
+ if (first)
+ {
+ move.addEventListener(Effect.EFFECT_END,
+ function(event:org.apache.flex.events.Event):void
+ {
+ details.product = product;
+ currentState = "details";
+ });
+
+ first = false;
+ }
+ move.xTo = xTo;
+ move.yTo = yTo;
+ move.play();
+ }
+
+ if (thumb.product == product)
+ {
+ selectedThumb = thumb;
+ }
+ }
+ }
+ if (selectedThumb != null)
+ {
+ //make sure that the selected thumb is visible in the list on the right
+ move.addEventListener(Effect.EFFECT_END,
+ function(e:org.apache.flex.events.Event):void
+ {
+ var curpos:int = scv.verticalScrollPosition;
+ if (selectedThumb.y < curpos)
+ {
+ scv.verticalScrollPosition = y;
+ }
+ else if (selectedThumb.y + ProductCatalogThumbnail.COL_HEIGHT_4 > curpos + thumbContent.height)
+ {
+ //this logic doesn't seem to be perfect but it will do
+ var diff:int = selectedThumb.y - (curpos + thumbContent.height)
+ scv.verticalScrollPosition += diff + ProductCatalogThumbnail.COL_HEIGHT_4 + ProductCatalogThumbnail.VERTICAL_GAP;
+ }
+ });
+ }
+
+ }
+
+ private function productThumbEventHandler(event:ProductThumbEvent):void
+ {
+ if (event.type == ProductThumbEvent.DETAILS)
+ {
+ showDetails(event.product);
+ }
+ else if (event.type == ProductThumbEvent.BROWSE)
+ {
+ if (thumbnailState == "browse")
+ {
+ currentState = "browse";
+ layoutCatalog();
+ }
+ else
+ {
+ compare();
+ }
+ }
+ else
+ {
+ dispatchEvent(event);
+ }
+ }
+
+ public function compare(toCompare:Array=null):void
+ {
+ currentState = "compare";
+ thumbnailState = "compare";
+ if (toCompare != null)
+ {
+ var n:int = thumbnails.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ accepted[thumbnails[i].product.productId.toString()] = false;
+ }
+ for (i=0; i < toCompare.length; i++)
+ {
+ accepted[toCompare[i].productId.toString()] = true;
+ }
+ }
+ var lastEffect:Effect = layoutCatalog();
+ if (lastEffect != null)
+ {
+ lastEffect.addEventListener(Effect.EFFECT_END,
+ function (event:org.apache.flex.events.Event):void
+ {
+ setCompareState();
+ });
+ }
+ else
+ {
+ setCompareState();
+ }
+ }
+
+ private function setCompareState():void
+ {
+ //avoid an issue if the user clicks quickly where we move into
+ //compare state even though we're no longer in compare
+ if (currentState == "compare")
+ {
+ var n:int = thumbnails.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var thumb:ProductCatalogThumbnail = thumbnails[i];
+ if (accepted[thumb.product.productId.toString()])
+ {
+ thumb.currentState = "compare";
+ }
+ }
+
+ }
+ }
+
+ public function acceptingDrop(dropTarget:Object, type:String):void
+ {
+
+ }
+
+ public function acceptedDrop(dropTarget:Object, type:String):void
+ {
+
+ }
+
+ ]]>
+ </fx:Script>
+
+ <basic:beads>
+ <basic:ContainerDataBinding />
+ <basic:NonVirtualVerticalLayout />
+ <basic:DragMouseController id="dragger" />
+ <basic:ParentDocumentBead id="pdb" />
+ <basic:PanelView>
+ <basic:titleBar>
+ <basic:TitleBar>
+ <basic:style>
+ <basic:SimpleCSSStyles backgroundColor="0xA65904" />
+ </basic:style>
+ <basic:beads>
+ <productsView:ProductCatalogPanelTitleBarView />
+ </basic:beads>
+ </basic:TitleBar>
+ </basic:titleBar>
+ </basic:PanelView>
+ </basic:beads>
+ <basic:Container width="100%" height="100%">
+ <basic:Container id="thumbContentGroup" width="100%" height="100%">
+ <basic:beads>
+ <basic:ScrollingContainerView id="scv" />
+ <basic:NonVirtualBasicScrollingLayout />
+ </basic:beads>
+ <basic:Container id="thumbContent" width="100%" height="100%" />
+ </basic:Container>
+ <productsView:ProductDetails id="details"
+ width="{ProductCatalogThumbnail.COL_WIDTH_4 * 3}"
+ height="100%"
+ visible="false"
+ visible.details="true"
+ compare="productThumbEventHandler(event)"
+ purchase="productThumbEventHandler(event)"
+ browse="productThumbEventHandler(event)" />
+ </basic:Container>
+
+ <basic:states>
+ <mx:State name="browse" />
+ <mx:State name="compare" />
+ <mx:State name="details" />
+ </basic:states>
+
+</basic:Panel>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/productsView/ProductCatalogPanelTitleBarView.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/ProductCatalogPanelTitleBarView.mxml b/examples/FlexJSStore/src/productsView/ProductCatalogPanelTitleBarView.mxml
new file mode 100755
index 0000000..6c6de2b
--- /dev/null
+++ b/examples/FlexJSStore/src/productsView/ProductCatalogPanelTitleBarView.mxml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:MXMLBeadViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:productsView="productsView.*"
+ >
+ <fx:Script>
+ <![CDATA[
+ import org.apache.flex.html.TitleBar;
+ import org.apache.flex.core.ITitleBarModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+
+ private function clickHandler():void
+ {
+ var newEvent:org.apache.flex.events.Event = new org.apache.flex.events.Event('close',true);
+ UIBase(_strand).dispatchEvent(newEvent)
+ }
+ ]]>
+ </fx:Script>
+ <basic:beads>
+ <basic:MXMLBeadViewBaseDataBinding />
+ <basic:LayoutChangeNotifier watchedProperty="{titleLabel.height}" />
+ </basic:beads>
+ <basic:Label id="titleLabel" text="{ITitleBarModel(model).title}"
+ />
+ <basic:CloseButton id="closeButton" click="clickHandler()"
+ visible="{ITitleBarModel(model).showCloseButton}";
+ />
+ <productsView:CatalogTitleButtons />
+</basic:MXMLBeadViewBase>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/productsView/ProductCatalogThumbnail.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/ProductCatalogThumbnail.mxml b/examples/FlexJSStore/src/productsView/ProductCatalogThumbnail.mxml
new file mode 100755
index 0000000..6b6d7a6
--- /dev/null
+++ b/examples/FlexJSStore/src/productsView/ProductCatalogThumbnail.mxml
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:Container xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ width="{COL_WIDTH_4}" height="{COL_HEIGHT_4}" height.compare="502"
+ width.x4cols="{COL_WIDTH_4}" height.x4cols="{COL_HEIGHT_4}"
+ width.x3cols="{COL_WIDTH_3}" height.x3cols="{COL_HEIGHT_3}"
+ width.x2cols="{COL_WIDTH_2}" height.x2cols="{COL_HEIGHT_2}"
+ rollOver="rollOverHandler(event)"
+ rollOut="rollOutHandler(event)"
+ mouseDown="mouseDownHandler(event)"
+ mouseMove="mouseMoveHandler(event)"
+ mouseUp="mouseUpHandler(event)"
+ click="clickHandler(event)"
+ currentState="x4cols"
+ >
+ <!-- automationName="{product.name}" -->
+ <basic:beads>
+ <basic:ContainerDataBinding />
+ <basic:LayoutChangeNotifier watchedProperty="{details.height}" />
+ </basic:beads>
+ <basic:style>
+ <basic:SimpleCSSStyles borderStyle="solid"
+ borderColor="#FFFFFF" />
+ </basic:style>
+ <fx:Metadata>
+ [Event(name="purchase", type="samples.flexstore.ProductThumbEvent")]
+ [Event(name="compare", type="samples.flexstore.ProductThumbEvent")]
+ [Event(name="details", type="samples.flexstore.ProductThumbEvent")]
+ </fx:Metadata>
+
+ <fx:Script>
+ <![CDATA[
+
+ import org.apache.flex.events.*;
+ import org.apache.flex.utils.PointUtils;
+
+ import samples.flexstore.Product;
+ import samples.flexstore.ProductThumbEvent;
+
+ public static const COL_WIDTH_4:int = 162;
+ public static const COL_HEIGHT_4:int = 122;
+ public static const COL_WIDTH_3:int = 217;
+ public static const COL_HEIGHT_3:int = 165;
+ public static const COL_WIDTH_2:int = 327;
+ public static const COL_HEIGHT_2:int = 250;
+ public static const COMPARE_WIDTH:int = 162;
+ public static const HORIZONTAL_GAP:int = 2;
+ public static const VERTICAL_GAP:int = 3;
+
+ [Bindable]
+ public var product:Product;
+
+ private function rollOverHandler(event:MouseEvent):void
+ {
+ style["borderColor"] = "#CCCCCC";
+ //style["dropShadowEnabled"] = true;
+ buttons.visible = true;
+ }
+
+ private function rollOutHandler(event:MouseEvent):void
+ {
+ style["borderColor"] = "#FFFFFF";
+ //style["dropShadowEnabled"] = false;
+ buttons.visible = false;
+ }
+
+ private var dragStartPoint:Point;
+
+ public function mouseDownHandler(event:MouseEvent):void
+ {
+ if (event.target != purchase &&
+ event.target != compare &&
+ event.target != details)
+ {
+ dragStartPoint = new Point(event.stageX, event.stageY);
+ dragStartPoint = PointUtils.globalToLocal(dragStartPoint, this);
+
+ }
+ }
+
+ public function mouseMoveHandler(event:MouseEvent):void
+ {
+ if (dragStartPoint != null)
+ {
+ var dragEvent:DragEvent = new DragEvent(DragEvent.DRAG_START, true);
+ dragEvent.localX = dragStartPoint.x;
+ dragEvent.localY = dragStartPoint.y;
+ dragEvent.buttonDown = true;
+ dispatchEvent(dragEvent);
+
+ rollOutHandler(event);
+
+ dragStartPoint = null;
+ }
+ }
+
+ public function mouseUpHandler(event:MouseEvent):void
+ {
+ if (dragStartPoint != null)
+ {
+ dragStartPoint = null;
+ }
+ }
+
+ public function clickHandler(event:org.apache.flex.events.Event):void
+ {
+ if (event.target != purchase &&
+ event.target != compare &&
+ event.target != details)
+ {
+ dispatchEvent(new ProductThumbEvent(ProductThumbEvent.DETAILS, product));
+ }
+ }
+
+ ]]>
+ </fx:Script>
+ <fx:Declarations>
+ <basic:CurrencyFormatter currencySymbol="$" id="cf" fractionalDigits="2"/>
+ </fx:Declarations>
+
+ <basic:VContainer id="vb" width="100%" height="100%">
+ <basic:style>
+ <basic:SimpleCSSStyles paddingLeft="6" paddingTop="4" paddingRight="8" paddingBottom="4" />
+ <!-- gap="0"> -->
+ </basic:style>
+
+
+ <basic:Label text="{product.name}" style="fontWeight:bold"/>
+
+ <basic:HContainer width="100%" >
+ <basic:style>
+ <basic:SimpleCSSStyles paddingTop="0" /> <!-- gap="4 -->"
+ </basic:style>
+
+ <basic:Image id="img" height="45" width="45"
+ width.x3cols="60" height.x3cols="60"
+ width.x2cols="60" height.x2cols="60"
+ source="{product.image}" />
+
+ <basic:VContainer id="descr" width="100%" height="100%" >
+ <basic:style>
+ <basic:SimpleCSSStyles paddingTop="0" /> <!-- gap="0" -->
+ </basic:style>
+ <basic:Label text="{product.featureString}" width="80" height="48" />
+ <basic:Label text="{cf.format(product.price)}" style="fontWeight:bold"/>
+ <basic:Spacer height="4"/>
+ <basic:Label text="{product.highlight1}" style="color:#EE8D0C" includeIn="x3cols, x2cols"/>
+ <basic:Label text="{product.highlight2}" style="color:#EE8D0C" includeIn="x3cols, x2cols"/>
+ </basic:VContainer>
+
+ </basic:HContainer>
+
+ <basic:Spacer height="8"/>
+
+ <basic:Label id="compYears" text="Years: {product.experience}" includeIn="compare"/>
+ <basic:Label id="compBlaze" text="BlazeDS: {product.blazeds}" includeIn="compare"/>
+ <basic:Label id="compMobile" text="Mobile: {product.mobile}" includeIn="compare"/>
+ <basic:Label id="compVideo" text="Video: {product.video}" includeIn="compare"/>
+ <basic:Label id="compHigh1" text="Highlight: {product.highlight1}" includeIn="compare"/>
+ <basic:Label id="compHigh2" text="Highlight: {product.highlight2}" includeIn="compare"/>
+ <basic:Label text="Description:" includeIn="compare"/>
+ <basic:Label id="compDesc" text="{product.description}" width="100%" includeIn="compare">
+ <basic:beads>
+ <basic:MultilineTextFieldView />
+ </basic:beads>
+ </basic:Label>
+ </basic:VContainer>
+
+
+ <basic:VContainer id="buttons" visible="false">
+ <basic:style>
+ <basic:SimpleCSSStyles paddingRight="8" right="8" top="12" /> <!-- gap="4" -->
+ </basic:style>
+ <basic:beads>
+ <basic:LayoutChangeNotifier watchedProperty="{purchase.height}" initialValue="0" />
+ <basic:LayoutChangeNotifier watchedProperty="{compare.height}" initialValue="0" />
+ <basic:LayoutChangeNotifier watchedProperty="{details.height}" initialValue="0" />
+ </basic:beads>
+ <basic:ImageButton id="purchase" backgroundImage="assets/button_cart_empty.png"
+ click="dispatchEvent(new ProductThumbEvent(ProductThumbEvent.PURCHASE, product))"
+ width="30">
+ <basic:beads>
+ <basic:ToolTipBead toolTip="Add to cart"/>
+ </basic:beads>
+ </basic:ImageButton>
+ <basic:ImageButton id="compare" backgroundImage="assets/button_compare.png"
+ click="dispatchEvent(new ProductThumbEvent(ProductThumbEvent.COMPARE, product))"
+ width="30">
+ <basic:beads>
+ <basic:ToolTipBead toolTip="Add to compare list"/>
+ </basic:beads>
+ </basic:ImageButton>
+ <basic:ImageButton id="details" backgroundImage="assets/button_details.png"
+ click="dispatchEvent(new ProductThumbEvent(ProductThumbEvent.DETAILS, product))"
+ width="30">
+ <basic:beads>
+ <basic:ToolTipBead toolTip="Show details"/>
+ </basic:beads>
+ </basic:ImageButton>
+ </basic:VContainer>
+
+ <basic:states>
+
+ <mx:State name="compare" />
+
+ <mx:State name="x4cols" />
+
+ <mx:State name="x3cols" />
+
+ <mx:State name="x2cols"/>
+ </basic:states>
+
+</basic:Container>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/productsView/ProductDetails.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/ProductDetails.mxml b/examples/FlexJSStore/src/productsView/ProductDetails.mxml
new file mode 100755
index 0000000..ae128b7
--- /dev/null
+++ b/examples/FlexJSStore/src/productsView/ProductDetails.mxml
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:Container xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:productsView="productsView.*"
+ >
+ <basic:beads>
+ <basic:ContainerDataBinding />
+ </basic:beads>
+
+ <fx:Metadata>
+ [Event(name="purchase", type="samples.flexstore.ProductThumbEvent")]
+ [Event(name="compare", type="samples.flexstore.ProductThumbEvent")]
+ [Event(name="browse", type="samples.flexstore.ProductThumbEvent")]
+ </fx:Metadata>
+
+ <fx:Script>
+ <![CDATA[
+
+ import mx.events.*;
+
+ import samples.flexstore.Product;
+ import samples.flexstore.ProductThumbEvent;
+
+ private var _product:Product;
+
+ [Bindable]
+ public function get product():Product
+ {
+ return _product;
+ }
+
+ public function set product(p:Product):void
+ {
+ _product = p;
+ tn.selectedIndex = 0;
+ }
+
+ ]]>
+ </fx:Script>
+
+ <fx:Declarations>
+ <basic:CurrencyFormatter currencySymbol="$" id="cf" fractionalDigits="2"/>
+ </fx:Declarations>
+
+ <basic:states>
+ <mx:State name="Features" />
+ <mx:State name="Support" />
+ </basic:states>
+
+ <basic:transitions>
+ <basic:Transition>
+ <basic:Fade />
+ </basic:Transition>
+ </basic:transitions>
+
+ <basic:ButtonBar id="tn" width="100%" change="currentState = tn.selectedItem as String">
+ <basic:dataProvider>
+ <fx:Array>
+ <fx:String>Features</fx:String>
+ <fx:String>Support</fx:String>
+ </fx:Array>
+ </basic:dataProvider>
+ </basic:ButtonBar>
+ <basic:Container width="100%" height="100%" >
+ <basic:style>
+ <basic:SimpleCSSStyles left="4" right="8" top="34" bottom="4" />
+ </basic:style>
+
+
+ <basic:VContainer width="100%" height="100%" includeIn="Features" >
+ <basic:style>
+ <!--<basic:SimpleCSSStyles gap="8"-->
+ <basic:SimpleCSSStyles
+ paddingLeft="8" paddingTop="8" paddingRight="8" paddingBottom="8"/>
+ </basic:style>
+ <basic:HContainer width="100%" style="gap:12">
+
+ <basic:Image id="img" width="101" height="101" source="{product.image}"/>
+
+ <basic:VContainer id="descr" width="100%" height="100%">
+ <basic:style>
+ <basic:SimpleCSSStyles paddingTop="0" />
+ <!--<basic:SimpleCSSStyles paddingTop="0" gap="4" />-->
+ </basic:style>
+
+ <basic:Label text="{product.name}" style="fontSize:11;fontWeight:'bold'"/>
+
+ <basic:Label text="{product.featureString}" width="80" height="48" />
+
+ <basic:Label text="{product.highlight1}" style="color:#EE8D0C"/>
+
+ <basic:Label text="{product.highlight2}" style="color:#EE8D0C"/>
+
+ <basic:Label text="{cf.format(product.price)}" style="fontWeight:'bold'"/>
+
+ </basic:VContainer>
+ </basic:HContainer>
+
+ <basic:Label id="descriptionText" width="100%" height="100%" text="{product.description}"/>
+
+ </basic:VContainer>
+
+ <productsView:ProductSupport width="100%" height="100%" includeIn="Support" />
+
+ </basic:Container>
+
+ <basic:VContainer>
+ <basic:beads>
+ <basic:LayoutChangeNotifier watchedProperty="{purchase.height}" initialValue="0" />
+ <basic:LayoutChangeNotifier watchedProperty="{compare.height}" initialValue="0" />
+ <basic:LayoutChangeNotifier watchedProperty="{tiles.height}" initialValue="0" />
+ </basic:beads>
+ <basic:style>
+ <basic:SimpleCSSStyles marginTop="4" right="16" top="36" />
+ </basic:style>
+ <basic:Spacer width="100%"/>
+ <basic:ImageButton id="purchase" backgroundImage="assets/button_cart_empty.png" click="dispatchEvent(new ProductThumbEvent(ProductThumbEvent.PURCHASE, product))" width="30">
+ <basic:beads>
+ <basic:ToolTipBead toolTip="Add to cart"/>
+ </basic:beads>
+ </basic:ImageButton>
+ <basic:ImageButton id="compare" backgroundImage="assets/button_compare.png" click="dispatchEvent(new ProductThumbEvent(ProductThumbEvent.COMPARE, product))" width="30">
+ <basic:beads>
+ <basic:ToolTipBead toolTip="Add to compare list"/>
+ </basic:beads>
+ </basic:ImageButton>
+ <basic:ImageButton id="tiles" backgroundImage="assets/button_tiles.png" click="dispatchEvent(new ProductThumbEvent(ProductThumbEvent.BROWSE, product));" width="30">
+ <basic:beads>
+ <basic:ToolTipBead toolTip="Back to thumbnail view"/>
+ </basic:beads>
+ </basic:ImageButton>
+ </basic:VContainer>
+
+</basic:Container>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/productsView/ProductFilterPanel.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/ProductFilterPanel.mxml b/examples/FlexJSStore/src/productsView/ProductFilterPanel.mxml
new file mode 100755
index 0000000..c32ba78
--- /dev/null
+++ b/examples/FlexJSStore/src/productsView/ProductFilterPanel.mxml
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:VContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:productsView="productsView.*"
+ xmlns:flexstore="samples.flexstore.*"
+ height="100%"
+ currentState="showingThumbnails"
+ initComplete="series.selectedIndex = 0">
+ <basic:style>
+ <basic:SimpleCSSStyles paddingLeft="4"
+ paddingRight="12"
+ paddingTop="12"
+ paddingBottom="8"
+ />
+
+ </basic:style>
+
+ <fx:Metadata>
+ [Event(name="filter", type="samples.flexstore.ProductFilterEvent")]
+ [Event("compare")]
+ </fx:Metadata>
+
+ <fx:Script>
+ <![CDATA[
+ import org.apache.flex.html.Slider;
+ import org.apache.flex.html.SimpleAlert;
+ import samples.flexstore.ProductFilterEvent;
+
+ private var thumbBeingPressed:Boolean;
+
+ private function dispatchFilter():void
+ {
+ var event:ProductFilterEvent =
+ new ProductFilterEvent(filter, thumbBeingPressed);
+ dispatchEvent(event);
+ currentState = "showingThumbnails";
+ }
+
+ private function sliderValue(values:Array, index:int):Number
+ {
+ return values[index];
+ }
+
+ private function productRemoved():void
+ {
+ if (currentState == "showingComparison")
+ {
+ if (productList.items.length == 0)
+ {
+ dispatchFilter();
+ }
+ else
+ {
+ attemptCompare();
+ }
+ }
+ }
+
+ private function attemptCompare():void
+ {
+ if (productList.items.length > 0)
+ {
+ dispatchEvent(new Event("compare"));
+ currentState = "showingComparison";
+ }
+ else
+ {
+ SimpleAlert.show("There are no items to compare.", "Compare");
+ }
+ }
+
+ ]]>
+ </fx:Script>
+ <fx:Declarations>
+ <flexstore:ProductFilter id="filter">
+ <flexstore:experience>{series.selectedItem}</flexstore:experience>
+ <flexstore:minPrice>{loPrice.value}</flexstore:minPrice>
+ <flexstore:maxPrice>{hiPrice.value}</flexstore:maxPrice>
+ <flexstore:blazeds>{cbBlazeDS.selected}</flexstore:blazeds>
+ <flexstore:mobile>{cbMobile.selected}</flexstore:mobile>
+ <flexstore:video>{cbVideo.selected}</flexstore:video>
+ </flexstore:ProductFilter>
+
+ <basic:CurrencyFormatter currencySymbol="$" id="cf"/>
+
+ </fx:Declarations>
+ <basic:beads>
+ <basic:ContainerDataBinding />
+ </basic:beads>
+
+ <basic:Label text="Find" className="sectionHeader"/>
+
+ <basic:Container width="100%">
+ <basic:beads>
+ <basic:FlexibleFirstChildHorizontalLayout />
+ </basic:beads>
+ <basic:TextInput className="glass" width="100%"/>
+ <basic:TextButton className="glass" text="Go" click="SimpleAlert.show('This feature is not implemented in this sample', 'Find')"/>
+ </basic:Container>
+
+ <basic:Spacer height="18"/>
+
+ <basic:HRule width="100%"/>
+
+ <basic:Spacer height="8"/>
+
+ <basic:HContainer>
+ <basic:style>
+ <basic:SimpleCSSStyles paddingTop="0" paddingLeft="0" verticalAlign="bottom" />
+ </basic:style>
+ <basic:Label text="Filter" className="sectionHeader"/>
+ <basic:Label text="({filter.count} items selected)" >
+ <basic:style>
+ <basic:SimpleCSSStyles fontWeight="bold" />
+ <!--<basic:SimpleCSSStyles color="{getStyle('themeColor')}" fontWeight="bold" />-->
+ </basic:style>
+ </basic:Label>
+ </basic:HContainer>
+
+ <basic:Spacer height="8"/>
+
+ <basic:Label text="Years of Experience"/>
+
+ <basic:DropDownList id="series" className="glass" width="140" change="dispatchFilter();">
+ <basic:dataProvider>
+ <fx:Array>
+ <fx:String>All</fx:String>
+ <fx:String>3</fx:String>
+ <fx:String>5</fx:String>
+ <fx:String>7</fx:String>
+ <fx:String>9</fx:String>
+ </fx:Array>
+ </basic:dataProvider>
+ </basic:DropDownList>
+
+ <basic:Spacer height="18"/>
+
+ <basic:Label text="Price"/>
+
+ <!--<s:HSlider id="priceSlider" className="glassSlider" minimum="0" maximum="200" tickInterval="10" snapInterval="10"
+ width="100%" thumbCount="2" values="[0,200]" labels="[$0,$200]" liveDragging="true" dataTipFormatFunction="{cf.format}"
+ change="dispatchFilter()"
+ thumbPress="thumbBeingPressed=true"
+ thumbRelease="thumbBeingPressed=false;dispatchFilter()"
+ />-->
+ <basic:HContainer>
+ <basic:NumericStepper width="48%" id="loPrice" minimum="0" maximum="{hiPrice.value}" value="0" valueChange="dispatchFilter()" />
+ <basic:NumericStepper width="48%" id="hiPrice" minimum="{loPrice.value}" maximum="200" value="200" valueChange="dispatchFilter()" />
+ </basic:HContainer>
+
+ <basic:Spacer height="18"/>
+
+ <basic:Label text="Required Features"/>
+
+ <basic:Spacer height="4"/>
+
+ <basic:CheckBox id="cbBlazeDS" className="glass" text="BlazeDS" click="dispatchFilter();"/>
+ <basic:Spacer height="4"/>
+ <basic:CheckBox id="cbMobile" className="glass" text="Mobile" click="dispatchFilter()"/>
+ <basic:Spacer height="4"/>
+ <basic:CheckBox id="cbVideo" className="glass" text="Video" click="dispatchFilter();"/>
+
+ <basic:Spacer height="18"/>
+
+ <basic:HRule width="100%"/>
+
+ <basic:Spacer height="8"/>
+
+ <basic:HContainer>
+ <basic:Label text="Compare" className="sectionHeader"/>
+ <basic:Label text="(Drag items here to compare)" className="instructions"/>
+ </basic:HContainer>
+
+
+ <basic:Spacer height="4"/>
+
+ <!-- height is maxItems * ProductListItem.HEIGHT + 2px border -->
+ <productsView:ProductList id="productList" height="{productList.maxItems * ProductListItem.HEIGHT + 2}" width="100%"
+ newItemStartX="300" newItemStartY="-100" maxItems="4"
+ removeProduct="productRemoved()"/>
+
+ <basic:Spacer height="8"/>
+
+ <basic:TextButton id="compareButton" className="glass"
+ click.showingThumbnails="attemptCompare()"
+ click.showingComparison="dispatchFilter()"
+ text.showingComparison="Back to thumbnail view"
+ text.showingThumbnails="Compare Items"
+ >
+ <basic:beads>
+ <basic:ImageAndTextButtonView
+ image.showingThumbnails="assets/icon_compare.png"
+ image.showingComparison="assets/icon_tiles.png" />
+ </basic:beads>
+ </basic:TextButton>
+
+ <basic:states>
+ <mx:State name="showingThumbnails" />
+ <mx:State name="showingComparison" />
+ </basic:states>
+
+</basic:VContainer>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/productsView/ProductList.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/ProductList.mxml b/examples/FlexJSStore/src/productsView/ProductList.mxml
new file mode 100755
index 0000000..2d54ed7
--- /dev/null
+++ b/examples/FlexJSStore/src/productsView/ProductList.mxml
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:Container xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ >
+ <basic:style>
+ <basic:SimpleCSSStyles borderStyle="solid" backgroundColor="#BCB29F" />
+ </basic:style>
+ <!-- need a background color for drag and drop but can set alpha to 0 -->
+
+ <fx:Metadata>
+ [Event(name="addProduct", type="samples.flexstore.ProductListEvent")]
+ [Event(name="duplicateProduct", type="samples.flexstore.ProductListEvent")]
+ [Event(name="productQtyChange", type="samples.flexstore.ProductListEvent")]
+ [Event(name="removeProduct", type="samples.flexstore.ProductListEvent")]
+ </fx:Metadata>
+
+ <fx:Script>
+ <![CDATA[
+ import org.apache.flex.effects.Effect;
+ import org.apache.flex.effects.Move;
+ import org.apache.flex.effects.Sequence;
+ import org.apache.flex.core.DropType;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.events.DragEvent;
+
+ import samples.flexstore.Product;
+ import samples.flexstore.ProductListEvent;
+
+ public var items:Array = [];
+
+ public var newItemStartX:int;
+ public var newItemStartY:int;
+ [Bindable]
+ public var maxItems:int;
+ public var showQuantity:Boolean;
+
+ private var playingEffects:Object = new Object();
+
+ public function addProduct(product:Product):void
+ {
+ var index:int = indexOf(product.productId);
+ var event:ProductListEvent;
+ var item:ProductListItem;
+
+ if (index != -1)
+ {
+ item = items[index] as ProductListItem;
+ //if we don't keep track of what's playing a double-click can
+ //cause the list item to keep rising
+ if (playingEffects[item.uid] == null)
+ {
+ var jump:Sequence = new Sequence();
+ var m1:Move = new Move(item)
+ m1.yBy = -5;
+ var m2:Move = new Move(item)
+ m2.yBy = 5;
+ jump.addChild(m1);
+ jump.addChild(m2);
+ jump.duration = 150;
+ playingEffects[item.uid] = jump;
+ jump.addEventListener(Effect.EFFECT_END, function(event:Event):void
+ {
+ delete playingEffects[item.uid];
+ });
+ jump.play();
+ }
+ event = new ProductListEvent(ProductListEvent.DUPLICATE_PRODUCT);
+ event.product = item.product;
+ dispatchEvent(event);
+ }
+ else
+ {
+ index = items.length;
+ if (maxItems <= 0 || index < maxItems)
+ {
+ item = new ProductListItem();
+ if (showQuantity)
+ {
+ item.currentState = 'showQuantity';
+ }
+ item.product = product;
+ item.percentWidth = 100;
+ item.addEventListener(ProductListEvent.REMOVE_PRODUCT, removeItemHandler);
+ items[index] = item;
+ viewport.addElement(item);
+ layoutItems(index, true);
+ event = new ProductListEvent(ProductListEvent.ADD_PRODUCT);
+ event.product = product;
+ dispatchEvent(event);
+ }
+ }
+ }
+
+ public function getProducts():Array
+ {
+ var ret:Array = [];
+ for (var i:int = 0; i < items.length; i++)
+ {
+ ret[i] = items[i].product;
+ }
+ return ret;
+ }
+
+ private function removeItemHandler(event:Event):void
+ {
+ var item:ProductListItem = event.target as ProductListItem;
+ var index:int = indexOf(item.product.productId);
+ items.splice(index, 1);
+ viewport.removeElement(item);
+ layoutItems(index);
+ }
+
+ private function layoutItems(startIndex:int, scrollToBottom:Boolean=false):void
+ {
+ var n:int = items.length;
+ var e:Move;
+ for (var i:int = startIndex; i < n ; i++)
+ {
+ var item:ProductListItem = items[i];
+ var yTo:Number = i * (item.height);
+ //still need to prevent items that are already in motion from getting
+ //jumpy
+ if (playingEffects[item.uid] == null)
+ {
+ e = new Move(item);
+ if (item.x == 0 && item.y == 0)
+ {
+ e.xFrom = newItemStartX;
+ e.yFrom = newItemStartY;
+ }
+
+ e.xTo = 0;
+ e.yTo = yTo;
+ playingEffects[item.uid] = e;
+ e.addEventListener(Effect.EFFECT_END, function(event:Event):void
+ {
+ delete playingEffects[item.uid];
+ });
+ e.play();
+ }
+ else
+ {
+ playingEffects[item.uid].pause();
+ playingEffects[item.uid].yTo = yTo;
+ playingEffects[item.uid].play();
+ }
+ }
+ //get the last event and if we should scroll make sure we can validate
+ //and scroll to maxVPosition
+ if (scrollToBottom)
+ {
+ e.addEventListener(Effect.EFFECT_END, function(event:Event):void
+ {
+ scrollingView.verticalScrollPosition = scrollingView.maxVerticalScrollPosition;
+ });
+ }
+ }
+
+ private function indexOf(productId:int):int
+ {
+ var index:int = -1;
+
+ var n:int = items.length;
+ for (var i:int = 0; i < items.length; i++)
+ {
+ if (items[i].product.productId == productId)
+ {
+ index = i;
+ break;
+ }
+ }
+
+ return index;
+ }
+
+ private function doDragEnter(event:DragEvent):void
+ {
+ trace("doDragEnter");
+ dmc.acceptDragDrop(event.target as IUIBase, DropType.COPY);
+ }
+
+ private function doDragDrop(event:DragEvent):void
+ {
+ trace("doDragDrop");
+ var product:Product = event.dragSource as Product;
+ addProduct(product);
+ }
+
+ ]]>
+ </fx:Script>
+ <basic:beads>
+ <basic:DropMouseController id="dmc" dragEnter="doDragEnter(event)" dragDrop="doDragDrop(event)" />
+ <basic:ScrollingContainerView id="scrollingView" />
+ <basic:NonVirtualVerticalScrollingLayout />
+ </basic:beads>
+ <basic:Container id="viewport" width="100%" height="100%" >
+ </basic:Container>
+</basic:Container>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/productsView/ProductListItem.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/ProductListItem.mxml b/examples/FlexJSStore/src/productsView/ProductListItem.mxml
new file mode 100755
index 0000000..b4fe57d
--- /dev/null
+++ b/examples/FlexJSStore/src/productsView/ProductListItem.mxml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:Container xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ className="listItem"
+ height="{ProductListItem.HEIGHT}" implements="org.apache.flex.core.IItemRenderer">
+ <!--automationName="{product.name}">-->
+
+ <fx:Metadata>
+ [Event(name="productQtyChange", type="samples.flexstore.ProductListEvent")]
+ [Event(name="removeProduct", type="samples.flexstore.ProductListEvent")]
+ </fx:Metadata>
+
+ <fx:Script>
+ <![CDATA[
+
+ import samples.flexstore.Product;
+ import samples.flexstore.ProductListEvent;
+
+ private static var idCounter:int = 0;
+ public var uid:String = (idCounter++).toString();
+
+ public static const HEIGHT:int = 30;
+
+ [Bindable("__NoChangeEvent__")]
+ public function get product():Product
+ {
+ return _data as Product;
+ }
+ public function set product(value:Product):void
+ {
+ _data = value;
+ }
+
+ private var _data:Object;
+
+ public function get data():Object
+ {
+ return _data;
+ }
+
+ public function set data(value:Object):void
+ {
+ _data = value;
+ }
+
+ private var _itemRendererParent:Object;
+
+ public function get itemRendererParent():Object
+ {
+ return _itemRendererParent;
+ }
+
+ public function set itemRendererParent(value:Object):void
+ {
+ _itemRendererParent = value;
+ }
+
+ private function qtyChange():void
+ {
+ product.qty = int(qty.text);
+ var event:ProductListEvent = new ProductListEvent(ProductListEvent.PRODUCT_QTY_CHANGE);
+ event.product = product;
+ dispatchEvent(event);
+ }
+
+ private function removeItem():void
+ {
+ var event:ProductListEvent = new ProductListEvent(ProductListEvent.REMOVE_PRODUCT);
+ event.product = product;
+ dispatchEvent(event);
+ }
+
+ ]]>
+ </fx:Script>
+
+ <fx:Declarations>
+ <basic:CurrencyFormatter currencySymbol="$" id="cf" fractionalDigits="2"/>
+ </fx:Declarations>
+
+ <basic:beads>
+ <basic:ContainerDataBinding />
+ </basic:beads>
+
+ <basic:ImageButton id="removeButton" backgroundImage="assets/trashcan.png"
+ width="14" height="14"
+ click="removeItem()">
+ <basic:beads>
+ <basic:ToolTipBead toolTip="Remove from cart" />
+ </basic:beads>
+ </basic:ImageButton>
+
+ <basic:Image id="productImage" x="14" width="12" height="12" source="{product.image}"/>
+
+ <basic:Label id="productName" x="26" width="100" text="{product.name}"/>
+
+ <basic:Label id="productPrice" width="60"
+ text="{cf.format(product.price)}" style="textAlign:right;right:0"
+ style.showQuantity="textAlign:right;right:25"/>
+
+ <basic:TextInput id="qty" width="25" text="{product.qty}" includeIn="showQuantity"
+ style="textAlign:right;right:0" change="qtyChange()" >
+ <basic:beads>
+ <basic:NumericOnlyTextInputBead maxChars="3" />
+ </basic:beads>
+ </basic:TextInput>
+
+ <basic:states>
+ <mx:State name="compare" />
+ <mx:State name="showQuantity" />
+ </basic:states>
+
+</basic:Container>
[10/14] git commit: [flex-asjs] [refs/heads/develop] - add visible to
IUIBase
Posted by ah...@apache.org.
add visible to IUIBase
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f52c9372
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f52c9372
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f52c9372
Branch: refs/heads/develop
Commit: f52c937262b130281d0d0486c20db0b3958cad4b
Parents: ea9803c
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 31 14:23:06 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 31 15:08:15 2014 -0700
----------------------------------------------------------------------
.../FlexJSUI/src/org/apache/flex/core/IUIBase.as | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f52c9372/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IUIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IUIBase.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IUIBase.as
index 445241b..4b2a72f 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IUIBase.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IUIBase.as
@@ -108,5 +108,16 @@ package org.apache.flex.core
function get height():Number;
function set height(value:Number):void;
+ /**
+ * Whether the component is visible.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get visible():Boolean;
+ function set visible(value:Boolean):void;
+
}
}
\ No newline at end of file
[12/14] FlexJSStore works well enough to try to make it work on JS.
Drag/Drop, ToolTips, States with Transitions are functional
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/productsView/ProductSupport.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/ProductSupport.mxml b/examples/FlexJSStore/src/productsView/ProductSupport.mxml
new file mode 100755
index 0000000..c28570e
--- /dev/null
+++ b/examples/FlexJSStore/src/productsView/ProductSupport.mxml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:HContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ >
+ <basic:style>
+ <basic:SimpleCSSStyles paddingLeft="4" paddingRight="8" paddingBottom="4" />
+ </basic:style>
+ <basic:beads>
+ <basic:ContainerDataBinding />
+ </basic:beads>
+
+ <fx:Script>
+ <![CDATA[
+
+ private function toggle():void
+ {
+ /*
+ if (vd.playing)
+ {
+ vd.stop();
+ list.visible = true;
+ }
+ else
+ {
+ list.visible = false;
+ vd.play();
+ }
+ */
+ }
+
+ ]]>
+ </fx:Script>
+
+ <fx:Declarations>
+ <basic:Parallel id="hideList">
+ <basic:children>
+ <fx:Array>
+ <basic:Resize target="{list}" widthTo="0"/>
+ <!--<mx:Resize target="{vd}" widthTo="400" heightTo="314"/>-->
+ </fx:Array>
+ </basic:children>
+ </basic:Parallel>
+
+ <basic:Parallel id="showList">
+ <basic:children>
+ <fx:Array>
+ <basic:Resize target="{list}" widthTo="130"/>
+ <!--<mx:Resize target="{vd}" widthTo="270" heightTo="217"/>-->
+ </fx:Array>
+ </basic:children>
+ </basic:Parallel>
+ </fx:Declarations>
+ <basic:List id="list" width="130" height="100%" selectedIndex="0">
+ <basic:dataProvider>
+ <fx:Array>
+ <fx:Object label="Install SIM Card"/>
+ </fx:Array>
+ </basic:dataProvider>
+ </basic:List>
+
+ <basic:Container width="100%">
+
+ <!--<mx:VideoDisplay id="vd" width="270" height="217" source="assets/phone.flv"
+ autoPlay="false" complete="list.visible=true"/>
+
+ <mx:Button label="{vd.playing ? 'Stop' : 'Play'}" click="toggle()" left="8" bottom="8" includeInLayout="false">
+ </mx:Button>
+ -->
+ </basic:Container>
+
+
+</basic:HContainer>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/samples/flexstore/ButtonBarButtonSkin.as
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/samples/flexstore/ButtonBarButtonSkin.as b/examples/FlexJSStore/src/samples/flexstore/ButtonBarButtonSkin.as
new file mode 100755
index 0000000..5e94b58
--- /dev/null
+++ b/examples/FlexJSStore/src/samples/flexstore/ButtonBarButtonSkin.as
@@ -0,0 +1,298 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 samples.flexstore
+{
+
+import flash.display.GradientType;
+import mx.containers.BoxDirection;
+import mx.controls.Button;
+import mx.controls.ButtonBar;
+import mx.skins.Border;
+import mx.skins.halo.*;
+import mx.styles.StyleManager;
+import mx.utils.ColorUtil;
+
+/**
+ * Adapted from mx.skins.halo.ButtonBarButtonSkin.
+ * This version of the ButtonBarButtonSkin is applied for the
+ * selectedOver, selectedUp, and over states to use the 2nd two
+ * values of the fillColors for the selected state of the
+ * button. The over state then uses a computed value from
+ * the themeColor to show emphasis. The border of the selected
+ * button also uses a computed value from the themeColor, but
+ * is partially transparent.
+ */
+public class ButtonBarButtonSkin extends Border
+{
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private static var cache:Object = {};
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Several colors used for drawing are calculated from the base colors
+ * of the component (themeColor, borderColor and fillColors).
+ * Since these calculations can be a bit expensive,
+ * we calculate once per color set and cache the results.
+ */
+ private static function calcDerivedStyles(themeColor:uint,
+ fillColor0:uint,
+ fillColor1:uint):Object
+ {
+ var key:String = HaloColors.getCacheKey(themeColor,
+ fillColor0, fillColor1);
+
+ if (!cache[key])
+ {
+ var o:Object = cache[key] = {};
+
+ // Cross-component styles.
+ HaloColors.addHaloColors(o, themeColor, fillColor0, fillColor1);
+
+ // Button-specific styles.
+ o.innerEdgeColor1 = ColorUtil.adjustBrightness2(fillColor0, -10);
+ o.innerEdgeColor2 = ColorUtil.adjustBrightness2(fillColor1, -25);
+ }
+
+ return cache[key];
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Constructor.
+ */
+ public function ButtonBarButtonSkin()
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // measuredWidth
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ override public function get measuredWidth():Number
+ {
+ return 50;
+ }
+
+ //----------------------------------
+ // measuredHeight
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ override public function get measuredHeight():Number
+ {
+ return 22;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override protected function updateDisplayList(w:Number, h:Number):void
+ {
+ super.updateDisplayList(w, h);
+
+ // User-defined styles.
+ var borderColor:uint = getStyle("borderColor");
+ var cornerRadius:Number = getStyle("cornerRadius");
+ var fillAlphas:Array = getStyle("fillAlphas");
+ var fillColors:Array = getStyle("fillColors");
+ styleManager.getColorNames(fillColors);
+ var highlightAlphas:Array = getStyle("highlightAlphas");
+ var themeColor:uint = getStyle("themeColor");
+
+ // Derivative styles.
+ var derStyles:Object = calcDerivedStyles(themeColor, fillColors[0],
+ fillColors[1]);
+
+ var borderColorDrk1:Number =
+ ColorUtil.adjustBrightness2(borderColor, -50);
+
+ var themeColorDrk1:Number =
+ ColorUtil.adjustBrightness2(themeColor, -25);
+
+ var emph:Boolean = false;
+
+ if (parent is Button)
+ emph = (parent as Button).emphasized;
+
+ var tmp:Number;
+
+ var bar:ButtonBar = parent ? ButtonBar(parent.parent) : null;
+ var horizontal:Boolean = true;
+ var pos:int = 0;
+
+ if (bar)
+ {
+ if (bar.direction == BoxDirection.VERTICAL)
+ horizontal = false;
+
+ // first: -1, middle: 0, last: 1
+ var index:int = bar.getChildIndex(parent);
+ pos = (index == 0 ? -1 : (index == bar.numChildren - 1 ? 1 : 0));
+ }
+
+ var radius:Object = getCornerRadius(pos, horizontal, cornerRadius);
+ var cr:Object = getCornerRadius(pos, horizontal, cornerRadius);
+ var cr1:Object = getCornerRadius(pos, horizontal, cornerRadius - 1);
+ var cr2:Object = getCornerRadius(pos, horizontal, cornerRadius - 2);
+ var cr3:Object = getCornerRadius(pos, horizontal, cornerRadius - 3);
+
+ graphics.clear();
+
+ switch (name)
+ {
+ case "selectedUpSkin":
+ case "selectedOverSkin":
+ {
+ var overFillColors:Array;
+ if (fillColors.length > 2)
+ overFillColors = [ fillColors[2], fillColors[3] ];
+ else
+ overFillColors = [ fillColors[0], fillColors[1] ];
+
+ var overFillAlphas:Array;
+ if (fillAlphas.length > 2)
+ overFillAlphas = [ fillAlphas[2], fillAlphas[3] ];
+ else
+ overFillAlphas = [ fillAlphas[0], fillAlphas[1] ];
+
+ // button border/edge
+ drawRoundRect(
+ 0, 0, w, h, cr,
+ [ themeColor, derStyles.themeColDrk1 ], 0.5,
+ verticalGradientMatrix(0, 0, w , h),
+ GradientType.LINEAR, null,
+ { x: 1, y: 1, w: w - 2, h: h - 2, r: cr1 });
+
+ // button fill
+ drawRoundRect(
+ 1, 1, w - 2, h - 2, cr1,
+ overFillColors, overFillAlphas,
+ verticalGradientMatrix(0, 0, w - 2, h - 2));
+
+ // top highlight
+ if (!(radius is Number))
+ { radius.bl = radius.br = 0;}
+ drawRoundRect(
+ 1, 1, w - 2, (h - 2) / 2, radius,
+ [ 0xFFFFFF, 0xFFFFFF ], highlightAlphas,
+ verticalGradientMatrix(1, 1, w - 2, (h - 2) / 2));
+ break;
+ }
+
+ case "overSkin":
+ {
+ // button border/edge
+ drawRoundRect(
+ 0, 0, w, h, cr,
+ [ themeColor, derStyles.themeColDrk1 ], 0.5,
+ verticalGradientMatrix(0, 0, w, h));
+
+ // button fill
+ drawRoundRect(
+ 1, 1, w - 2, h - 2, cr1,
+ [ derStyles.fillColorPress1, derStyles.fillColorPress2 ], 1,
+ verticalGradientMatrix(0, 0, w - 2, h - 2));
+
+ // top highlight
+ if (!(radius is Number))
+ { radius.bl = radius.br = 0;}
+ drawRoundRect(
+ 1, 1, w - 2, (h - 2) / 2, radius,
+ [ 0xFFFFFF, 0xFFFFFF ], highlightAlphas,
+ verticalGradientMatrix(1, 1, w - 2, (h - 2) / 2));
+
+ break;
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private function getCornerRadius(pos:int, horizontal:Boolean,
+ radius:Number):Object
+ {
+ if (pos == 0)
+ return 0;
+
+ radius = Math.max(0, radius);
+
+ if (horizontal)
+ {
+ if (pos == -1)
+ return { tl: radius, tr: 0, bl: radius, br: 0 };
+ else // pos == 1
+ return { tl: 0, tr: radius, bl: 0, br: radius };
+ }
+ else
+ {
+ if (pos == -1)
+ return { tl: radius, tr: radius, bl: 0, br: 0 };
+ else // pos == 1
+ return { tl: 0, tr: 0, bl: radius, br: radius };
+ }
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/samples/flexstore/Product.as
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/samples/flexstore/Product.as b/examples/FlexJSStore/src/samples/flexstore/Product.as
new file mode 100755
index 0000000..040fb8f
--- /dev/null
+++ b/examples/FlexJSStore/src/samples/flexstore/Product.as
@@ -0,0 +1,78 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 samples.flexstore
+{
+
+[Bindable]
+public class Product
+{
+
+ public var productId:int;
+ public var name:String;
+ public var description:String;
+ public var price:Number;
+ public var image:String;
+ public var experience:String;
+ public var blazeds:Boolean;
+ public var mobile:Boolean;
+ public var video:Boolean;
+ public var highlight1:String;
+ public var highlight2:String;
+ public var qty:int;
+
+ public function Product()
+ {
+
+ }
+
+ public function fill(obj:Object):void
+ {
+ for (var i:String in obj)
+ {
+ this[i] = obj[i];
+ }
+ }
+
+ [Bindable(event="propertyChange")]
+ public function get featureString():String
+ {
+ var str:String = "";
+ if (blazeds)
+ str += "BlazeDS";
+
+ if (mobile)
+ {
+ if (str.length > 0)
+ str += "\n";
+ str += "Mobile";
+ }
+
+ if (video)
+ {
+ if (str.length > 0)
+ str += "\n";
+ str += "Video";
+ }
+
+ return str;
+ }
+
+}
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/samples/flexstore/ProductFilter.as
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/samples/flexstore/ProductFilter.as b/examples/FlexJSStore/src/samples/flexstore/ProductFilter.as
new file mode 100755
index 0000000..d182371
--- /dev/null
+++ b/examples/FlexJSStore/src/samples/flexstore/ProductFilter.as
@@ -0,0 +1,56 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 samples.flexstore
+{
+
+[Bindable]
+public class ProductFilter
+{
+ public var count:int;
+ public var experience:String;
+ public var minPrice:Number;
+ public var maxPrice:Number;
+ public var blazeds:Boolean;
+ public var mobile:Boolean;
+ public var video:Boolean;
+
+ public function ProductFilter()
+ {
+ super();
+ }
+
+ public function accept(product:Product):Boolean
+ {
+ //price is often the first test so let's fail fast if possible
+ if (minPrice > product.price || maxPrice < product.price)
+ return false;
+ if (experience != "All" && experience > product.experience)
+ return false;
+ if (blazeds && !product.blazeds)
+ return false;
+ if (mobile && !product.mobile)
+ return false;
+ if (video && !product.video)
+ return false;
+
+ return true;
+ }
+}
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/samples/flexstore/ProductFilterEvent.as
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/samples/flexstore/ProductFilterEvent.as b/examples/FlexJSStore/src/samples/flexstore/ProductFilterEvent.as
new file mode 100755
index 0000000..b13af3e
--- /dev/null
+++ b/examples/FlexJSStore/src/samples/flexstore/ProductFilterEvent.as
@@ -0,0 +1,39 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 samples.flexstore
+{
+
+import flash.events.Event;
+
+public class ProductFilterEvent extends Event
+{
+ public static const FILTER:String = "filter";
+
+ public var live:Boolean;
+ public var filter:ProductFilter;
+
+ public function ProductFilterEvent(filter:ProductFilter, live:Boolean)
+ {
+ super(FILTER);
+ this.filter = filter;
+ this.live = live;
+ }
+}
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/samples/flexstore/ProductListEvent.as
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/samples/flexstore/ProductListEvent.as b/examples/FlexJSStore/src/samples/flexstore/ProductListEvent.as
new file mode 100755
index 0000000..fb4992f
--- /dev/null
+++ b/examples/FlexJSStore/src/samples/flexstore/ProductListEvent.as
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 samples.flexstore
+{
+
+import flash.events.Event;
+
+public class ProductListEvent extends Event
+{
+ public static const ADD_PRODUCT:String = "addProduct";
+ public static const DUPLICATE_PRODUCT:String = "duplicateProduct";
+ public static const REMOVE_PRODUCT:String = "removeProduct";
+ public static const PRODUCT_QTY_CHANGE:String = "productQtyChange";
+
+ public var product:Product;
+
+ //making the default bubbles behavior of the event to true since we want
+ //it to bubble out of the ProductListItem and beyond
+ public function ProductListEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+ {
+ super(type, bubbles, cancelable);
+ }
+
+}
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/samples/flexstore/ProductThumbEvent.as
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/samples/flexstore/ProductThumbEvent.as b/examples/FlexJSStore/src/samples/flexstore/ProductThumbEvent.as
new file mode 100755
index 0000000..e967daf
--- /dev/null
+++ b/examples/FlexJSStore/src/samples/flexstore/ProductThumbEvent.as
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 samples.flexstore
+{
+
+import flash.events.Event;
+
+public class ProductThumbEvent extends Event
+{
+ public static const PURCHASE:String = "purchase";
+ public static const COMPARE:String = "compare";
+ public static const DETAILS:String = "details";
+ public static const BROWSE:String = "browse";
+
+ public var product:Product;
+
+ public function ProductThumbEvent(type:String, product:Product)
+ {
+ super(type);
+ this.product = product;
+ }
+
+ override public function clone():Event
+ {
+ return new ProductThumbEvent(type, product);
+ }
+}
+
+}
\ No newline at end of file
Re: [14/14] git commit: [flex-asjs] [refs/heads/develop] -
FlexJSStore works well enough to try to make it work on JS. Drag/Drop,
ToolTips, States with Transitions are functional
Posted by OmPrakash Muppirala <bi...@gmail.com>.
Wow, this is a fantastic milestone!
On Fri, Oct 31, 2014 at 3:08 PM, <ah...@apache.org> wrote:
> FlexJSStore works well enough to try to make it work on JS. Drag/Drop,
> ToolTips, States with Transitions are functional
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f2a370c6
> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f2a370c6
> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f2a370c6
>
[14/14] git commit: [flex-asjs] [refs/heads/develop] - FlexJSStore
works well enough to try to make it work on JS. Drag/Drop, ToolTips,
States with Transitions are functional
Posted by ah...@apache.org.
FlexJSStore works well enough to try to make it work on JS. Drag/Drop, ToolTips, States with Transitions are functional
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f2a370c6
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f2a370c6
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f2a370c6
Branch: refs/heads/develop
Commit: f2a370c669de2a62292a65ff58cae96cb90e3c31
Parents: 0cce95a
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 31 15:07:34 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 31 15:08:16 2014 -0700
----------------------------------------------------------------------
examples/FlexJSStore/build.xml | 51 ++
examples/FlexJSStore/src/FlexJSStore.mxml | 269 +++++++++
examples/FlexJSStore/src/HomeView.mxml | 206 +++++++
.../FlexJSStore/src/ProductJSONItemConverter.as | 41 ++
examples/FlexJSStore/src/ProductsView.mxml | 130 +++++
examples/FlexJSStore/src/SupportView.mxml | 139 +++++
examples/FlexJSStore/src/assets/akotter.jpg | Bin 0 -> 19395 bytes
examples/FlexJSStore/src/assets/bcrater.jpg | Bin 0 -> 22670 bytes
.../FlexJSStore/src/assets/beige_background.jpg | Bin 0 -> 12533 bytes
.../FlexJSStore/src/assets/beige_dotted_map.png | Bin 0 -> 216598 bytes
.../FlexJSStore/src/assets/blue_background.jpg | Bin 0 -> 12868 bytes
.../FlexJSStore/src/assets/blue_dotted_map.png | Bin 0 -> 217088 bytes
.../src/assets/button_cart_empty.png | Bin 0 -> 289 bytes
.../FlexJSStore/src/assets/button_cart_full.png | Bin 0 -> 308 bytes
.../FlexJSStore/src/assets/button_compare.png | Bin 0 -> 304 bytes
.../FlexJSStore/src/assets/button_details.png | Bin 0 -> 284 bytes
.../FlexJSStore/src/assets/button_tiles.png | Bin 0 -> 218 bytes
examples/FlexJSStore/src/assets/grip.png | Bin 0 -> 19836 bytes
.../FlexJSStore/src/assets/icon_cart_empty.png | Bin 0 -> 29594 bytes
.../FlexJSStore/src/assets/icon_magnifier.png | Bin 0 -> 30454 bytes
examples/FlexJSStore/src/assets/jproctor.jpg | Bin 0 -> 21684 bytes
examples/FlexJSStore/src/assets/logo_blue.png | Bin 0 -> 33427 bytes
examples/FlexJSStore/src/assets/logo_orange.png | Bin 0 -> 33897 bytes
.../FlexJSStore/src/assets/pic/abrilliam.jpg | Bin 0 -> 18903 bytes
examples/FlexJSStore/src/assets/pic/akotter.jpg | Bin 0 -> 19395 bytes
examples/FlexJSStore/src/assets/pic/bcrater.jpg | Bin 0 -> 22670 bytes
.../FlexJSStore/src/assets/pic/bleporte.jpg | Bin 0 -> 23363 bytes
.../FlexJSStore/src/assets/pic/bvanbrocklin.jpg | Bin 0 -> 18066 bytes
.../FlexJSStore/src/assets/pic/ccarpenter.jpg | Bin 0 -> 19219 bytes
.../FlexJSStore/src/assets/pic/clampberto.jpg | Bin 0 -> 18611 bytes
examples/FlexJSStore/src/assets/pic/davenon.jpg | Bin 0 -> 20028 bytes
.../FlexJSStore/src/assets/pic/dmcgoyal.jpg | Bin 0 -> 19395 bytes
.../FlexJSStore/src/assets/pic/dwillhelm.jpg | Bin 0 -> 22670 bytes
.../FlexJSStore/src/assets/pic/esunderland.jpg | Bin 0 -> 23363 bytes
.../FlexJSStore/src/assets/pic/jproctor.jpg | Bin 0 -> 21684 bytes
examples/FlexJSStore/src/assets/pic/mfields.jpg | Bin 0 -> 18066 bytes
.../FlexJSStore/src/assets/pic/pdempsey.jpg | Bin 0 -> 18611 bytes
examples/FlexJSStore/src/assets/pic/ptranep.jpg | Bin 0 -> 19627 bytes
.../FlexJSStore/src/assets/pic/rcrawley.jpg | Bin 0 -> 23692 bytes
.../FlexJSStore/src/assets/pic/rdreifus.jpg | Bin 0 -> 20028 bytes
examples/FlexJSStore/src/assets/pic/twong.jpg | Bin 0 -> 19395 bytes
examples/FlexJSStore/src/assets/support_map.png | Bin 0 -> 172293 bytes
.../src/assets/support_mapmarker_a.png | Bin 0 -> 834 bytes
.../src/assets/support_mapmarker_b.png | Bin 0 -> 822 bytes
.../src/assets/support_mapmarker_c.png | Bin 0 -> 817 bytes
.../src/assets/support_mapmarker_plus.png | Bin 0 -> 827 bytes
examples/FlexJSStore/src/assets/trashcan.png | Bin 0 -> 182 bytes
examples/FlexJSStore/src/beige.css | 170 ++++++
examples/FlexJSStore/src/blue.css | 165 ++++++
examples/FlexJSStore/src/data/catalog.json | 255 +++++++++
examples/FlexJSStore/src/data/catalog.xml | 256 +++++++++
examples/FlexJSStore/src/main.css | 95 ++++
.../src/productsView/CatalogTitleButtons.mxml | 70 +++
examples/FlexJSStore/src/productsView/Grip.mxml | 49 ++
.../src/productsView/ProductCart.mxml | 114 ++++
.../src/productsView/ProductCatalogPanel.mxml | 545 +++++++++++++++++++
.../ProductCatalogPanelTitleBarView.mxml | 49 ++
.../productsView/ProductCatalogThumbnail.mxml | 232 ++++++++
.../src/productsView/ProductDetails.mxml | 153 ++++++
.../src/productsView/ProductFilterPanel.mxml | 221 ++++++++
.../src/productsView/ProductList.mxml | 217 ++++++++
.../src/productsView/ProductListItem.mxml | 131 +++++
.../src/productsView/ProductSupport.mxml | 91 ++++
.../samples/flexstore/ButtonBarButtonSkin.as | 298 ++++++++++
.../src/samples/flexstore/Product.as | 78 +++
.../src/samples/flexstore/ProductFilter.as | 56 ++
.../src/samples/flexstore/ProductFilterEvent.as | 39 ++
.../src/samples/flexstore/ProductListEvent.as | 42 ++
.../src/samples/flexstore/ProductThumbEvent.as | 45 ++
69 files changed, 4207 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/build.xml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/build.xml b/examples/FlexJSStore/build.xml
new file mode 100644
index 0000000..6a6643b
--- /dev/null
+++ b/examples/FlexJSStore/build.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!--
+
+ 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.
+
+-->
+
+
+<project name="flexjsstore" default="main" basedir=".">
+ <property name="FLEXJS_HOME" location="../.."/>
+ <property name="example" value="FlexJSStore" />
+
+ <property file="${FLEXJS_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${FLEXJS_HOME}/build.properties"/>
+ <property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
+ <property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
+ <property name="FALCONJX_HOME" value="${env.FALCONJX_HOME}"/>
+ <property name="GOOG_HOME" value="${env.GOOG_HOME}"/>
+
+ <include file="${basedir}/../build_example.xml" />
+
+ <!-- disable JS compile until we get it working
+ <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of ${example}">-->
+ <target name="main" depends="clean,build_example.compile" description="Clean build of ${example}">
+ <mkdir dir="${basedir}/bin-debug/data" />
+ <copy file="${basedir}/src/data/catalog.json" tofile="${basedir}/bin-debug/data/catalog.json" />
+ </target>
+
+ <target name="clean">
+ <delete dir="${basedir}/bin" failonerror="false" />
+ <delete dir="${basedir}/bin-debug" failonerror="false" />
+ <delete dir="${basedir}/bin-release" failonerror="false" />
+ </target>
+
+
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/FlexJSStore.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/FlexJSStore.mxml b/examples/FlexJSStore/src/FlexJSStore.mxml
new file mode 100755
index 0000000..cab579a
--- /dev/null
+++ b/examples/FlexJSStore/src/FlexJSStore.mxml
@@ -0,0 +1,269 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns="*"
+ initialize="startService()"
+ pageTitle="FlexStore">
+
+ <fx:Script>
+ <![CDATA[
+ import org.apache.flex.core.ValuesManager;
+
+ /*
+ private var currentTheme:String = "beige";
+
+ private function toggleTheme():void
+ {
+ if (currentTheme == "beige")
+ {
+ currentTheme = "blue";
+ }
+ else
+ {
+ currentTheme = "beige";
+ }
+
+ loadStyle();
+ }
+ */
+
+ private function startService():void
+ {
+ productService.send();
+ }
+
+ private function loadStyle():void
+ {
+ /* load css not implemented yet
+ var eventDispatcher:IEventDispatcher =
+ styleManager.loadStyleDeclarations(currentTheme + ".swf");
+ eventDispatcher.addEventListener(StyleEvent.COMPLETE, completeHandler);
+ */
+ }
+
+ private function completeHandler(event:Event):void
+ {
+ image.source = ValuesManager.valuesImpl.getValue(acb, "storeLogo");
+ /*
+ super.initialized = true;
+ */
+ callLater.callLater(prebake);
+ }
+
+ /*
+ override public function set initialized(value:Boolean):void
+ {
+ // Hold off until the Runtime CSS SWF is done loading.
+ }
+ */
+
+ private var stateChain:Array;
+
+ private function headHome():void
+ {
+ homeButton.selected = true;
+ if (initialView.currentState == "ProductsState")
+ {
+ productsButton.selected = false;
+ stateChain = ["ProductsWipeUp", "HomeWipeDown", "HomeState"];
+ initialView.currentState = "ProductsWipeUp";
+ }
+ else if (initialView.currentState == "SupportState")
+ {
+ supportButton.selected = false;
+ stateChain = ["SupportWipeUp", "HomeWipeDown", "HomeState"];
+ initialView.currentState = "SupportWipeUp";
+ }
+ }
+
+ private function headToProducts():void
+ {
+ productsButton.selected = true;
+ if (initialView.currentState == "SupportState")
+ {
+ supportButton.selected = false;
+ stateChain = ["SupportWipeUp", "ProductsWipeDown", "ProductsState"];
+ initialView.currentState = "SupportWipeUp";
+ }
+ if (initialView.currentState == "HomeState")
+ {
+ homeButton.selected = false;
+ stateChain = ["HomeWipeUp", "ProductsWipeDown", "ProductsState"];
+ initialView.currentState = "HomeWipeUp";
+ }
+ }
+
+ private function headToSupport():void
+ {
+ supportButton.selected = true;
+ if (initialView.currentState == "ProductsState")
+ {
+ productsButton.selected = false;
+ stateChain = ["ProductsWipeUp", "SupportWipeDown", "SupportState"];
+ initialView.currentState = "ProductsWipeUp";
+ }
+ if (initialView.currentState == "HomeState")
+ {
+ homeButton.selected = false;
+ stateChain = ["HomeWipeUp", "SupportWipeDown", "SupportState"];
+ initialView.currentState = "HomeWipeUp";
+ }
+ }
+
+ private function prebake():void
+ {
+ callLater.callLater(prebake2);
+ }
+
+ private function prebake2():void
+ {
+ trace("prebake2");
+ stateChain = ["ProductsPreBake", "HomeState"];
+ initialView.currentState = "ProductsPreBake";
+ }
+
+ private function chainStatesIfNeeded():void
+ {
+ if (stateChain != null)
+ {
+ if (initialView.currentState == stateChain[0])
+ {
+ callLater.callLater(nextState);
+ }
+ }
+ }
+
+ private function nextState():void
+ {
+ stateChain.shift();
+ if (stateChain.length)
+ initialView.currentState = stateChain[0];
+ else
+ stateChain == null;
+ }
+ ]]>
+ </fx:Script>
+
+ <fx:Style source="main.css"/>
+ <fx:Style source="beige.css"/>
+
+ <fx:Declarations>
+ <basic:HTTPService id="productService" url="data/catalog.json">
+ <basic:LazyCollection id="catalog">
+ <basic:inputParser>
+ <basic:JSONInputParser />
+ </basic:inputParser>
+ <basic:itemConverter>
+ <ProductJSONItemConverter />
+ </basic:itemConverter>
+ </basic:LazyCollection>
+ </basic:HTTPService>
+ </fx:Declarations>
+ <basic:valuesImpl>
+ <basic:SimpleCSSValuesImpl />
+ </basic:valuesImpl>
+ <basic:beads>
+ <basic:CallLaterBead id="callLater" />
+ <basic:ApplicationDataBinding />
+ </basic:beads>
+ <basic:initialView>
+ <basic:ViewBase width="990" height="550"
+ initComplete="completeHandler(null)"
+ stateChangeComplete="chainStatesIfNeeded()">
+ <basic:states>
+ <mx:State name="HomeState" stateGroups="['Home']" />
+ <mx:State name="HomeWipeUp" stateGroups="['Home']" />
+ <mx:State name="HomeWipeDown" stateGroups="['Home']" />
+ <mx:State name="ProductsPreBake" stateGroups="['Home', 'Products']" />
+ <mx:State name="ProductsState" stateGroups="['Products']" />
+ <mx:State name="ProductsWipeUp" stateGroups="['Products']" />
+ <mx:State name="ProductsWipeDown" stateGroups="['Products']" />
+ <mx:State name="SupportState" stateGroups="['Support']" />
+ <mx:State name="SupportWipeUp" stateGroups="['Support']" />
+ <mx:State name="SupportWipeDown" stateGroups="['Support']" />
+ </basic:states>
+
+ <basic:transitions>
+ <basic:Transition fromState="HomeState" toState="HomeWipeUp">
+ <basic:Wipe direction="up" target="homeView" />
+ </basic:Transition>
+ <basic:Transition fromState="HomeWipeDown" toState="HomeState">
+ <basic:Wipe direction="down" target="homeView" />
+ </basic:Transition>
+ <basic:Transition fromState="ProductsState" toState="ProductsWipeUp">
+ <basic:Wipe direction="up" target="pView" />
+ </basic:Transition>
+ <basic:Transition fromState="ProductsWipeDown" toState="ProductsState">
+ <basic:Wipe direction="down" target="pView" />
+ </basic:Transition>
+ <basic:Transition fromState="SupportState" toState="SupportWipeUp">
+ <basic:Wipe direction="up" target="supportView" />
+ </basic:Transition>
+ <basic:Transition fromState="SupportWipeDown" toState="SupportState">
+ <basic:Wipe direction="down" target="supportView" />
+ </basic:Transition>
+ </basic:transitions>
+ <basic:beads>
+ <basic:NonVirtualVerticalLayout />
+ </basic:beads>
+ <basic:ControlBar id="acb" width="100%" className="storeControlBar" >
+ <basic:beads>
+ <basic:NonVirtualHorizontalLayout />
+ <basic:LayoutChangeNotifier watchedProperty="{image.width}" />
+ </basic:beads>
+ <basic:Image id="image" />
+ <!-- click="toggleTheme()" -->
+ <!-- toolTip="Change Theme"/ -->
+ <basic:ToggleTextButton id="homeButton"
+ text="Home"
+ height="100%"
+ selected="true"
+ className="storeButtonBar"
+ click="headHome()" />
+ <basic:ToggleTextButton id="productsButton"
+ text="Products"
+ height="100%"
+ className="storeButtonBar"
+ click="headToProducts()"/>
+ <basic:ToggleTextButton id="supportButton"
+ text="Support"
+ height="100%"
+ className="storeButtonBar"
+ click="headToSupport()"/>
+ </basic:ControlBar>
+ <basic:Container width="990" >
+ <basic:style>
+ <basic:SimpleCSSStyles paddingLeft="0" paddingRight="0" horizontalCenter="0" top="12" />
+ </basic:style>
+
+ <HomeView id="homeView" width="100%" height="550" includeIn="Home"
+ />
+ <ProductsView id="pView" includeIn="Products" visible.ProductsPreBake="false"
+ width="100%" height="550" initComplete="pView.catalog = catalog"
+ />
+ <SupportView id="supportView" includeIn="Support"
+ width="100%" height="550"
+ />
+ </basic:Container>
+ </basic:ViewBase>
+ </basic:initialView>
+</basic:Application>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/HomeView.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/HomeView.mxml b/examples/FlexJSStore/src/HomeView.mxml
new file mode 100755
index 0000000..be34beb
--- /dev/null
+++ b/examples/FlexJSStore/src/HomeView.mxml
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<!--
+This component is primarily static and is only meant to show what other
+pages of the store could look like.
+
+Note that this page was put together in the Design view so you'll see more
+hard coded locations and sizes.
+
+Also note when working with a Canvas that using the constraint styles
+(e.g., left, top, right, bottom) can provide better layout predictability than
+using x and y, especially when percentage widths and heights are used.
+
+Width and height are hard-coded in the root tag to help the Design view.
+-->
+<basic:Container xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns="*" width="990" height="550"
+ initComplete="updateMapImage()">
+ <fx:Script>
+ <![CDATA[
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.html.SimpleAlert;
+
+ public function updateMapImage():void
+ {
+ mapImage.source = ValuesManager.valuesImpl.getValue(mapCanvas, 'dottedMap');
+ }
+ ]]>
+ </fx:Script>
+ <basic:beads>
+ <basic:ContainerDataBinding />
+ </basic:beads>
+ <basic:HContainer width="100%" height="100%" y="0" x="0" className="colorPanel">
+ <basic:VContainer width="230" height="100%">
+ <basic:Container width="100%" height="100%">
+
+ <basic:Container width="100%" height="60" className="homeSection">
+ <basic:style>
+ <basic:SimpleCSSStyles backgroundColor="#ebebe9" left="10" top="10" />
+ </basic:style>
+ <basic:Label style="left:10;top:10" text="Search Developers" height="22" className="sectionHeader" />
+ <basic:TextButton style="left:168;top:30" text="Go" width="47" height="20" className="glass" click="SimpleAlert.show('This feature is not implemented in this sample', 'Go')"/>
+ <basic:TextInput style="left:10;top:30" height="20" width="150"/>
+ </basic:Container>
+
+ <basic:Container width="100%" height="280" className="homeSection">
+ <basic:style>
+ <basic:SimpleCSSStyles backgroundColor="#ffffff" left="10" top="78" />
+ </basic:style>
+ <basic:VContainer width="100%" height="100%">
+ <basic:style>
+ <basic:SimpleCSSStyles left="10" top="10" />
+ </basic:style>
+ <basic:Label text="Flex Experts That Can Help You" className="sectionHeader"/>
+ <basic:HRule height="5" width="197"/>
+ <basic:Label text="General" className="homeProgramHeader"/>
+ <basic:Label text="BlazeDS Experts" style="fontSize:9"/>
+ <basic:Spacer height="8" width="100%"/>
+ <basic:Label text="Server-side" className="homeProgramHeader"/>
+ <basic:Label text="Java, PHP Developers" style="fontSize:9"/>
+ <basic:Spacer height="8" width="100%"/>
+ <basic:Label text="Mobile" className="homeProgramHeader"/>
+ <basic:Label text="Android, IOS and more" style="fontSize:9"/>
+ <basic:Spacer height="8" width="100%"/>
+ <basic:Label text="Students" className="homeProgramHeader"/>
+ <basic:Label text="Free Assistance" style="fontSize:9"/>
+ <basic:Spacer height="8" width="100%"/>
+ </basic:VContainer>
+ </basic:Container>
+
+ <basic:Container width="100%" height="174" className="homeSection">
+ <basic:style>
+ <basic:SimpleCSSStyles backgroundColor="#ebebe9" left="10" top="366" />
+ </basic:style>
+ <basic:VContainer width="100%" height="100%">
+ <basic:style>
+ <basic:SimpleCSSStyles left="10" top="10" />
+ </basic:style>
+ <basic:Label text="Manage My Account" className="sectionHeader"/>
+
+ <basic:Label text="Phone Number"/>
+
+ <basic:HContainer width="100%" height="25" >
+ <basic:style>
+ <basic:SimpleCSSStyles horizontalAlign="left" verticalAlign="middle" />
+ </basic:style>
+ <basic:TextInput height="20" width="40"/>
+ <basic:HRule width="8" height="25"/>
+ <basic:TextInput height="20" width="40"/>
+ <basic:HRule width="8" height="25"/>
+ <basic:TextInput height="20" width="40"/>
+ </basic:HContainer>
+
+ <basic:Label text="Password"/>
+ <basic:TextInput height="20"/>
+ <basic:Spacer height="8" width="100%"/>
+
+ <basic:CheckBox text="Remember my phone number" selected="true"/>
+ <basic:Spacer height="8" width="100%"/>
+
+ <basic:TextButton text="Login" className="glass" height="20" width="55" click="SimpleAlert.show('This feature is not implemented in this sample', 'Login')"/>
+
+ </basic:VContainer>
+ </basic:Container>
+
+ </basic:Container>
+
+ </basic:VContainer>
+
+ <basic:VContainer width="750" height="100%">
+ <basic:Container width="100%" height="100%">
+
+ <!-- can't use binding to set the mapImage source because the style isn't available early enough -->
+ <basic:Container id="mapCanvas" width="100%" height="35%" className="homeMap">
+ <basic:style>
+ <basic:SimpleCSSStyles right="10" top="10" />
+ </basic:style>
+ <basic:Image id="mapImage" width="487" height="100%" alpha="1.0" style="left:10;top:10"/>
+ <basic:Label y="110" text="US Developers . Flex . FlexJS" width="95%" height="40" style="horizontalCenter:0;fontWeight:'bold';fontSize:22;color:#ffffff;fontFamily:'Arial';textAlign:'center'"/>
+ <basic:Label text="Learn More >>" width="95" style="fontSize:12;fontFamily:'Arial';bottom:10;right:10"/>
+ <basic:Label text="$60/hr" style="color:#ffffff;fontWeight:'bold';fontFamily:'Arial';fontSize:20;right:10:top:10"/>
+ <basic:Label text="Rates as low as" x="551" y="16" style="fontSize:12"/>
+ </basic:Container>
+
+ <basic:Container width="100%" height="330" >
+ <basic:style>
+ <basic:SimpleCSSStyles backgroundColor="#ffffff" borderStyle="solid" bottom="10" right="10" /> <!-- cornerRadius="4" -->
+ </basic:style>
+
+ <basic:Label style="left:10;top:10" text="Featured Developers" width="173" height="25" className="sectionHeader"/>
+
+ <basic:HContainer style="left:0;top:43" width="100%" height="100%">
+ <basic:VContainer width="33%" height="100%">
+ <basic:beads>
+ <basic:LayoutChangeNotifier watchedProperty="{image1.height}" />
+ </basic:beads>
+ <basic:Container width="100%">
+ <basic:Image id="image1" source="assets/akotter.jpg" style="horizontalCenter:0;verticalCenter:0"/>
+ </basic:Container>
+
+ <basic:Container width="100%">
+ <basic:Label text="Annette Kotter" id="feat_prod_1" style="horizontalCenter:0;fontWeight:'bold';fontSize:12"/>
+ </basic:Container>
+
+ </basic:VContainer>
+
+ <basic:VContainer width="33%" height="100%">
+ <basic:beads>
+ <basic:LayoutChangeNotifier watchedProperty="{image2.height}" />
+ </basic:beads>
+
+ <basic:Container width="100%">
+ <basic:Image id="image2" style="horizontalCenter:0;verticalCenter:0" source="assets/bcrater.jpg"/>
+ </basic:Container>
+
+ <basic:Container width="100%">
+ <basic:Label text="Ben Crater" id="feat_prod_2" style="horizontalCenter:0;fontWeight:'bold';fontSize:12"/>
+ </basic:Container>
+
+ </basic:VContainer>
+
+ <basic:VContainer width="33%" height="100%">
+ <basic:beads>
+ <basic:LayoutChangeNotifier watchedProperty="{image3.height}" />
+ </basic:beads>
+
+ <basic:Container width="100%">
+ <basic:Image id="image3" style="horizontalCenter:0;verticalCenter:0" source="assets/jproctor.jpg"/>
+ </basic:Container>
+
+ <basic:Container width="100%">
+ <basic:Label text="Jane Proctor" id="feat_prod_3" style="horizontalCenter:0;fontWeight:'bold';fontSize:12"/>
+ </basic:Container>
+
+ </basic:VContainer>
+
+ </basic:HContainer>
+
+ </basic:Container>
+
+ </basic:Container>
+
+ </basic:VContainer>
+
+ </basic:HContainer>
+
+</basic:Container>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/ProductJSONItemConverter.as
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/ProductJSONItemConverter.as b/examples/FlexJSStore/src/ProductJSONItemConverter.as
new file mode 100755
index 0000000..4d44ecf
--- /dev/null
+++ b/examples/FlexJSStore/src/ProductJSONItemConverter.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.net.JSONItemConverter;
+
+ import samples.flexstore.Product;
+
+ public class ProductJSONItemConverter extends JSONItemConverter
+ {
+ public function ProductJSONItemConverter()
+ {
+ super();
+ }
+
+ override public function convertItem(data:String):Object
+ {
+ var obj:Object = super.convertItem(data);
+ var product:Product = new Product();
+ for (var p:String in obj)
+ product[p] = obj[p];
+ return product;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/ProductsView.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/ProductsView.mxml b/examples/FlexJSStore/src/ProductsView.mxml
new file mode 100755
index 0000000..9b42fa1
--- /dev/null
+++ b/examples/FlexJSStore/src/ProductsView.mxml
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<!-- width and height hard-coded in the root tag to better support the
+ Design view in FlexBuilder since we know the width and height from the
+ settings in flexstore.mxml -->
+<basic:Container xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:productsView="productsView.*"
+ width="990" height="550"
+ currentState="showFilter"
+ >
+
+ <fx:Script>
+ <![CDATA[
+ import org.apache.flex.events.Event;
+ import org.apache.flex.net.dataConverters.LazyCollection;
+ import samples.flexstore.Product;
+
+ private var _catalog:LazyCollection;
+
+ [Bindable("catalogChange")]
+ public function get catalog():LazyCollection
+ {
+ return _catalog;
+ }
+
+ public function set catalog(c:LazyCollection):void
+ {
+ _catalog = c;
+ if (filterPanel != null)
+ {
+ filterPanel.filter.count = c.length;
+ }
+ dispatchEvent(new org.apache.flex.events.Event("catalogChange"));
+ }
+
+ public function addToCompare(product:Product):void
+ {
+ //setting the state before adding the product avoids jumpiness in the transition, not sure why
+ currentState = 'showFilter';
+ filterPanel.productList.addProduct(product);
+ }
+
+ public function addToCart(product:Product):void
+ {
+ //setting the state before adding the product avoids jumpiness in the transition, not sure why
+ currentState = 'showCart';
+ cartPanel.productList.addProduct(product);
+ }
+
+
+ ]]>
+ </fx:Script>
+ <basic:beads>
+ <basic:ContainerDataBinding />
+ <basic:LayoutChangeNotifier watchedProperty="{catalogPanelPosition.right}" initialValue="17" />
+ </basic:beads>
+ <basic:Container
+ className="colorPanel"
+ height="100%" width="100%"
+ >
+
+ <productsView:Grip id="filterGrip" gripIcon="assets/icon_magnifier.png"
+ gripTip="Show filter panel" click="currentState = 'showFilter'"/>
+
+ <productsView:ProductFilterPanel x="{filterGrip.width}" id="filterPanel" width="265" height="100%"
+ filter="catalogPanel.filter(event.filter, event.live)"
+ compare="catalogPanel.compare(filterPanel.productList.getProducts())"
+ initComplete="if (catalog) filterPanel.filter.count = catalog.length"/>
+
+ <productsView:ProductCart id="cartPanel" width="265" height="100%">
+ <productsView:style>
+ <basic:SimpleCSSStyles right="{cartGrip.width}" />
+ </productsView:style>
+ </productsView:ProductCart>
+
+ <productsView:Grip id="cartGrip" gripIcon="assets/icon_cart_empty.png"
+ gripTip="Show cart" click="currentState = 'showCart'">
+ <productsView:style>
+ <basic:SimpleCSSStyles right="0" />
+ </productsView:style>
+ </productsView:Grip>
+
+ </basic:Container>
+
+ <productsView:ProductCatalogPanel id="catalogPanel" y="4" width="685" height="540"
+ catalog="{catalog}"
+ compare="addToCompare(event.product)"
+ purchase="addToCart(event.product)"
+ cartCount="{cartPanel.numProducts}">
+ <productsView:style>
+ <basic:BindableCSSStyles id="catalogPanelPosition" right.showFilter="17"
+ right.showCart="285" />
+ </productsView:style>
+ </productsView:ProductCatalogPanel>
+
+ <basic:states>
+ <mx:State name="showFilter" />
+ <mx:State name="showCart" />
+ </basic:states>
+
+ <!--
+ make sure to use transitions here instead of applying a Move effect
+ to the Panel itself which will result in odd behavior
+ -->
+ <basic:transitions>
+ <basic:Transition fromState="*" toState="*">
+ <basic:Move target="catalogPanel" />
+ </basic:Transition>
+ </basic:transitions>
+
+</basic:Container>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/SupportView.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/SupportView.mxml b/examples/FlexJSStore/src/SupportView.mxml
new file mode 100755
index 0000000..0410e1b
--- /dev/null
+++ b/examples/FlexJSStore/src/SupportView.mxml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<!--
+This component is primarily static and is only meant to show what other
+pages of the store could look like.
+
+Note that this page was put together in the Design view so you'll see more
+hard coded locations and sizes.
+
+We did not have sizing issues here as much so you'll see more hardcoded
+"y" values rather than "top."
+
+The width and height are hard-coded in the root tag to help the Design view.
+-->
+<basic:Container xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:basic="library://ns.apache.org/flexjs/basic"
+ xmlns:mx="library://ns.adobe.com/flex/mx" xmlns="*" alpha="1.0"
+ width="990" height="550">
+
+ <fx:Script>
+ <![CDATA[
+ import org.apache.flex.html.SimpleAlert;
+ ]]>
+ </fx:Script>
+
+ <fx:Declarations>
+ <fx:Array id="locations">
+ <fx:Object image="assets/support_mapmarker_a.png" name="601 Townsend St" />
+ <fx:Object image="assets/support_mapmarker_b.png" name="Location B" />
+ <fx:Object image="assets/support_mapmarker_c.png" name="Location C" />
+ </fx:Array>
+
+ </fx:Declarations>
+
+ <basic:HContainer x="0" y="0" width="100%" height="100%" className="colorPanel">
+
+ <basic:VContainer width="32%" height="100%">
+ <basic:Container width="100%" height="60%">
+
+ <basic:Label y="10" text="Check Location" className="sectionHeader" x="20"/>
+
+ <basic:Container width="95%" height="150" y="64" style="horizontalCenter:0">
+ <basic:beads>
+ <basic:VerticalColumnLayout numColumns="2" />
+ </basic:beads>
+ <basic:Label text="Address:" width="100%"/>
+ <basic:TextInput id="address" width="90%"/>
+
+ <basic:Label text="City:" width="100%"/>
+ <basic:TextInput id="city" width="60%"/>
+
+ <basic:Label text="State:" width="100%"/>
+ <basic:DropDownList id="state" width="50%">
+ <basic:dataProvider>
+ <fx:Array>
+ <fx:String>California</fx:String>
+ <fx:String>Nevada</fx:String>
+ <fx:String>Oregon</fx:String>
+ <fx:String>Washington</fx:String>
+ </fx:Array>
+ </basic:dataProvider>
+ </basic:DropDownList>
+
+ <basic:Label text="ZIP Code:" width="100%" />
+ <basic:TextInput id="zip" width="30%"/>
+
+ </basic:Container>
+
+ <basic:Label y="38" text="Option1: Enter Address" style="horizontalCenter:0" className="instructions"/>
+
+ <basic:TextButton y="297" text="Locate" click="SimpleAlert.show('This feature is not implemented in this sample', 'Locate')"
+ style="horizontalCenter:0"/>
+
+ <basic:HContainer y="327" width="80%" height="20" >
+ <basic:style>
+ <basic:SimpleCSSStyles horizontalAlign="center" verticalAlign="middle" horizontalCenter="0" />
+ </basic:style>
+ <basic:HRule width="60" />
+ <basic:Label text="OR"/>
+ <basic:HRule width="60" />
+ </basic:HContainer>
+
+ <basic:Label y="355" text="Option 2: Drag this marker into the map" style="horizontalCenter:0" className="instructions"/>
+
+ <basic:Image y="380" style="horizontalCenter:0" source="assets/support_mapmarker_plus.png"/>
+
+ <basic:HRule y="415" style="horizontalCenter:0" width="200" alpha="0.6"/>
+
+ </basic:Container>
+
+ <basic:Container width="100%" height="40%">
+ <basic:VContainer width="80%" height="90%" >
+ <basic:style>
+ <basic:SimpleCSSStyles horizontalCenter="0" top="0"/>
+ </basic:style>
+ <basic:Label text="Location" className="instructions"/>
+ <basic:List width="100%" dataProvider="{locations}">
+ <basic:itemRenderer>
+ <fx:Component>
+ <basic:DataItemRenderer className="listItem" width="100%">
+ <basic:Image width="21" height="25" source="{data.image}" />
+ <basic:Label width="100%" text="{data.name}" />
+ </basic:DataItemRenderer>
+ </fx:Component>
+ </basic:itemRenderer>
+ </basic:List>
+ </basic:VContainer>
+ </basic:Container>
+
+ </basic:VContainer>
+
+ <basic:Container width="68%" height="100%">
+ <basic:Image source="assets/support_map.png">
+ <basic:style>
+ <basic:SimpleCSSStyles left="2" right="2" top="2" bottom="2"/>
+ </basic:style>
+ </basic:Image>
+ </basic:Container>
+
+ </basic:HContainer>
+
+</basic:Container>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/akotter.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/akotter.jpg b/examples/FlexJSStore/src/assets/akotter.jpg
new file mode 100755
index 0000000..1124b71
Binary files /dev/null and b/examples/FlexJSStore/src/assets/akotter.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/bcrater.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/bcrater.jpg b/examples/FlexJSStore/src/assets/bcrater.jpg
new file mode 100755
index 0000000..fd15d59
Binary files /dev/null and b/examples/FlexJSStore/src/assets/bcrater.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/beige_background.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/beige_background.jpg b/examples/FlexJSStore/src/assets/beige_background.jpg
new file mode 100755
index 0000000..8f034ba
Binary files /dev/null and b/examples/FlexJSStore/src/assets/beige_background.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/beige_dotted_map.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/beige_dotted_map.png b/examples/FlexJSStore/src/assets/beige_dotted_map.png
new file mode 100755
index 0000000..e88d9ef
Binary files /dev/null and b/examples/FlexJSStore/src/assets/beige_dotted_map.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/blue_background.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/blue_background.jpg b/examples/FlexJSStore/src/assets/blue_background.jpg
new file mode 100755
index 0000000..361ce0e
Binary files /dev/null and b/examples/FlexJSStore/src/assets/blue_background.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/blue_dotted_map.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/blue_dotted_map.png b/examples/FlexJSStore/src/assets/blue_dotted_map.png
new file mode 100755
index 0000000..5fa6714
Binary files /dev/null and b/examples/FlexJSStore/src/assets/blue_dotted_map.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/button_cart_empty.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/button_cart_empty.png b/examples/FlexJSStore/src/assets/button_cart_empty.png
new file mode 100644
index 0000000..0e1a2b5
Binary files /dev/null and b/examples/FlexJSStore/src/assets/button_cart_empty.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/button_cart_full.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/button_cart_full.png b/examples/FlexJSStore/src/assets/button_cart_full.png
new file mode 100644
index 0000000..9c9eea0
Binary files /dev/null and b/examples/FlexJSStore/src/assets/button_cart_full.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/button_compare.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/button_compare.png b/examples/FlexJSStore/src/assets/button_compare.png
new file mode 100644
index 0000000..c2ac969
Binary files /dev/null and b/examples/FlexJSStore/src/assets/button_compare.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/button_details.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/button_details.png b/examples/FlexJSStore/src/assets/button_details.png
new file mode 100644
index 0000000..3e6238c
Binary files /dev/null and b/examples/FlexJSStore/src/assets/button_details.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/button_tiles.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/button_tiles.png b/examples/FlexJSStore/src/assets/button_tiles.png
new file mode 100644
index 0000000..4266a22
Binary files /dev/null and b/examples/FlexJSStore/src/assets/button_tiles.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/grip.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/grip.png b/examples/FlexJSStore/src/assets/grip.png
new file mode 100755
index 0000000..64ee835
Binary files /dev/null and b/examples/FlexJSStore/src/assets/grip.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/icon_cart_empty.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/icon_cart_empty.png b/examples/FlexJSStore/src/assets/icon_cart_empty.png
new file mode 100644
index 0000000..562064b
Binary files /dev/null and b/examples/FlexJSStore/src/assets/icon_cart_empty.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/icon_magnifier.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/icon_magnifier.png b/examples/FlexJSStore/src/assets/icon_magnifier.png
new file mode 100755
index 0000000..939f814
Binary files /dev/null and b/examples/FlexJSStore/src/assets/icon_magnifier.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/jproctor.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/jproctor.jpg b/examples/FlexJSStore/src/assets/jproctor.jpg
new file mode 100755
index 0000000..1111787
Binary files /dev/null and b/examples/FlexJSStore/src/assets/jproctor.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/logo_blue.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/logo_blue.png b/examples/FlexJSStore/src/assets/logo_blue.png
new file mode 100755
index 0000000..132b894
Binary files /dev/null and b/examples/FlexJSStore/src/assets/logo_blue.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/logo_orange.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/logo_orange.png b/examples/FlexJSStore/src/assets/logo_orange.png
new file mode 100755
index 0000000..c776c8c
Binary files /dev/null and b/examples/FlexJSStore/src/assets/logo_orange.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/abrilliam.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/abrilliam.jpg b/examples/FlexJSStore/src/assets/pic/abrilliam.jpg
new file mode 100755
index 0000000..6954858
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/abrilliam.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/akotter.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/akotter.jpg b/examples/FlexJSStore/src/assets/pic/akotter.jpg
new file mode 100755
index 0000000..1124b71
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/akotter.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/bcrater.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/bcrater.jpg b/examples/FlexJSStore/src/assets/pic/bcrater.jpg
new file mode 100755
index 0000000..fd15d59
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/bcrater.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/bleporte.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/bleporte.jpg b/examples/FlexJSStore/src/assets/pic/bleporte.jpg
new file mode 100755
index 0000000..c4769e8
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/bleporte.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/bvanbrocklin.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/bvanbrocklin.jpg b/examples/FlexJSStore/src/assets/pic/bvanbrocklin.jpg
new file mode 100755
index 0000000..489fa2e
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/bvanbrocklin.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/ccarpenter.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/ccarpenter.jpg b/examples/FlexJSStore/src/assets/pic/ccarpenter.jpg
new file mode 100755
index 0000000..c1dc3d8
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/ccarpenter.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/clampberto.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/clampberto.jpg b/examples/FlexJSStore/src/assets/pic/clampberto.jpg
new file mode 100755
index 0000000..9deacd2
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/clampberto.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/davenon.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/davenon.jpg b/examples/FlexJSStore/src/assets/pic/davenon.jpg
new file mode 100755
index 0000000..6a2a142
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/davenon.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/dmcgoyal.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/dmcgoyal.jpg b/examples/FlexJSStore/src/assets/pic/dmcgoyal.jpg
new file mode 100755
index 0000000..1124b71
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/dmcgoyal.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/dwillhelm.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/dwillhelm.jpg b/examples/FlexJSStore/src/assets/pic/dwillhelm.jpg
new file mode 100755
index 0000000..fd15d59
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/dwillhelm.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/esunderland.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/esunderland.jpg b/examples/FlexJSStore/src/assets/pic/esunderland.jpg
new file mode 100755
index 0000000..c4769e8
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/esunderland.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/jproctor.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/jproctor.jpg b/examples/FlexJSStore/src/assets/pic/jproctor.jpg
new file mode 100755
index 0000000..1111787
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/jproctor.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/mfields.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/mfields.jpg b/examples/FlexJSStore/src/assets/pic/mfields.jpg
new file mode 100755
index 0000000..489fa2e
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/mfields.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/pdempsey.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/pdempsey.jpg b/examples/FlexJSStore/src/assets/pic/pdempsey.jpg
new file mode 100755
index 0000000..9deacd2
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/pdempsey.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/ptranep.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/ptranep.jpg b/examples/FlexJSStore/src/assets/pic/ptranep.jpg
new file mode 100755
index 0000000..4b9a03b
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/ptranep.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/rcrawley.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/rcrawley.jpg b/examples/FlexJSStore/src/assets/pic/rcrawley.jpg
new file mode 100755
index 0000000..9b60320
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/rcrawley.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/rdreifus.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/rdreifus.jpg b/examples/FlexJSStore/src/assets/pic/rdreifus.jpg
new file mode 100755
index 0000000..6a2a142
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/rdreifus.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/pic/twong.jpg
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/pic/twong.jpg b/examples/FlexJSStore/src/assets/pic/twong.jpg
new file mode 100755
index 0000000..1124b71
Binary files /dev/null and b/examples/FlexJSStore/src/assets/pic/twong.jpg differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/support_map.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/support_map.png b/examples/FlexJSStore/src/assets/support_map.png
new file mode 100755
index 0000000..c2f2394
Binary files /dev/null and b/examples/FlexJSStore/src/assets/support_map.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/support_mapmarker_a.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/support_mapmarker_a.png b/examples/FlexJSStore/src/assets/support_mapmarker_a.png
new file mode 100755
index 0000000..20c21e1
Binary files /dev/null and b/examples/FlexJSStore/src/assets/support_mapmarker_a.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/support_mapmarker_b.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/support_mapmarker_b.png b/examples/FlexJSStore/src/assets/support_mapmarker_b.png
new file mode 100755
index 0000000..069ccd8
Binary files /dev/null and b/examples/FlexJSStore/src/assets/support_mapmarker_b.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/support_mapmarker_c.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/support_mapmarker_c.png b/examples/FlexJSStore/src/assets/support_mapmarker_c.png
new file mode 100755
index 0000000..f6b587e
Binary files /dev/null and b/examples/FlexJSStore/src/assets/support_mapmarker_c.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/support_mapmarker_plus.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/support_mapmarker_plus.png b/examples/FlexJSStore/src/assets/support_mapmarker_plus.png
new file mode 100755
index 0000000..4192088
Binary files /dev/null and b/examples/FlexJSStore/src/assets/support_mapmarker_plus.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/assets/trashcan.png
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/assets/trashcan.png b/examples/FlexJSStore/src/assets/trashcan.png
new file mode 100644
index 0000000..483a37c
Binary files /dev/null and b/examples/FlexJSStore/src/assets/trashcan.png differ
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/beige.css
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/beige.css b/examples/FlexJSStore/src/beige.css
new file mode 100755
index 0000000..a5b23ba
--- /dev/null
+++ b/examples/FlexJSStore/src/beige.css
@@ -0,0 +1,170 @@
+/*
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+*/
+
+/* Style for color-specific state - Beige */
+
+@namespace "library://ns.apache.org/flexjs/basic";
+
+/*
+//----------------------------
+// Global styles
+//----------------------------
+*/
+.global
+{
+ highlightAlphas: .5, .25;
+ borderColor: #939A9D;
+ headerColors: #A65904, #E68701;
+ themeColor: #75B1CE;
+ rollOverColor: #D6E6EE;
+ selectionColor: #B8D5E4;
+}
+
+/*
+//----------------------------
+// Type selectors
+//----------------------------
+*/
+Application
+{
+ backgroundColor: #EAE6DD;
+ backgroundImage: "assets/beige_background.jpg";
+}
+
+/*
+//----------------------------
+// Apply to Panels and Alerts by default
+//----------------------------
+*/
+.windowStatus {
+ color: #FFCC99;
+}
+
+.windowStyles { /* catalog panel's title text */
+ color: #FFCC99;
+}
+
+/*
+//----------------------------
+// Named styles
+//----------------------------
+*/
+
+.colorPanel /* for the background of some surfaces */
+{
+ borderStyle: "solid";
+ borderThickness: 0;
+ backgroundColor: #BCB29F;
+ backgroundAlpha: 0.4;
+ color: #170505;
+ cornerRadius: 4;
+ dropShadowEnabled: true;
+}
+
+.homeProgramHeader /* in HomeView */
+{
+ fontWeight: "bold";
+ fontSize: 13;
+ color: #BE7E3F;
+}
+
+.homeMap
+{
+ borderStyle: "solid";
+ cornerRadius: 4;
+ backgroundColor: #BE7E3F;
+ alpha: 1;
+ dottedMap: "assets/beige_dotted_map.png";
+}
+
+.instructions
+{
+ alpha: .85;
+ color: #5C5857;
+}
+
+.storeControlBar
+{
+ fillAlphas: .60, .40;
+ fillColors: #8F8879, #BCB29F;
+ highlightAlphas: .05, .25;
+ cornerRadius: 3;
+ shadowDistance: 4;
+ paddingLeft: 0;
+ paddingRight: 0;
+ paddingTop: 0;
+ paddingBottom: 0;
+ horizontalGap: 0;
+ storeLogo: "assets/logo_orange.png";
+}
+
+.storeButtonBar
+{
+ cornerRadius: 0;
+ buttonStyleName: "storeButton";
+ themeColor: #A65904;
+}
+
+.storeButton
+{
+ cornerRadius: 0;
+ fillColors: #8F8879, #BCB29F, #A65904, #E68701;
+ fillAlphas: 1, 1;
+ highlightAlphas: .5, .25;
+ fontWeight: "normal";
+ /** need to port to ButtonView
+ selectedOverSkin: ClassReference("samples.flexstore.ButtonBarButtonSkin");
+ selectedUpSkin: ClassReference("samples.flexstore.ButtonBarButtonSkin");
+ overSkin: ClassReference("samples.flexstore.ButtonBarButtonSkin");
+ **/
+}
+
+.catalogTitleButtonSelected
+{
+ color: #FFFFFF;
+ fontWeight: "bold";
+}
+
+.catalogTitleButtonDeselected
+{
+ color: #222222;
+ fontWeight: "bold";
+}
+
+.catalogTitleButtonHighlighted
+{
+ color: #FFCC99;
+ fontWeight: "bold";
+}
+
+.catalogPanel
+{
+ highlightAlphas: .5, .25;
+ headerColors: #A65904, #E68701;
+ borderAlpha: 1;
+ borderColor: #FFFFFF;
+ borderThicknessRight: 1;
+ borderThicknessBottom: 1;
+ paddingRight: 0;
+ paddingBottom: 0;
+}
+
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/blue.css
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/blue.css b/examples/FlexJSStore/src/blue.css
new file mode 100755
index 0000000..58e98cd
--- /dev/null
+++ b/examples/FlexJSStore/src/blue.css
@@ -0,0 +1,165 @@
+/*
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+*/
+
+/* Style for color-specific state - Beige */
+
+/*
+//----------------------------
+// Global styles
+//----------------------------
+*/
+.global
+{
+ highlightAlphas: .5, .25;
+ borderColor: #939A9D;
+ headerColors: #456F84, #9ABBC9;
+ themeColor: #75B1CE;
+ rollOverColor: #D6E6EE;
+ selectionColor: #B8D5E4;
+}
+
+/*
+//----------------------------
+// Type selectors
+//----------------------------
+*/
+Application
+{
+ backgroundColor: #AAB2B7;
+ backgroundImage: Embed("assets/blue_background.jpg");
+}
+
+/*
+//----------------------------
+// Apply to Panels and Alerts by default
+//----------------------------
+*/
+.windowStatus {
+ color: #BDE9FA;
+}
+
+.windowStyles { /* catalog panel's title text */
+ color: #BDE9FA;
+}
+
+/*
+//----------------------------
+// Named styles
+//----------------------------
+*/
+
+.colorPanel /* for the background of some surfaces */
+{
+ borderStyle: "solid";
+ borderThickness: 0;
+ backgroundColor: #BDD6E2;
+ backgroundAlpha: 0.4;
+ color: #170505;
+ cornerRadius: 4;
+ dropShadowEnabled: true;
+}
+
+.homeProgramHeader /* in HomeView */
+{
+ fontWeight: "bold";
+ fontSize: 13;
+ color: #7AA4B9;
+}
+
+.homeMap
+{
+ borderStyle: "solid";
+ cornerRadius: 4;
+ backgroundColor: #7AA4B9;
+ alpha: 1;
+ dottedMap: Embed("assets/blue_dotted_map.png");
+}
+
+.instructions
+{
+ alpha: .85;
+ color: #5C5857;
+}
+
+.storeControlBar
+{
+ fillAlphas: .60, .40;
+ fillColors: #4A6F81, #BDD6E2;
+ highlightAlphas: .05, .25;
+ cornerRadius: 3;
+ shadowDistance: 4;
+ paddingLeft: 0;
+ paddingRight: 0;
+ paddingTop: 0;
+ paddingBottom: 0;
+ horizontalGap: 0;
+ storeLogo: Embed("assets/logo_blue.png");
+}
+
+.storeButtonBar
+{
+ cornerRadius: 0;
+ buttonStyleName: "storeButton";
+ themeColor: #456F84;
+}
+
+.storeButton
+{
+ cornerRadius: 0;
+ fillColors: #4A6F81, #BDD6E2, #456F84, #9ABBC9;
+ fillAlphas: 1, 1;
+ highlightAlphas: .5, .25;
+ fontWeight: "normal";
+ selectedOverSkin: ClassReference("samples.flexstore.ButtonBarButtonSkin");
+ selectedUpSkin: ClassReference("samples.flexstore.ButtonBarButtonSkin");
+ overSkin: ClassReference("samples.flexstore.ButtonBarButtonSkin");
+}
+
+.catalogTitleButtonSelected
+{
+ color: #FFFFFF;
+ fontWeight: "bold";
+}
+
+.catalogTitleButtonDeselected
+{
+ color: #222222;
+ fontWeight: "bold";
+}
+
+.catalogTitleButtonHighlighted
+{
+ color: #BDE9FA;
+ fontWeight: "bold";
+}
+
+.catalogPanel
+{
+ highlightAlphas: .5, .25;
+ headerColors: #456F84, #9ABBC9;
+ borderAlpha: 1;
+ borderColor: #FFFFFF;
+ borderThicknessRight: 1;
+ borderThicknessBottom: 1;
+ paddingRight: 0;
+ paddingBottom: 0;
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2a370c6/examples/FlexJSStore/src/data/catalog.json
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/data/catalog.json b/examples/FlexJSStore/src/data/catalog.json
new file mode 100755
index 0000000..f42a76f
--- /dev/null
+++ b/examples/FlexJSStore/src/data/catalog.json
@@ -0,0 +1,255 @@
+<?xml version : "1.0" encoding : "utf-8"?>
+<!--
+
+ 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.
+
+ -->
+{ catalog : [
+
+ { "productId" :"1",
+ "name" : "Andrew Brilliam",
+ "description" : "15 years experience. 8 years with Flex. Specializing in Text Layout Framework",
+ "price" : 60.00,
+ "image" : "assets/pic/abrilliam.jpg",
+ "experience" : 15,
+ "blazeds" : false,
+ "mobile" : false,
+ "video" : false,
+ "highlight1" : "Text Layout Framework",
+ "highlight2" : "Parsley"
+ },
+
+ { "productId" : "2",
+ "name" : "Annette Kotter",
+ "description" : "Specializing in custom components. PHP servers.",
+ "price" : 55,
+ "image" : "assets/pic/akotter.jpg",
+ "experience" : 3,
+ "blazeds" : true,
+ "mobile" : false,
+ "video" : false,
+ "highlight1" : "Custom Components",
+ "highlight2" : "PHP"
+ },
+
+ { "productId" : "3",
+ "name" : "Ben Crater",
+ "description" : "Specializing in BlazeDS backends.",
+ "price" : 55,
+ "image" : "assets/pic/bcrater.jpg",
+ "experience" : 4,
+ "blazeds" : true,
+ "mobile" : false,
+ "video" : false,
+ "highlight1" : "BlazeDS",
+ "highlight2" : "Remote Object"
+ },
+
+ { "productId" : "4",
+ "name" : "Beth Leporte",
+ "description" : "BlazeDS or PHP servers. Multimedia messagin.",
+ "price" : 70.00,
+ "image" : "assets/pic/bleporte.jpg",
+ "experience" : 6,
+ "blazeds" : true,
+ "mobile" : false,
+ "video" : false,
+ "highlight1" : "Multimedia messaging",
+ "highlight2" : "BlazeDS"
+ },
+
+ { "productId" : "5",
+ "name" : "Brad Van Brocklin",
+ "description" : "Emphasis on mobile application development",
+ "price" : 80,
+ "image" : "assets/pic/bvanbrocklin.jpg",
+ "experience" : 6,
+ "blazeds" : false,
+ "mobile" : true,
+ "video" : false,
+ "highlight1" : "Mobile",
+ "highlight2" : "Android"
+ },
+
+ { "productId" : "6",
+ "name" : "Carlos Carpenter",
+ "description" : "Built many mobile apps and video apps.",
+ "price" : 80,
+ "image" : "assets/pic/ccarpenter.jpg",
+ "experience" : 4,
+ "blazeds" : false,
+ "mobile" : true,
+ "video" : true,
+ "highlight1" : "Mobile",
+ "highlight2" : "Video"
+ },
+
+ { "productId" : "7",
+ "name" : "Christine Lampberto",
+ "description" : "7 years experience building mobile applications.",
+ "price" : 90,
+ "image" : "assets/pic/clampberto.jpg",
+ "experience" : 7,
+ "blazeds" : true,
+ "mobile" : true,
+ "video" : false,
+ "highlight1" : "BlazeDS",
+ "highlight2" : "Mobile"
+ },
+
+ { "productId" : "8",
+ "name" : "Dee Dee Avenon",
+ "description" : "I've been making video apps for over 5 years and mobile apps for about 3 years.",
+ "price" : 100,
+ "image" : "assets/pic/davenon.jpg",
+ "experience" : 10,
+ "blazeds" : false,
+ "mobile" : true,
+ "video" : true,
+ "highlight1" : "Video Applications",
+ "highlight2" : "Mobile Applications"
+ },
+
+ { "productId" : "9",
+ "name" : "Denise McGoyal",
+ "description" : "Specializing in video sharing applicaions. MObile apps too.",
+ "price" : 100,
+ "image" : "assets/pic/dmcgoyal.jpg",
+ "experience" : 5,
+ "blazeds" : false,
+ "mobile" : true,
+ "video" : true,
+ "highlight1" : "Video Applications",
+ "highlight2" : "Mobile Applications"
+ },
+
+ { "productId" : "10",
+ "name" : "Daniel Willhelm",
+ "description" : "I'm into mobile apps, video apps and social apps.",
+ "price" : 70,
+ "image" : "assets/pic/dwillhelm.jpg",
+ "experience" : 90,
+ "blazeds" : false,
+ "mobile" : true,
+ "video" : true,
+ "highlight1" : "Video Applications",
+ "highlight2" : "Mobile Applications"
+ },
+
+ { "productId" : "11",
+ "name" : "Eunice Sunderland",
+ "description" : "My recent focus is on mobile apps, but I have considerable experience in video apps as well.",
+ "price" : 150,
+ "image" : "assets/pic/esunderland.jpg",
+ "experience" : 30,
+ "blazeds" : false,
+ "mobile" : true,
+ "video" : true,
+ "highlight1" : "Video Applications",
+ "highlight2" : "Mobile Applications"
+ },
+
+ { "productId" : "12",
+ "name" : "Jane Proctor",
+ "description" : "I've been developing mobile companion apps for the past 3 years.",
+ "price" : 75,
+ "image" : "assets/pic/jproctor.jpg",
+ "experience" : 6,
+ "blazeds" : false,
+ "mobile" : true,
+ "video" : true,
+ "highlight1" : "Video Applications",
+ "highlight2" : "Mobile Applications"
+ },
+
+ { "productId" : "13",
+ "name" : "Mark Fields",
+ "description" : "Video is my favorite thing. Mobile is also a favorite.",
+ "price" : 60,
+ "image" : "assets/pic/mfields.jpg",
+ "experience" : 70,
+ "blazeds" : false,
+ "mobile" : true,
+ "video" : true,
+ "highlight1" : "Video Applications",
+ "highlight2" : "Mobile Applications"
+ },
+
+ { "productId" : "14",
+ "name" : "Patricia Dempsey",
+ "description" : "I've been cranking out mobile apps for the past 6 years. A few have involved video as well.",
+ "price" : 120,
+ "image" : "assets/pic/pdempsey.jpg",
+ "experience" : 7,
+ "blazeds" : false,
+ "mobile" : true,
+ "video" : true,
+ "highlight1" : "Video Applications",
+ "highlight2" : "Mobile Applications"
+ },
+
+ { "productId" : "15",
+ "name" : "Paul Trandep",
+ "description" : "I've been working on a mobile app that incorporates music. It just shipped so now I'm looking for the next fun thing to work on.'",
+ "price" : 50,
+ "image" : "assets/pic/ptranep.jpg",
+ "experience" : 6,
+ "blazeds" : false,
+ "mobile" : true,
+ "video" : true,
+ "highlight1" : "Video Applications",
+ "highlight2" : "Mobile Applications"
+ },
+
+ { "productId" : "16",
+ "name" : "Roscoe Crawley",
+ "description" : "My main specialty is in BlazeDS connected to Flex.",
+ "price" : 59,
+ "image" : "assets/pic/rcrawley.jpg",
+ "experience" : 9,
+ "blazeds" : true,
+ "mobile" : false,
+ "video" : false,
+ "highlight1" : "BlazeDS",
+ "highlight2" : "Remote Object"
+ },
+
+ { "productId" : "17",
+ "name" : "Renee Dreifus",
+ "description" : "I can do it all: BlazeDS, Mobile, Video.",
+ "price" : 79,
+ "image" : "assets/pic/rdreifus.jpg",
+ "experience" : 90,
+ "blazeds" : true,
+ "mobile" : true,
+ "video" : true,
+ "highlight1" : "Video Applications",
+ "highlight2" : "Mobile Applications"
+ },
+
+ { "productId" : "18",
+ "name" : "Tina Wong",
+ "description" : "I've been developing Flex apps since 1.5. Most of my recent work has been on mobile apps.",
+ "price" : 109,
+ "image" : "assets/pic/twong.jpg",
+ "experience" : 9,
+ "blazeds" : false,
+ "mobile" : true,
+ "video" : true,
+ "highlight1" : "Video Applications",
+ "highlight2" : "Mobile Applications"
+
+];
[05/14] git commit: [flex-asjs] [refs/heads/develop] - add a layout
that has only one stretchy thing
Posted by ah...@apache.org.
add a layout that has only one stretchy thing
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/06c2aff7
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/06c2aff7
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/06c2aff7
Branch: refs/heads/develop
Commit: 06c2aff738965a6e2ed7174c2e5d5b3b5df20889
Parents: 9b347d4
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 30 21:38:40 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 31 15:08:14 2014 -0700
----------------------------------------------------------------------
.../as/projects/FlexJSJX/basic-manifest.xml | 1 +
.../layouts/OneFlexibleChildVerticalLayout.as | 413 +++++++++++++++++++
2 files changed, 414 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/06c2aff7/frameworks/as/projects/FlexJSJX/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/basic-manifest.xml b/frameworks/as/projects/FlexJSJX/basic-manifest.xml
index bab814f..14ba349 100644
--- a/frameworks/as/projects/FlexJSJX/basic-manifest.xml
+++ b/frameworks/as/projects/FlexJSJX/basic-manifest.xml
@@ -76,5 +76,6 @@
<component id="ImageButton" class="org.apache.flex.html.ImageButton"/>
<component id="ParentDocumentBead" class="org.apache.flex.core.ParentDocumentBead"/>
<component id="FlexibleFirstChildHorizontalLayout" class="org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout"/>
+ <component id="OneFlexibleChildVerticalLayout" class="org.apache.flex.html.beads.layouts.OneFlexibleChildVerticalLayout"/>
</componentPackage>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/06c2aff7/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
new file mode 100644
index 0000000..cee8cad
--- /dev/null
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
@@ -0,0 +1,413 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.html.beads.layouts
+{
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.ILayoutParent;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IParentIUIBase;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The OneFlexibleChildVerticalLayout class is a simple layout
+ * bead. It takes the set of children and lays them out
+ * vertically in one column, separating them according to
+ * CSS layout rules for margin and padding styles. But it
+ * will size the one child to take up as much or little
+ * room as possible.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class OneFlexibleChildVerticalLayout implements IBeadLayout
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function OneFlexibleChildVerticalLayout()
+ {
+ }
+
+ // the strand/host container is also an ILayoutChild because
+ // can have its size dictated by the host's parent which is
+ // important to know for layout optimization
+ private var host:ILayoutChild;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ host = value as ILayoutChild;
+
+ // if host is going to be sized by its parent, then don't
+ // run layout when the children are added until after the
+ // initial sizing by the parent.
+ if (host.isWidthSizedToContent() && host.isHeightSizedToContent())
+ {
+ addOtherListeners();
+ }
+ else
+ {
+ host.addEventListener("widthChanged", changeHandler);
+ host.addEventListener("heightChanged", changeHandler);
+ host.addEventListener("sizeChanged", sizeChangeHandler);
+ if (!isNaN(host.explicitWidth) && !isNaN(host.explicitHeight))
+ addOtherListeners();
+ }
+ }
+
+ private function addOtherListeners():void
+ {
+ host.addEventListener("childrenAdded", changeHandler);
+ host.addEventListener("layoutNeeded", changeHandler);
+ host.addEventListener("itemsCreated", changeHandler);
+ }
+
+ private function sizeChangeHandler(event:Event):void
+ {
+ addOtherListeners();
+ changeHandler(event);
+ }
+
+ private function changeHandler(event:Event):void
+ {
+ var layoutParent:ILayoutParent = host.getBeadByType(ILayoutParent) as ILayoutParent;
+ var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
+
+ var ilc:ILayoutChild;
+ var n:int = contentView.numElements;
+ var marginLeft:Object;
+ var marginRight:Object;
+ var marginTop:Object;
+ var marginBottom:Object;
+ var margin:Object;
+ var maxWidth:Number = 0;
+ var horizontalMargins:Array = new Array(n);
+
+ var hh:Number = layoutParent.resizableView.height;
+ var padding:Object = determinePadding();
+ if (isNaN(padding.paddingBottom))
+ padding.paddingBottom = 0;
+ hh -= padding.paddingTop + padding.paddingBottom;
+ var yy:int = padding.paddingTop;
+ var flexChildIndex:int;
+ var ml:Number;
+ var mr:Number;
+ var mt:Number;
+ var mb:Number;
+ var lastmb:Number;
+ var lastmt:Number;
+ var halign:Object;
+
+ for (var i:int = 0; i < n; i++)
+ {
+ var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+ if (child is ILayoutChild && !isNaN(ILayoutChild(child).percentHeight))
+ {
+ flexChildIndex = i;
+ break;
+ }
+ margin = ValuesManager.valuesImpl.getValue(child, "margin");
+ if (margin is Array)
+ {
+ if (margin.length == 1)
+ marginLeft = marginTop = marginRight = marginBottom = margin[0];
+ else if (margin.length <= 3)
+ {
+ marginLeft = marginRight = margin[1];
+ marginTop = marginBottom = margin[0];
+ }
+ else if (margin.length == 4)
+ {
+ marginLeft = margin[3];
+ marginBottom = margin[2];
+ marginRight = margin[1];
+ marginTop = margin[0];
+ }
+ }
+ else if (margin == null)
+ {
+ marginLeft = ValuesManager.valuesImpl.getValue(child, "margin-left");
+ marginTop = ValuesManager.valuesImpl.getValue(child, "margin-top");
+ marginRight = ValuesManager.valuesImpl.getValue(child, "margin-right");
+ marginBottom = ValuesManager.valuesImpl.getValue(child, "margin-bottom");
+ }
+ else
+ {
+ marginLeft = marginTop = marginBottom = marginRight = margin;
+ }
+ mt = Number(marginTop);
+ if (isNaN(mt))
+ mt = 0;
+ mb = Number(marginBottom);
+ if (isNaN(mb))
+ mb = 0;
+ if (marginLeft == "auto")
+ ml = 0;
+ else
+ {
+ ml = Number(marginLeft);
+ if (isNaN(ml))
+ ml = 0;
+ }
+ if (marginRight == "auto")
+ mr = 0;
+ else
+ {
+ mr = Number(marginRight);
+ if (isNaN(mr))
+ mr = 0;
+ }
+ child.x = ml;
+ if (child is ILayoutChild)
+ {
+ ilc = child as ILayoutChild;
+ if (!isNaN(ilc.percentWidth))
+ ilc.setWidth(contentView.width * ilc.percentWidth / 100, true);
+ }
+ maxWidth = Math.max(maxWidth, ml + child.width + mr);
+ child.y = yy + mt;
+ yy += child.height + mt + mb;
+ lastmb = mb;
+ halign = ValuesManager.valuesImpl.getValue(child, "horizontal-align");
+ horizontalMargins[i] = { marginLeft: ml, marginRight: mr, halign: halign };
+ }
+
+ for (i = n - 1; i >= flexChildIndex; i--)
+ {
+ child = contentView.getElementAt(i) as IUIBase;
+ margin = ValuesManager.valuesImpl.getValue(child, "margin");
+ if (margin is Array)
+ {
+ if (margin.length == 1)
+ marginLeft = marginTop = marginRight = marginBottom = margin[0];
+ else if (margin.length <= 3)
+ {
+ marginLeft = marginRight = margin[1];
+ marginTop = marginBottom = margin[0];
+ }
+ else if (margin.length == 4)
+ {
+ marginLeft = margin[3];
+ marginBottom = margin[2];
+ marginRight = margin[1];
+ marginTop = margin[0];
+ }
+ }
+ else if (margin == null)
+ {
+ marginLeft = ValuesManager.valuesImpl.getValue(child, "margin-left");
+ marginTop = ValuesManager.valuesImpl.getValue(child, "margin-top");
+ marginRight = ValuesManager.valuesImpl.getValue(child, "margin-right");
+ marginBottom = ValuesManager.valuesImpl.getValue(child, "margin-bottom");
+ }
+ else
+ {
+ marginLeft = marginTop = marginBottom = marginRight = margin;
+ }
+ mt = Number(marginTop);
+ if (isNaN(mt))
+ mt = 0;
+ mb = Number(marginBottom);
+ if (isNaN(mb))
+ mb = 0;
+ if (marginLeft == "auto")
+ ml = 0;
+ else
+ {
+ ml = Number(marginLeft);
+ if (isNaN(ml))
+ ml = 0;
+ }
+ if (marginRight == "auto")
+ mr = 0;
+ else
+ {
+ mr = Number(marginRight);
+ if (isNaN(mr))
+ mr = 0;
+ }
+ child.x = ml;
+ if (child is ILayoutChild)
+ {
+ ilc = child as ILayoutChild;
+ if (!isNaN(ilc.percentWidth))
+ ilc.setWidth(contentView.width * ilc.percentWidth / 100, true);
+ }
+ maxWidth = Math.max(maxWidth, ml + child.width + mr);
+ child.y = hh - child.height - mb;
+ hh -= child.height + mt + mb;
+ lastmt = mt;
+ halign = ValuesManager.valuesImpl.getValue(child, "horizontal-align");
+ horizontalMargins[i] = { marginLeft: ml, marginRight: mr, halign: halign };
+ }
+
+ child = contentView.getElementAt(flexChildIndex) as IUIBase;
+ margin = ValuesManager.valuesImpl.getValue(child, "margin");
+ if (margin is Array)
+ {
+ if (margin.length == 1)
+ marginLeft = marginTop = marginRight = marginBottom = margin[0];
+ else if (margin.length <= 3)
+ {
+ marginLeft = marginRight = margin[1];
+ marginTop = marginBottom = margin[0];
+ }
+ else if (margin.length == 4)
+ {
+ marginLeft = margin[3];
+ marginBottom = margin[2];
+ marginRight = margin[1];
+ marginTop = margin[0];
+ }
+ }
+ else if (margin == null)
+ {
+ marginLeft = ValuesManager.valuesImpl.getValue(child, "margin-left");
+ marginTop = ValuesManager.valuesImpl.getValue(child, "margin-top");
+ marginRight = ValuesManager.valuesImpl.getValue(child, "margin-right");
+ marginBottom = ValuesManager.valuesImpl.getValue(child, "margin-bottom");
+ }
+ else
+ {
+ marginLeft = marginTop = marginBottom = marginRight = margin;
+ }
+ mt = Number(marginTop);
+ if (isNaN(mt))
+ mt = 0;
+ mb = Number(marginBottom);
+ if (isNaN(mb))
+ mb = 0;
+ if (marginLeft == "auto")
+ ml = 0;
+ else
+ {
+ ml = Number(marginLeft);
+ if (isNaN(ml))
+ ml = 0;
+ }
+ if (marginRight == "auto")
+ mr = 0;
+ else
+ {
+ mr = Number(marginRight);
+ if (isNaN(mr))
+ mr = 0;
+ }
+ child.x = ml;
+ if (child is ILayoutChild)
+ {
+ ilc = child as ILayoutChild;
+ if (!isNaN(ilc.percentWidth))
+ ilc.setWidth(contentView.width * ilc.percentWidth / 100, true);
+ }
+ maxWidth = Math.max(maxWidth, ml + child.width + mr);
+ child.y = yy + mt;
+ child.height = hh - yy - mb;
+ halign = ValuesManager.valuesImpl.getValue(child, "horizontal-align");
+ horizontalMargins[flexChildIndex] = { marginLeft: ml, marginRight: mr, halign: halign };
+
+ for (i = 0; i < n; i++)
+ {
+ var obj:Object = horizontalMargins[0]
+ child = contentView.getElementAt(i) as IUIBase;
+ if (obj.halign == "center")
+ child.x = (maxWidth - child.width) / 2;
+ else if (obj.halign == "bottom")
+ child.x = maxWidth - child.width - obj.marginRight;
+ else
+ child.x = obj.marginLeft;
+ }
+ layoutParent.resizableView.width = maxWidth;
+ }
+
+ // TODO (aharui): utility class or base class
+ /**
+ * Determines the top and left padding values, if any, as set by
+ * padding style values. This includes "padding" for all padding values
+ * as well as "padding-left" and "padding-top".
+ *
+ * Returns an object with paddingLeft and paddingTop properties.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function determinePadding():Object
+ {
+ var paddingLeft:Object;
+ var paddingTop:Object;
+ var paddingRight:Object;
+ var padding:Object = ValuesManager.valuesImpl.getValue(host, "padding");
+ if (typeof(padding) == "Array")
+ {
+ if (padding.length == 1)
+ paddingLeft = paddingTop = paddingRight = padding[0];
+ else if (padding.length <= 3)
+ {
+ paddingLeft = padding[1];
+ paddingTop = padding[0];
+ paddingRight = padding[1];
+ }
+ else if (padding.length == 4)
+ {
+ paddingLeft = padding[3];
+ paddingTop = padding[0];
+ paddingRight = padding[1];
+ }
+ }
+ else if (padding == null)
+ {
+ paddingLeft = ValuesManager.valuesImpl.getValue(host, "padding-left");
+ paddingTop = ValuesManager.valuesImpl.getValue(host, "padding-top");
+ paddingRight = ValuesManager.valuesImpl.getValue(host, "padding-right");
+ }
+ else
+ {
+ paddingLeft = paddingTop = paddingRight = padding;
+ }
+ var pl:Number = Number(paddingLeft);
+ var pt:Number = Number(paddingTop);
+ var pr:Number = Number(paddingRight);
+
+ return {paddingLeft:pl, paddingTop:pt, paddingRight:pr};
+ }
+
+ }
+
+}
[03/14] git commit: [flex-asjs] [refs/heads/develop] - fix wipe effect
Posted by ah...@apache.org.
fix wipe effect
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/24faad97
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/24faad97
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/24faad97
Branch: refs/heads/develop
Commit: 24faad97c80881965c913ca50c65d82e783be9c5
Parents: 3d3dfe2
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 31 14:21:44 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 31 15:08:14 2014 -0700
----------------------------------------------------------------------
.../as/projects/FlexJSJX/src/org/apache/flex/effects/Wipe.as | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/24faad97/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Wipe.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Wipe.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Wipe.as
index 5b56883..f4f2bfe 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Wipe.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Wipe.as
@@ -92,7 +92,7 @@ public class Wipe extends Tween implements IDocument
*/
public var direction:String;
- private var wiper:PlatformWiper;
+ private var wiper:PlatformWiper = new PlatformWiper();
//--------------------------------------------------------------------------
//
@@ -131,6 +131,8 @@ public class Wipe extends Tween implements IDocument
{
startValue = 0;
endValue = actualTarget.height;
+ // WipeDown makes something appear
+ actualTarget.visible = true;
wiper.visibleRect = new Rectangle(0, 0, actualTarget.width, 0);
}
@@ -139,11 +141,15 @@ public class Wipe extends Tween implements IDocument
public function onTweenUpdate(value:Number):void
{
+ trace(actualTarget, value);
wiper.visibleRect = new Rectangle(0, 0, actualTarget.width, value);
}
public function onTweenEnd(value:Number):void
{
+ // WipeUp makes something disappear
+ if (direction == "up")
+ actualTarget.visible = false;
wiper.target = null;
}
}
[11/14] git commit: [flex-asjs] [refs/heads/develop] - states with
transitions
Posted by ah...@apache.org.
states with transitions
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/a567ab9b
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/a567ab9b
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/a567ab9b
Branch: refs/heads/develop
Commit: a567ab9b8af808e3b2c905c541b25a9204597d22
Parents: f52c937
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 31 14:23:41 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 31 15:08:15 2014 -0700
----------------------------------------------------------------------
.../as/projects/FlexJSJX/src/FlexJSJXClasses.as | 1 +
.../flex/core/StatesWithTransitionsImpl.as | 279 +++++++++++++++++++
.../src/org/apache/flex/effects/Effect.as | 24 ++
.../src/org/apache/flex/effects/IEffect.as | 22 ++
.../src/org/apache/flex/effects/Move.as | 66 ++++-
.../src/org/apache/flex/core/IStatesObject.as | 13 +
6 files changed, 391 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a567ab9b/frameworks/as/projects/FlexJSJX/src/FlexJSJXClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/FlexJSJXClasses.as b/frameworks/as/projects/FlexJSJX/src/FlexJSJXClasses.as
index 2c8c944..423ac18 100644
--- a/frameworks/as/projects/FlexJSJX/src/FlexJSJXClasses.as
+++ b/frameworks/as/projects/FlexJSJX/src/FlexJSJXClasses.as
@@ -77,6 +77,7 @@ internal class FlexJSJXClasses
import org.apache.flex.html.beads.TitleBarMeasurementBead; TitleBarMeasurementBead;
import org.apache.flex.core.ParentDocumentBead; ParentDocumentBead;
+ import org.apache.flex.core.StatesWithTransitionsImpl; StatesWithTransitionsImpl;
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a567ab9b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/StatesWithTransitionsImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/StatesWithTransitionsImpl.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/StatesWithTransitionsImpl.as
new file mode 100644
index 0000000..9150d1e
--- /dev/null
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/StatesWithTransitionsImpl.as
@@ -0,0 +1,279 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 mx.states.AddItems;
+ import mx.states.SetEventHandler;
+ import mx.states.SetProperty;
+ import mx.states.State;
+
+ import org.apache.flex.core.IParent;
+ import org.apache.flex.core.IStatesObject;
+ import org.apache.flex.effects.Effect;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.ValueChangeEvent;
+ import org.apache.flex.states.Transition;
+ import org.apache.flex.utils.MXMLDataInterpreter;
+
+ /**
+ * The StatesWithTransitionsImpl class implements a set of
+ * view state functionality that includes transitions between states.
+ * It only supports AddItems and SetProperty and SetEventHandler
+ * changes at this time.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class StatesWithTransitionsImpl extends EventDispatcher implements IStatesImpl, IBead
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function StatesWithTransitionsImpl()
+ {
+ super();
+ }
+
+ private var _strand:IStrand;
+
+ private var sawInitComplete:Boolean;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ IEventDispatcher(_strand).addEventListener("currentStateChange", stateChangeHandler);
+ IEventDispatcher(_strand).addEventListener("initComplete", initialStateHandler);
+ }
+
+ private function initialStateHandler(event:org.apache.flex.events.Event):void
+ {
+ sawInitComplete = true;
+ stateChangeHandler(new ValueChangeEvent("currentStateChange", false, false, null,
+ IStatesObject(_strand).currentState));
+ }
+
+ private function stateChangeHandler(event:ValueChangeEvent):void
+ {
+ if (!sawInitComplete)
+ return;
+
+ var doc:IStatesObject = _strand as IStatesObject;
+ var transitions:Array = doc.transitions;
+ if (transitions && transitions.length > 0)
+ {
+ for each (var t:Transition in transitions)
+ {
+ if (t.fromState == "*" || t.fromState == event.oldValue)
+ {
+ if (t.toState == "*" || t.toState == event.newValue)
+ {
+ transitionEffects = t.effects.slice();
+ for each (var e:Effect in transitionEffects)
+ {
+ e.captureStartValues();
+ }
+ break;
+ }
+ }
+ }
+ }
+ var arr:Array = doc.states;
+ for each (var s:State in arr)
+ {
+ if (s.name == event.oldValue)
+ {
+ revert(s);
+ break;
+ }
+ }
+ for each (s in arr)
+ {
+ if (s.name == event.newValue)
+ {
+ apply(s);
+ break;
+ }
+ }
+ if (transitionEffects && transitionEffects.length > 0)
+ {
+ for each (e in transitionEffects)
+ {
+ e.captureEndValues();
+ }
+ }
+ var playingTransition:Boolean;
+ if (transitionEffects && transitionEffects.length > 0)
+ {
+ playingTransition = true;
+ for each (e in transitionEffects)
+ {
+ e.addEventListener(Effect.EFFECT_END, effectEndHandler);
+ e.play();
+ }
+ }
+ if (!playingTransition)
+ doc.dispatchEvent(new Event("stateChangeComplete"));
+ }
+
+ private var transitionEffects:Array;
+
+ private function effectEndHandler(event:Event):void
+ {
+ var n:int = transitionEffects.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ if (transitionEffects[i] == event.target)
+ transitionEffects.splice(i, 1);
+ }
+ if (transitionEffects.length == 0)
+ {
+ transitionEffects = null;
+ var doc:IStatesObject = _strand as IStatesObject;
+ doc.dispatchEvent(new Event("stateChangeComplete"));
+ }
+ }
+
+ private function revert(s:State):void
+ {
+ var arr:Array = s.overrides;
+ for each (var o:Object in arr)
+ {
+ if (o is AddItems)
+ {
+ var ai:AddItems = AddItems(o);
+ for each (var item:Object in ai.items)
+ {
+ var parent:IParent = item.parent as IParent;
+ parent.removeElement(item);
+ }
+ if (parent is IContainer)
+ IContainer(parent).childrenAdded();
+ }
+ else if (o is SetProperty)
+ {
+ var sp:SetProperty = SetProperty(o);
+ if (sp.target != null)
+ sp.document[sp.target][sp.name] = sp.previousValue;
+ else
+ sp.document[sp.name] = sp.previousValue;
+ }
+ else if (o is SetEventHandler)
+ {
+ var seh:SetEventHandler = SetEventHandler(o);
+ if (seh.target != null)
+ {
+ seh.document[seh.target].removeEventListener(seh.name, seh.handlerFunction);
+ }
+ else
+ {
+ seh.document.removeEventListener(seh.name, seh.handlerFunction);
+ }
+ }
+ }
+ }
+
+ private function apply(s:State):void
+ {
+ var arr:Array = s.overrides;
+ for each (var o:Object in arr)
+ {
+ if (o is AddItems)
+ {
+ var ai:AddItems = AddItems(o);
+ if (ai.items == null)
+ {
+ ai.items = ai.itemsDescriptor.items as Array;
+ if (ai.items == null)
+ {
+ ai.items =
+ MXMLDataInterpreter.generateMXMLArray(ai.document,
+ null, ai.itemsDescriptor.descriptor);
+ ai.itemsDescriptor.items = ai.items;
+ }
+ }
+ for each (var item:Object in ai.items)
+ {
+ var parent:IParent = ai.document as IParent;
+ if (ai.destination != null)
+ parent = parent[ai.destination] as IParent;
+ if (ai.relativeTo != null)
+ {
+ var child:Object = ai.document[ai.relativeTo];
+ parent = child.parent as IParent;
+ var index:int = parent.getElementIndex(child);
+ if (ai.position == "after")
+ index++;
+ parent.addElementAt(item, index);
+ }
+ else
+ {
+ parent.addElement(item);
+ }
+ }
+ if (parent is IContainer)
+ IContainer(parent).childrenAdded();
+ }
+ else if (o is SetProperty)
+ {
+ var sp:SetProperty = SetProperty(o);
+ if (sp.target != null)
+ {
+ sp.previousValue = sp.document[sp.target][sp.name];
+ sp.document[sp.target][sp.name] = sp.value;
+ }
+ else
+ {
+ sp.previousValue = sp.document[sp.name];
+ sp.document[sp.name] = sp.value;
+ }
+ }
+ else if (o is SetEventHandler)
+ {
+ var seh:SetEventHandler = SetEventHandler(o);
+ if (seh.target != null)
+ {
+ seh.document[seh.target].addEventListener(seh.name, seh.handlerFunction);
+ }
+ else
+ {
+ seh.document.addEventListener(seh.name, seh.handlerFunction);
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a567ab9b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Effect.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Effect.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Effect.as
index 8d37970..7fabe6a 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Effect.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Effect.as
@@ -234,6 +234,30 @@ public class Effect extends EventDispatcher implements IEffect
public function resume():void
{
}
+
+ /**
+ * @copy org.apache.flex.effects.IEffect#captureStartValues
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function captureStartValues():void
+ {
+ }
+
+ /**
+ * @copy org.apache.flex.effects.IEffect#captureEndValues
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function captureEndValues():void
+ {
+ }
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a567ab9b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/IEffect.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/IEffect.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/IEffect.as
index 87c48e9..f5b940c 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/IEffect.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/IEffect.as
@@ -109,6 +109,28 @@ public interface IEffect extends IEventDispatcher
* @productversion Flex 3
*/
function resume():void;
+
+ /**
+ * Tries to compute initial values
+ * for effect
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function captureStartValues():void;
+
+ /**
+ * Tries to compute final values
+ * for effect
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function captureEndValues():void;
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a567ab9b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Move.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Move.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Move.as
index 74cf73c..2a42b19 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Move.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/effects/Move.as
@@ -104,10 +104,22 @@ public class Move extends Tween implements IDocument
/**
* @private
- * The staring y.
+ * The starting y.
*/
private var yStart:Number;
+ /**
+ * @private
+ * The total change for x.
+ */
+ private var xMove:Number;
+
+ /**
+ * @private
+ * The total change for y.
+ */
+ private var yMove:Number;
+
/**
* Starting x value. If NaN, the current x value is used
*/
@@ -163,10 +175,12 @@ public class Move extends Tween implements IDocument
if (isNaN(xBy))
{
if (isNaN(xTo))
- xBy = 0;
+ xMove = 0;
else
- xBy = xTo - xStart;
+ xMove = xTo - xStart;
}
+ else
+ xMove = xBy;
if (isNaN(yFrom))
yStart = actualTarget.y;
@@ -175,28 +189,52 @@ public class Move extends Tween implements IDocument
if (isNaN(yBy))
{
if (isNaN(yTo))
- yBy = 0;
+ yMove = 0;
else
- yBy = yTo - yStart;
- }
+ yMove = yTo - yStart;
+ }
+ else
+ yMove = yBy;
+
super.play();
}
public function onTweenUpdate(value:Number):void
{
- if (xBy)
- actualTarget.x = xStart + value * xBy;
- if (yBy)
- actualTarget.y = yStart + value * yBy;
+ if (xMove)
+ actualTarget.x = xStart + value * xMove;
+ if (yMove)
+ actualTarget.y = yStart + value * yMove;
}
public function onTweenEnd(value:Number):void
{
- if (xBy)
- actualTarget.x = xStart + xBy;
- if (yBy)
- actualTarget.y = yStart + yBy;
+ if (xMove)
+ actualTarget.x = xStart + xMove;
+ if (yMove)
+ actualTarget.y = yStart + yMove;
+
}
+
+ override public function captureStartValues():void
+ {
+ if (target != null)
+ {
+ actualTarget = document[target];
+ xFrom = actualTarget.x;
+ yFrom = actualTarget.y;
+ }
+ }
+
+ override public function captureEndValues():void
+ {
+ if (target != null)
+ {
+ actualTarget = document[target];
+ xTo = actualTarget.x;
+ yTo = actualTarget.y;
+ }
+ }
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a567ab9b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IStatesObject.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IStatesObject.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IStatesObject.as
index bc2f716..be11ac7 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IStatesObject.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/IStatesObject.as
@@ -52,5 +52,18 @@ package org.apache.flex.core
*/
function get currentState():String;
+ /**
+ * The array of view state transitions.
+ * These should
+ * be instances of org.apache.flex.states.Transition.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get transitions():Array;
+
+
}
}
\ No newline at end of file
[09/14] git commit: [flex-asjs] [refs/heads/develop] - fix id
handling on objects
Posted by ah...@apache.org.
fix id handling on objects
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/ea9803cf
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/ea9803cf
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/ea9803cf
Branch: refs/heads/develop
Commit: ea9803cfcd70742743de373e368153706c92518d
Parents: 7340650
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 31 14:22:39 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 31 15:08:15 2014 -0700
----------------------------------------------------------------------
.../apache/flex/utils/MXMLDataInterpreter.as | 23 ++++++++++++++------
1 file changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ea9803cf/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MXMLDataInterpreter.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MXMLDataInterpreter.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MXMLDataInterpreter.as
index ef3d3e4..7b2982d 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MXMLDataInterpreter.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/utils/MXMLDataInterpreter.as
@@ -97,18 +97,27 @@ public class MXMLDataInterpreter
else if (simple == false)
value = generateMXMLObject(document, value as Array);
if (name == "id")
- {
- document[value] = comp;
id = value as String;
- }
+ if (name == "document" && !comp.document)
+ comp.document = document;
else if (name == "_id")
+ id = value as String; // and don't assign to comp
+ else if (name == "id")
{
- document[value] = comp;
- id = value as String;
- continue; // skip assignment to comp
+ // not all objects have to have their own id property
+ try {
+ comp["id"] = value;
+ } catch (e:Error)
+ {
+
+ }
}
- comp[name] = value;
+ else
+ comp[name] = value;
}
+ if (id)
+ document[id] = comp;
+
if (comp is IDocument)
comp.setDocument(document, id);
}
[04/14] git commit: [flex-asjs] [refs/heads/develop] - handle ioerror
Posted by ah...@apache.org.
handle ioerror
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/56727c56
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/56727c56
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/56727c56
Branch: refs/heads/develop
Commit: 56727c566e5fcf18afa7362d2930758893f93dcd
Parents: 06c2aff
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 30 21:38:56 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 31 15:08:14 2014 -0700
----------------------------------------------------------------------
.../FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as | 5 +++++
.../FlexJSUI/src/org/apache/flex/html/beads/ImageView.as | 5 +++++
2 files changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/56727c56/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
index dcb3515..7210967 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
@@ -23,6 +23,7 @@ package org.apache.flex.html.beads
import flash.display.SimpleButton;
import flash.display.Sprite;
import flash.events.Event;
+ import flash.events.IOErrorEvent;
import flash.net.URLRequest;
import org.apache.flex.core.BeadViewBase;
@@ -103,6 +104,10 @@ package org.apache.flex.html.beads
sprite.addChildAt(loader, 0);
var url:String = backgroundImage as String;
loader.load(new URLRequest(url));
+ loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
+ trace(e);
+ e.preventDefault();
+ });
loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
var host:UIButtonBase = UIButtonBase(_strand);
if (isNaN(host.explicitWidth) && isNaN(host.percentWidth))
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/56727c56/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as
index 86d5a07..c218006 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageView.as
@@ -21,6 +21,7 @@ package org.apache.flex.html.beads
import flash.display.Bitmap;
import flash.display.Loader;
import flash.display.LoaderInfo;
+ import flash.events.IOErrorEvent;
import flash.net.URLRequest;
import org.apache.flex.core.BeadViewBase;
@@ -87,6 +88,10 @@ package org.apache.flex.html.beads
if (_model.source) {
loader = new Loader();
loader.contentLoaderInfo.addEventListener("complete",onComplete);
+ loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
+ trace(e);
+ e.preventDefault();
+ });
loader.load(new URLRequest(_model.source));
}
}
[02/14] git commit: [flex-asjs] [refs/heads/develop] - fix which
parent is used for adding/removing items
Posted by ah...@apache.org.
fix which parent is used for adding/removing items
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9b347d46
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9b347d46
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9b347d46
Branch: refs/heads/develop
Commit: 9b347d463587ed28b875af78a9640ac38901c02b
Parents: 83c26c9
Author: Alex Harui <ah...@apache.org>
Authored: Thu Oct 30 21:37:40 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 31 15:08:14 2014 -0700
----------------------------------------------------------------------
.../org/apache/flex/core/SimpleStatesImpl.as | 23 ++++++++++----------
1 file changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9b347d46/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleStatesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleStatesImpl.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleStatesImpl.as
index 6fb6457..0783e28 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleStatesImpl.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleStatesImpl.as
@@ -60,6 +60,8 @@ package org.apache.flex.core
private var _strand:IStrand;
+ private var sawInitComplete:Boolean;
+
/**
* @copy org.apache.flex.core.IBead#strand
*
@@ -77,12 +79,16 @@ package org.apache.flex.core
private function initialStateHandler(event:org.apache.flex.events.Event):void
{
+ sawInitComplete = true;
stateChangeHandler(new ValueChangeEvent("currentStateChange", false, false, null,
IStatesObject(_strand).currentState));
}
private function stateChangeHandler(event:ValueChangeEvent):void
{
+ if (!sawInitComplete)
+ return;
+
var doc:IStatesObject = _strand as IStatesObject;
var arr:Array = doc.states;
for each (var s:State in arr)
@@ -114,9 +120,7 @@ package org.apache.flex.core
var ai:AddItems = AddItems(o);
for each (var item:DisplayObject in ai.items)
{
- var parent:IParent = ai.document as IParent;
- if (ai.destination != null)
- parent = parent[ai.destination] as IParent;
+ var parent:IParent = item.parent as IParent;
parent.removeElement(item);
}
if (parent is IContainer)
@@ -171,14 +175,11 @@ package org.apache.flex.core
parent = parent[ai.destination] as IParent;
if (ai.relativeTo != null)
{
- var index:int = parent.numElements;
- if (ai.relativeTo != null)
- {
- var child:Object = ai.document[ai.relativeTo];
- index = parent.getElementIndex(child);
- if (ai.position == "after")
- index++;
- }
+ var child:Object = ai.document[ai.relativeTo];
+ parent = child.parent as IParent;
+ var index:int = parent.getElementIndex(child);
+ if (ai.position == "after")
+ index++;
parent.addElementAt(item, index);
}
else
[07/14] git commit: [flex-asjs] [refs/heads/develop] - fix additems
bug
Posted by ah...@apache.org.
fix additems bug
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/8813abbf
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/8813abbf
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/8813abbf
Branch: refs/heads/develop
Commit: 8813abbf9a3dcb4f0012c6ce19496c7ff71c9a14
Parents: a567ab9
Author: Alex Harui <ah...@apache.org>
Authored: Fri Oct 31 14:44:26 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 31 15:08:15 2014 -0700
----------------------------------------------------------------------
.../src/org/apache/flex/core/StatesWithTransitionsImpl.as | 3 ++-
.../FlexJSUI/src/org/apache/flex/core/SimpleStatesImpl.as | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8813abbf/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/StatesWithTransitionsImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/StatesWithTransitionsImpl.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/StatesWithTransitionsImpl.as
index 9150d1e..ccf5e0d 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/StatesWithTransitionsImpl.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/StatesWithTransitionsImpl.as
@@ -233,7 +233,8 @@ package org.apache.flex.core
if (ai.relativeTo != null)
{
var child:Object = ai.document[ai.relativeTo];
- parent = child.parent as IParent;
+ if (ai.destination == null)
+ parent = child.parent as IParent;
var index:int = parent.getElementIndex(child);
if (ai.position == "after")
index++;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8813abbf/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleStatesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleStatesImpl.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleStatesImpl.as
index 0783e28..34f27e9 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleStatesImpl.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/SimpleStatesImpl.as
@@ -176,7 +176,8 @@ package org.apache.flex.core
if (ai.relativeTo != null)
{
var child:Object = ai.document[ai.relativeTo];
- parent = child.parent as IParent;
+ if (ai.destination == null)
+ parent = child.parent as IParent;
var index:int = parent.getElementIndex(child);
if (ai.position == "after")
index++;