You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2019/12/12 23:47:01 UTC

[royale-asjs] branch develop updated (308bb90 -> 6270a03)

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.


    from 308bb90  fix #621
     new 043a58b  jewel-datagrid: starting point creating placeholder and some support classes. Created SASS file to start the styling. Added DataGridColumn to manifest and removed from JewelClasses
     new 5f716f8  jewel-datagrid: starting example for Jewel DataGrid in Tour De Jewel
     new 567a844  jewel-datagrid: new DataGrid classes for Jewel
     new 8c4e038  jewel-datagrid: bead configuration for DataGrid
     new 437a613  jewel-datagrid: upgrade DataGrid example
     new 04902f4  jewel-datagrid: a bit of style in list columns
     new cc1fe22  jewel-datagrid: remove trace
     new 3475c60  jewel-buttonbar: Initial implementation of Jewel ButtonBar
     new 12cbb2b  jewel-datagrid: Add DataGridButoonBar
     new faf2f05  jewl-datagroup: clean import
     new f0080de  required-by-compiler-fix: fix child namespaces (royale/royale-compiler#101)
     new 46178d8  jewel-buttonbar: starting example in Tour de Jewel
     new 4a3e9f9  jewel: various import organizations and use toggleClass method in SimpleButton
     new 2bb4e46  jewel-buttonbar: add emphasis to colorize buttons in the bar
     new abe9672  jewel-datagrid: fix header typenames
     new 21b8eb5  jewel-buttonbar: improve styles
     new b5cfb6c  jewel-buttonbar: fix first and last rounded styles
     new 0006621  jewel-datagrid: global styling for header and list columns
     new 0b4ed23  jewel-datagrid: change hierachy from GroupBase to Group, and remove "initComplete" that makes creation duplicates all. Also add "emphasized" property to colorize header and Jewel IDataGrid to match that property
     new 280649b  jewel-buttonbar: add ButtonBarLayout and make ButtonBar support Collections instead of simple arrays
     new af7f91a  jewel-buttonbar: improvements to example
     new 9281de5  jewel-layout: some cleanup
     new a327415  jewel-buttonbar: update layout to have all buttons same width as default
     new cde2742  jewel-buttonbar: more examples
     new 3ac9fad  jewel-buttonbar: other style with buttons with no equal widths
     new dc64f67  jewel-buttonbar: add proportional widths in opposite to same widths
     new 6b1c95d  jewel-datagrid: get initial layout working
     new d5ca90d  jewel-datagrid: decorate data grid item renderers with a separator light line
     new ec63044  jewel-datagrid: use jewel itemenderer
     new 14dc77b  jewel-datagrid: remove top columns borders and add a soft light inner shadow as it comes from the header buttons
     new 2e967c2  jewel-datagrid: cleaning code
     new 23eb1eb  jewel-datagrid: some little changes
     new a731519  jewel-datagrid: remove change propagator since is not needed anymore
     new 900b6ca  jewel-itemrenderer: avoid renders to depend on ":hover" css state so we can manage hover programatically
     new 6f5e740  tour-de-jewel: improve DataGrid example
     new e07765a  jewel-mousecontroller: add "rollOverIndexChanged" listener to manage hover state from other places like in DataGrid columns
     new 4448a7b  jewel-datagrid: add rollover behaviour to affect all columns lists in the datagrid to show hovered state
     new 2a08eaf  jewel-themes: update for hover state changes
     new 9949c8b  jewel-buttonbar: make widthType internal to the component (will need to provide its own jewel buttonbarmodel)
     new 4458795  jewel-datagrid: clean and redo some parts in datagrid to support changes in buttonbar
     new 667f177  jewel-layouts: add support in layouts for new buttonbar widthTypes (only 2 are implemented, next will come soon)
     new 6270a03  jewel-examples: upgrade tour de jewel for the changes in ButtonBar and DataGrid

The 42 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 examples/royale/DataGridExample/pom.xml            |   2 +
 .../src/main/royale/MyInitialView.mxml             |   5 +-
 .../src/main/resources/assets}/smallbluerect.jpg   | Bin
 .../src/main/resources/assets}/smallgreenrect.jpg  | Bin
 .../src/main/resources/assets}/smallorangerect.gif | Bin
 .../src/main/resources/assets}/smallorangerect.jpg | Bin
 .../src/main/resources/assets}/smallpurplerect.jpg | Bin
 .../src/main/resources/assets}/smallredrect.jpg    | Bin
 .../src/main/resources/assets}/smallyellowrect.jpg | Bin
 .../src/main/royale/ButtonBarPlayGround.mxml       | 111 ++++++++
 .../src/main/royale/DataGridPlayGround.mxml        | 103 +++++++
 .../TourDeJewel/src/main/royale/MainContent.mxml   |   2 +
 ...temRenderer.mxml => ImageListItemRenderer.mxml} |  19 +-
 .../src/main/royale/models/ListsModel.as           |  27 ++
 .../src/main/royale/models/MainNavigationModel.as  |   4 +-
 .../src/main/royale/models/ProductModel.as}        |  27 +-
 .../src/main/royale/vos}/Product.as                | 137 +++++-----
 .../org/apache/royale/core/IDataGridModel.as       |   2 +-
 .../projects/Jewel/src/main/resources/defaults.css |  93 +++++++
 .../Jewel/src/main/resources/jewel-manifest.xml    |   8 +
 .../projects/Jewel/src/main/royale/JewelClasses.as |  12 +-
 .../royale/jewel/ApplicationResponsiveView.as      |   2 +-
 .../main/royale/org/apache/royale/jewel/Button.as  | 162 +++++------
 .../royale/org/apache/royale/jewel}/ButtonBar.as   |  78 ++++--
 .../main/royale/org/apache/royale/jewel/Card.as    |   1 -
 .../royale/org/apache/royale/jewel}/DataGrid.as    | 127 ++++++---
 .../royale/org/apache/royale/jewel/GridCell.as     |   5 +-
 .../ListSingleSelectionMouseController.as          |   1 +
 .../royale/jewel/beads/layouts/ButtonBarLayout.as  | 184 +++++++++++++
 .../royale/jewel}/beads/layouts/DataGridLayout.as  |  65 ++---
 .../royale/jewel/beads/layouts/HorizontalLayout.as |   4 +-
 .../jewel/beads/layouts/SimpleHorizontalLayout.as  |   2 +-
 .../jewel/beads/models/ArrayListSelectionModel.as  |   7 +-
 .../beads/models/DataGridPresentationModel.as      |  12 +-
 .../royale/jewel/beads/views}/ButtonBarView.as     |  26 +-
 .../royale/jewel/beads/views/DataGridView.as       | 297 +++++++++++++++++++++
 .../apache/royale/jewel/beads/views/ListView.as    |   9 +-
 .../jewel/itemRenderers/ButtonBarItemRenderer.as}  |  82 +++---
 .../apache/royale/jewel/supportClasses/Viewport.as |   5 +-
 .../jewel/supportClasses/button/SimpleButton.as    |   4 +-
 .../supportClasses/datagrid}/DataGridButtonBar.as  |  12 +-
 .../supportClasses/datagrid/DataGridColumn.as      |  16 +-
 .../supportClasses/datagrid}/DataGridColumnList.as |  15 +-
 .../supportClasses/datagrid}/DataGridListArea.as   |  12 +-
 .../jewel/supportClasses/datagrid/IDataGrid.as}    |  29 +-
 .../datagrid/IDataGridColumnList.as}               |  23 +-
 .../royale/jewel/supportClasses/list/DataGroup.as  |  16 +-
 .../{_navigation.sass => _buttonbar.sass}          |  44 +--
 .../Jewel/src/main/sass/components/_datagrid.sass  | 101 +++++++
 .../Jewel/src/main/sass/components/_layout.sass    |  15 ++
 .../projects/Jewel/src/main/sass/defaults.sass     |   2 +
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../src/main/resources/defaults.css                |   8 +-
 .../JewelTheme/src/main/resources/defaults.css     |   8 +-
 .../sass/components-primary/_itemRenderer.sass     |   2 +-
 .../main/sass/components-primary/_navigation.sass  |   2 +-
 .../src/main/sass/components-primary/_tabbar.sass  |   2 +-
 .../src/main/sass/components-primary/_table.sass   |   2 +-
 80 files changed, 1570 insertions(+), 548 deletions(-)
 copy {manualtests/ListsTest/src => examples/royale/TourDeJewel/src/main/resources/assets}/smallbluerect.jpg (100%)
 mode change 100755 => 100644
 copy {manualtests/ListsTest/src => examples/royale/TourDeJewel/src/main/resources/assets}/smallgreenrect.jpg (100%)
 mode change 100755 => 100644
 copy {manualtests/ListsTest/src => examples/royale/TourDeJewel/src/main/resources/assets}/smallorangerect.gif (100%)
 copy {manualtests/ListsTest/src => examples/royale/TourDeJewel/src/main/resources/assets}/smallorangerect.jpg (100%)
 mode change 100755 => 100644
 copy {manualtests/ListsTest/src => examples/royale/TourDeJewel/src/main/resources/assets}/smallpurplerect.jpg (100%)
 mode change 100755 => 100644
 copy {manualtests/ListsTest/src => examples/royale/TourDeJewel/src/main/resources/assets}/smallredrect.jpg (100%)
 copy {manualtests/ListsTest/src => examples/royale/TourDeJewel/src/main/resources/assets}/smallyellowrect.jpg (100%)
 mode change 100755 => 100644
 create mode 100644 examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
 create mode 100644 examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
 copy examples/royale/TourDeJewel/src/main/royale/itemRenderers/{NavigationIconLinkItemRenderer.mxml => ImageListItemRenderer.mxml} (67%)
 copy examples/royale/{DragAndDropExample/src/main/royale/models/ProductsModel.as => TourDeJewel/src/main/royale/models/ProductModel.as} (77%)
 copy examples/royale/{DataGridExample/src/main/royale/products => TourDeJewel/src/main/royale/vos}/Product.as (95%)
 copy frameworks/projects/{Basic/src/main/royale/org/apache/royale/html => Jewel/src/main/royale/org/apache/royale/jewel}/ButtonBar.as (62%)
 copy frameworks/projects/{Basic/src/main/royale/org/apache/royale/html => Jewel/src/main/royale/org/apache/royale/jewel}/DataGrid.as (61%)
 create mode 100644 frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as
 copy frameworks/projects/{Basic/src/main/royale/org/apache/royale/html => Jewel/src/main/royale/org/apache/royale/jewel}/beads/layouts/DataGridLayout.as (69%)
 copy frameworks/projects/{Basic/src/main/royale/org/apache/royale/html => Jewel/src/main/royale/org/apache/royale/jewel}/beads/models/DataGridPresentationModel.as (89%)
 copy frameworks/projects/{Basic/src/main/royale/org/apache/royale/html/beads => Jewel/src/main/royale/org/apache/royale/jewel/beads/views}/ButtonBarView.as (74%)
 create mode 100644 frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
 copy frameworks/projects/{Basic/src/main/royale/org/apache/royale/html/supportClasses/TextButtonItemRenderer.as => Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as} (82%)
 copy frameworks/projects/{Basic/src/main/royale/org/apache/royale/html => Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid}/DataGridButtonBar.as (83%)
 copy frameworks/projects/{Basic/src/main/royale/org/apache/royale/html/supportClasses => Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid}/DataGridColumnList.as (85%)
 copy frameworks/projects/{Basic/src/main/royale/org/apache/royale/html/beads => Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid}/DataGridListArea.as (86%)
 copy frameworks/projects/{Core/src/main/royale/org/apache/royale/core/IStyleObject.as => Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/IDataGrid.as} (65%)
 copy frameworks/projects/{Core/src/main/royale/org/apache/royale/core/IParentIUIBase.as => Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/IDataGridColumnList.as} (65%)
 mode change 100755 => 100644
 copy frameworks/projects/Jewel/src/main/sass/components/{_navigation.sass => _buttonbar.sass} (62%)
 create mode 100644 frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass


[royale-asjs] 23/42: jewel-buttonbar: update layout to have all buttons same width as default

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit a327415533227f19bf81d7744dbe25d59f58a2f2
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Dec 2 19:58:50 2019 +0100

    jewel-buttonbar: update layout to have all buttons same width as default
---
 .../src/main/royale/ButtonBarPlayGround.mxml       |   6 +-
 .../projects/Jewel/src/main/resources/defaults.css |   3 +
 .../royale/jewel/beads/layouts/ButtonBarLayout.as  | 104 +++++++++++++--------
 .../Jewel/src/main/sass/components/_buttonbar.sass |   1 +
 .../Jewel/src/main/sass/components/_layout.sass    |   4 +
 5 files changed, 78 insertions(+), 40 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
index 3b0c965..420f27b 100644
--- a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
@@ -44,7 +44,7 @@ limitations under the License.
 				</j:ButtonBar>
 
 				<j:ButtonBar localId="bb" change="bb_label.text = bb.selectedItem.label"
-					emphasis="primary"
+					emphasis="primary" width="100%"
 					dataProvider="{listModel.suravengers}"/>
 
 				<j:Label localId="bb_label"/>
@@ -55,9 +55,9 @@ limitations under the License.
 				<html:H4 text="ButtonBar"/>
 
 				<j:ButtonBar localId="bb2" change="bb2_label.text = bb2.selectedItem as String"
-					emphasis="secondary">
+					emphasis="secondary" width="100%">
 					<j:dataProvider>
-						<js:ArrayList source="[Features, Support, Service and Operations, four]" />
+						<js:ArrayList source="[Features, Support, Operations, Service]" />
 					</j:dataProvider>
 				</j:ButtonBar>
 
diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 0b31caa..415fecc 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -1070,6 +1070,9 @@ j|Label {
 .layout.horizontal.gap-10x3px > * {
   margin: 0px 0px 0px 30px;
 }
+.layout.horizontal.samewidth > * {
+  flex: 1 0;
+}
 .layout.vertical {
   flex-direction: column;
   flex-wrap: nowrap;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as
index 9ddd3c8..f91fbbf 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as
@@ -23,11 +23,14 @@ package org.apache.royale.jewel.beads.layouts
 	import org.apache.royale.core.IStrand;
 	import org.apache.royale.core.IStyleableObject;
 	import org.apache.royale.html.beads.models.ButtonBarModel;
+	import org.apache.royale.events.Event;
 
 	/**
 	 *  The ButtonBarLayout class bead sizes and positions the button
-	 *  elements that make up a org.apache.royale.jewel.ButtonBar. This bead arranges the Buttons
-	 *  horizontally and makes them all the same width unless the buttonWidths property has been set in which case
+	 *  elements that make up a org.apache.royale.jewel.ButtonBar.
+	 *  
+	 *  This bead arranges the Buttons horizontally and makes them all the same width 
+	 *  unless the buttonWidths property has been set in which case
 	 *  the values stored in that array are used.
 	 *
 	 *  @langversion 3.0
@@ -50,6 +53,33 @@ package org.apache.royale.jewel.beads.layouts
 			super();
 		}
 
+		/**
+		 * @royalesuppresspublicvarwarning
+		 */
+		public static const LAYOUT_TYPE_NAMES:String = "layout horizontal samewidth";
+
+		/**
+		 *  Add class selectors when the component is addedToParent
+		 *  Otherwise component will not get the class selectors when 
+		 *  perform "removeElement" and then "addElement"
+		 * 
+ 		 *  @langversion 3.0
+ 		 *  @playerversion Flash 10.2
+ 		 *  @playerversion AIR 2.6
+ 		 *  @productversion Royale 0.9.4
+ 		 */
+		override public function beadsAddedHandler(event:Event = null):void
+		{
+			super.beadsAddedHandler();
+
+			COMPILE::JS
+			{
+				if (hostClassList.contains("samewidth"))
+					hostClassList.remove("samewidth");
+				hostClassList.add("samewidth");
+			}
+		}
+
 		private var _widthType:Number = ButtonBarModel.PIXEL_WIDTHS;
 		private var _buttonWidths:Array = null;
 
@@ -97,48 +127,48 @@ package org.apache.royale.jewel.beads.layouts
 				if (!(ilc is IStyleableObject)) continue;
 				
 				COMPILE::SWF {
-					if (buttonWidths) {
-						var widthValue:* = buttonWidths[i];
+				if (buttonWidths) {
+					var widthValue:* = buttonWidths[i];
 
-						if (_widthType == ButtonBarModel.PIXEL_WIDTHS) {
-							if (widthValue != null) ilc.width = Number(widthValue);
-							IStyleableObject(ilc).style.flexGrow = 0;
-						}
-						else if (_widthType == ButtonBarModel.PROPORTIONAL_WIDTHS) {
-							if (widthValue != null) {
-								IStyleableObject(ilc).style.flexGrow = Number(widthValue);
-							}
-						}
-						else if (_widthType == ButtonBarModel.PERCENT_WIDTHS) {
-							if (widthValue != null) ilc.percentWidth = Number(widthValue);
-							IStyleableObject(ilc).style.flexGrow = 0;
+					if (_widthType == ButtonBarModel.PIXEL_WIDTHS) {
+						if (widthValue != null) ilc.width = Number(widthValue);
+						IStyleableObject(ilc).style.flexGrow = 0;
+					}
+					else if (_widthType == ButtonBarModel.PROPORTIONAL_WIDTHS) {
+						if (widthValue != null) {
+							IStyleableObject(ilc).style.flexGrow = Number(widthValue);
 						}
-					} else if (!_widthType == ButtonBarModel.NATURAL_WIDTHS) {
-						IStyleableObject(ilc).style.flexGrow = 1;
 					}
+					else if (_widthType == ButtonBarModel.PERCENT_WIDTHS) {
+						if (widthValue != null) ilc.percentWidth = Number(widthValue);
+						IStyleableObject(ilc).style.flexGrow = 0;
+					}
+				} else if (!_widthType == ButtonBarModel.NATURAL_WIDTHS) {
+					IStyleableObject(ilc).style.flexGrow = 1;
+				}
 				}
 
-				COMPILE::JS {
-					// otherwise let the flexbox layout handle matters on its own.
-					if (buttonWidths) {
-						var widthValue:* = buttonWidths[i];
+				// COMPILE::JS {
+				// // otherwise let the flexbox layout handle matters on its own.
+				// if (buttonWidths) {
+				// 	var widthValue:* = buttonWidths[i];
 
-						if (_widthType == ButtonBarModel.PIXEL_WIDTHS) {
-							if (widthValue != null) ilc.width = Number(widthValue);
-						}
-						else if (_widthType == ButtonBarModel.PROPORTIONAL_WIDTHS) {
-							if (widthValue != null) ilc.element.style["flex-grow"] = String(widthValue);
-						}
-						else if (_widthType == ButtonBarModel.PERCENT_WIDTHS) {
-							if (widthValue != null) ilc.percentWidth = Number(widthValue);
-						}
-					} else if (!_widthType == ButtonBarModel.NATURAL_WIDTHS) {
-						ilc.element.style["flex-grow"] = "1";
-					}
+				// 	if (_widthType == ButtonBarModel.PIXEL_WIDTHS) {
+				// 		if (widthValue != null) ilc.width = Number(widthValue);
+				// 	}
+				// 	else if (_widthType == ButtonBarModel.PROPORTIONAL_WIDTHS) {
+				// 		if (widthValue != null) ilc.element.style["flex-grow"] = String(widthValue);
+				// 	}
+				// 	else if (_widthType == ButtonBarModel.PERCENT_WIDTHS) {
+				// 		if (widthValue != null) ilc.percentWidth = Number(widthValue);
+				// 	}
+				// } else if (!_widthType == ButtonBarModel.NATURAL_WIDTHS) {
+				// 	ilc.element.style["flex-grow"] = "1";
+				// }
 
-                    if (!host.isHeightSizedToContent())
-    					ilc.height = contentView.height;
-				}
+				// if (!host.isHeightSizedToContent())
+				// 	ilc.height = contentView.height;
+				// }
 			}
 
 			// now let the horizontal layout take care of things.
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
index 7a2bdf7..b0d020c 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
@@ -22,6 +22,7 @@ $border-radius: .25rem
 
 // ButtonVar variables
 .jewel.buttonbar
+
     .jewel.button
         border-radius: 0
 
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_layout.sass b/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
index 920978d..6eaf222 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
@@ -81,6 +81,10 @@ $gap-size: 10px !default
 				> *
 					margin: 0px 0px 0px ($gap + $i * $gap-step)
 
+		&.samewidth
+			> *
+				flex: 1 0
+
 	// Vertical
 	&.vertical
 		flex-direction: column


[royale-asjs] 05/42: jewel-datagrid: upgrade DataGrid example

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 437a6135b46a19cdf1033ec1fdaa16260c38af04
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Tue Nov 26 18:17:14 2019 +0100

    jewel-datagrid: upgrade DataGrid example
---
 .../src/main/royale/MyInitialView.mxml             |   5 ++--
 .../src/main/resources/assets/smallbluerect.jpg    | Bin 0 -> 13500 bytes
 .../src/main/resources/assets/smallgreenrect.jpg   | Bin 0 -> 13542 bytes
 .../src/main/resources/assets/smallorangerect.gif  | Bin 0 -> 821 bytes
 .../src/main/resources/assets/smallorangerect.jpg  | Bin 0 -> 13571 bytes
 .../src/main/resources/assets/smallpurplerect.jpg  | Bin 0 -> 13517 bytes
 .../src/main/resources/assets/smallredrect.jpg     | Bin 0 -> 13477 bytes
 .../src/main/resources/assets/smallyellowrect.jpg  | Bin 0 -> 13598 bytes
 .../src/main/royale/DataGridPlayGround.mxml        |  33 +++++++--------------
 .../royale/itemRenderers/ProductItemRenderer.as    |  10 ++-----
 .../src/main/royale/models/MainNavigationModel.as  |   2 +-
 .../src/main/royale/models/ProductModel.as         |  14 +--------
 12 files changed, 19 insertions(+), 45 deletions(-)

diff --git a/examples/royale/DataGridExample/src/main/royale/MyInitialView.mxml b/examples/royale/DataGridExample/src/main/royale/MyInitialView.mxml
index 8f74f55..ad73654 100644
--- a/examples/royale/DataGridExample/src/main/royale/MyInitialView.mxml
+++ b/examples/royale/DataGridExample/src/main/royale/MyInitialView.mxml
@@ -103,8 +103,9 @@ limitations under the License.
 	<js:HContainer x="20" y="50" width="400" height="350" className="OuterGroup">
 		
 	    <!-- demonstrates how to place a DataGrid into a Container that has padding. -->
-		<js:DataGrid id="dataGrid" width="100%" height="100%" change="dataGridChange(dataGrid, output1)" 
-					 rowHeight="40" className="PercentageColumnWidths DataGrid">
+		<js:DataGrid id="dataGrid" width="100%" height="100%" 
+			change="dataGridChange(dataGrid, output1)" 
+			rowHeight="40" className="PercentageColumnWidths">
 			<js:beads>
 				<js:ConstantBinding
 					sourceID="applicationModel"
diff --git a/examples/royale/TourDeJewel/src/main/resources/assets/smallbluerect.jpg b/examples/royale/TourDeJewel/src/main/resources/assets/smallbluerect.jpg
new file mode 100644
index 0000000..80ed275
Binary files /dev/null and b/examples/royale/TourDeJewel/src/main/resources/assets/smallbluerect.jpg differ
diff --git a/examples/royale/TourDeJewel/src/main/resources/assets/smallgreenrect.jpg b/examples/royale/TourDeJewel/src/main/resources/assets/smallgreenrect.jpg
new file mode 100644
index 0000000..c5f9ce6
Binary files /dev/null and b/examples/royale/TourDeJewel/src/main/resources/assets/smallgreenrect.jpg differ
diff --git a/examples/royale/TourDeJewel/src/main/resources/assets/smallorangerect.gif b/examples/royale/TourDeJewel/src/main/resources/assets/smallorangerect.gif
new file mode 100644
index 0000000..603f810
Binary files /dev/null and b/examples/royale/TourDeJewel/src/main/resources/assets/smallorangerect.gif differ
diff --git a/examples/royale/TourDeJewel/src/main/resources/assets/smallorangerect.jpg b/examples/royale/TourDeJewel/src/main/resources/assets/smallorangerect.jpg
new file mode 100644
index 0000000..4982d87
Binary files /dev/null and b/examples/royale/TourDeJewel/src/main/resources/assets/smallorangerect.jpg differ
diff --git a/examples/royale/TourDeJewel/src/main/resources/assets/smallpurplerect.jpg b/examples/royale/TourDeJewel/src/main/resources/assets/smallpurplerect.jpg
new file mode 100644
index 0000000..201f625
Binary files /dev/null and b/examples/royale/TourDeJewel/src/main/resources/assets/smallpurplerect.jpg differ
diff --git a/examples/royale/TourDeJewel/src/main/resources/assets/smallredrect.jpg b/examples/royale/TourDeJewel/src/main/resources/assets/smallredrect.jpg
new file mode 100644
index 0000000..d2cfa31
Binary files /dev/null and b/examples/royale/TourDeJewel/src/main/resources/assets/smallredrect.jpg differ
diff --git a/examples/royale/TourDeJewel/src/main/resources/assets/smallyellowrect.jpg b/examples/royale/TourDeJewel/src/main/resources/assets/smallyellowrect.jpg
new file mode 100644
index 0000000..b17b62d
Binary files /dev/null and b/examples/royale/TourDeJewel/src/main/resources/assets/smallyellowrect.jpg differ
diff --git a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
index 6bce9cb..6ed39eb 100644
--- a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
@@ -25,8 +25,7 @@ limitations under the License.
 	xmlns:c="components.*" sourceCodeUrl="DataGridPlayGround.mxml">
 	
 	<fx:Script>
-		<![CDATA[      
-        import org.apache.royale.jewel.Label;
+		<![CDATA[
         import models.ProductModel;
 
         private function dataGridChange(grid:DataGrid, output:Label) : void
@@ -37,7 +36,7 @@ limitations under the License.
 		private function refreshGrid():void
 		{
 			dataGrid.dataProvider = null;
-			dataGrid.dataProvider = (productModel as ProductModel).productArray;
+			dataGrid.dataProvider = (productModel as ProductModel).productList;
 		}
 		]]>
 	</fx:Script>
@@ -55,12 +54,13 @@ limitations under the License.
 			<j:Card>
 				<html:H3 text="Jewel DataGrid"/>
 
-				<j:DataGrid localId="dataGrid" width="100%" height="100%" change="dataGridChange(dataGrid, output1)" 
-					rowHeight="40" className="PercentageColumnWidths DataGrid">
+				<j:DataGrid localId="dataGrid" width="100%" height="100%" 
+					change="dataGridChange(dataGrid, output1)" 
+					rowHeight="40" className="PercentageColumnWidths">
 					<j:beads>
 						<js:ConstantBinding
 							sourceID="productModel"
-							sourcePropertyName="productArray"
+							sourcePropertyName="productList"
 							destinationPropertyName="dataProvider" />
 					</j:beads>
 					<j:columns>
@@ -70,11 +70,9 @@ limitations under the License.
 					</j:columns>
 				</j:DataGrid>
 
-				<!-- controls for first grid -->
-				<j:Label id="output1" x="30" y="430"/>
-				<j:Button text="Refresh Grid" x="20" y="460" click="refreshGrid()" />
-				<j:Label text="Refresh this grid after add or removing values" x="30" y="490" />
-	
+				<j:Label id="output1" text="output1"/>
+				<j:Button text="Refresh Grid" click="refreshGrid()"/>
+				<j:Label text="Refresh this grid after add or removing values"/>
 			</j:Card>
 		</j:GridCell>
 		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
@@ -101,19 +99,10 @@ limitations under the License.
 		/* Allows the DataGrid to be specified with percentage widths for the columns (rather
 		 * than pixel widths) and does not respond to changes to its dataProvider.
 		 */
-		.PercentageColumnWidths {
+		/* .PercentageColumnWidths {
 			IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.DataGridPercentageLayout");
 			border: 1px solid #ACACAC;
-		}
-		
-		.OuterGroup {
-			background-color: orange;
-			padding: 10px;
-		}
-		.OuterGroup .DataGrid {
-			position: relative;
-		}
-
+		} */
 	</fx:Style>
 	
 </c:ExampleAndSourceCodeTabbedSectionContent>
diff --git a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ProductItemRenderer.as b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ProductItemRenderer.as
index 347c370..60deb8a 100644
--- a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ProductItemRenderer.as
+++ b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ProductItemRenderer.as
@@ -18,9 +18,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 package itemRenderers
 {
-	import org.apache.royale.html.Image;
 	import org.apache.royale.html.supportClasses.DataItemRenderer;
-
+	import org.apache.royale.jewel.Image;
+	
 	public class ProductItemRenderer extends DataItemRenderer
 	{
 		public function ProductItemRenderer()
@@ -28,14 +28,11 @@ package itemRenderers
 			super();
 		}
 
-		private var image:Image;
+		private var image:Image = new Image();
 
 		override public function addedToParent():void
 		{
 			super.addedToParent();
-
-			// add an image and two labels
-			image = new Image();
 			addElement(image);
 		}
 
@@ -43,7 +40,6 @@ package itemRenderers
 		{
 			return super.data;
 		}
-
 		override public function set data(value:Object):void
 		{
 			super.data = value;
diff --git a/examples/royale/TourDeJewel/src/main/royale/models/MainNavigationModel.as b/examples/royale/TourDeJewel/src/main/royale/models/MainNavigationModel.as
index 0e1bd4b..17a681f 100644
--- a/examples/royale/TourDeJewel/src/main/royale/models/MainNavigationModel.as
+++ b/examples/royale/TourDeJewel/src/main/royale/models/MainNavigationModel.as
@@ -57,7 +57,7 @@ package models
             new NavigationLinkVO("Layouts", "layouts_panel", MaterialIconType.VIEW_QUILT),
             new NavigationLinkVO("Grid", "grid_panel", MaterialIconType.GRID_ON),
             new NavigationLinkVO("DataGrid", "datagrid_panel", MaterialIconType.VIEW_LIST),
-            new NavigationLinkVO("Tables", "tables_panel", MaterialIconType.VIEW_LIST),
+            new NavigationLinkVO("Tables", "tables_panel", MaterialIconType.VIEW_COMFY),
             new NavigationLinkVO("TabBar", "tabbar_panel", MaterialIconType.TAB),
             new NavigationLinkVO("View States", "viewstates_panel", MaterialIconType.CHORME_READER_MODE),
             new NavigationLinkVO("Wizard", "wizards_panel", MaterialIconType.MOVIE_FILTER)
diff --git a/examples/royale/TourDeJewel/src/main/royale/models/ProductModel.as b/examples/royale/TourDeJewel/src/main/royale/models/ProductModel.as
index edbb6fe..eb89ebe 100644
--- a/examples/royale/TourDeJewel/src/main/royale/models/ProductModel.as
+++ b/examples/royale/TourDeJewel/src/main/royale/models/ProductModel.as
@@ -21,6 +21,7 @@ package models
 	import org.apache.royale.collections.ArrayList;
 	import vos.Product;
 
+	[Bindable]
 	public class ProductModel
 	{
 		private var _productList:ArrayList = new ArrayList([
@@ -35,18 +36,5 @@ package models
 		{
 			return _productList;
 		}
-		
-		private var _productArray:Array = [
-			new Product("ps100","Blueberries",44,200,"assets/smallbluerect.jpg"),
-			new Product("tx200","Kiwis",5,285,"assets/smallgreenrect.jpg"),
-			new Product("rz300","Bananas",80,105,"assets/smallyellowrect.jpg"),
-			new Product("dh440","Strawberries",10,340,"assets/smallredrect.jpg"),
-			new Product("ps220","Oranges",35,190,"assets/smallorangerect.jpg")
-		];
-		
-		public function get productArray():Array
-		{
-			return _productArray;
-		}
 	}
 }


[royale-asjs] 19/42: jewel-datagrid: change hierachy from GroupBase to Group, and remove "initComplete" that makes creation duplicates all. Also add "emphasized" property to colorize header and Jewel IDataGrid to match that property

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 0b4ed230a220ac74c61aa9cdab73433dd0f9239e
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Dec 2 14:29:42 2019 +0100

    jewel-datagrid: change hierachy from GroupBase to Group, and remove "initComplete" that makes creation duplicates all. Also add "emphasized" property to colorize header and Jewel IDataGrid to match that property
---
 .../src/main/royale/DataGridPlayGround.mxml        |  5 +--
 .../royale/org/apache/royale/jewel/DataGrid.as     | 37 ++++++++++++++++++---
 .../beads/models/DataGridPresentationModel.as      | 10 +++---
 .../royale/jewel/beads/views/DataGridView.as       | 16 +++++----
 .../apache/royale/jewel/beads/views/ListView.as    |  2 +-
 .../jewel/supportClasses/datagrid/IDataGrid.as     | 38 ++++++++++++++++++++++
 6 files changed, 89 insertions(+), 19 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
index bffd6f1..9d11a51 100644
--- a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
@@ -56,7 +56,8 @@ limitations under the License.
 
 				<j:DataGrid localId="dataGrid" width="100%" height="100%" 
 					change="dataGridChange(dataGrid, output1)" 
-					rowHeight="40" className="PercentageColumnWidths">
+					rowHeight="40" className="PercentageColumnWidths"
+					emphasis="primary">
 					<j:beads>
 						<js:ConstantBinding
 							sourceID="productModel"
@@ -64,7 +65,7 @@ limitations under the License.
 							destinationPropertyName="dataProvider" />
 					</j:beads>
 					<j:columns>
-						<j:DataGridColumn label="Image" dataField="image" columnWidth="15" itemRenderer="itemRenderers.ProductItemRenderer"/>
+						<j:DataGridColumn label="Images and Pictures" dataField="image" columnWidth="15" itemRenderer="itemRenderers.ProductItemRenderer"/>
 						<j:DataGridColumn label="Title" dataField="title" columnWidth="60" />
 						<j:DataGridColumn label="Sales" dataField="sales" columnWidth="25" />
 					</j:columns>
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
index 37f8f75..6df6f83 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
@@ -18,15 +18,14 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel
 {
-	import org.apache.royale.core.GroupBase;
 	import org.apache.royale.core.IBead;
 	import org.apache.royale.core.IChangePropagator;
-	import org.apache.royale.core.IDataGrid;
 	import org.apache.royale.core.IDataGridModel;
 	import org.apache.royale.core.IDataGridPresentationModel;
 	import org.apache.royale.core.ValuesManager;
 	import org.apache.royale.events.Event;
 	import org.apache.royale.utils.loadBeadFromValuesManager;
+	import org.apache.royale.jewel.supportClasses.datagrid.IDataGrid;
 	
 	[Event(name="change", type="org.apache.royale.events.Event")]
 	
@@ -44,7 +43,7 @@ package org.apache.royale.jewel
 	 *  @playerversion AIR 2.6
 	 *  @productversion Royale 0.9.7
 	 */
-	public class DataGrid extends GroupBase implements IDataGrid
+	public class DataGrid extends Group implements IDataGrid
 	{
 		/**
 		 *  constructor.
@@ -186,7 +185,37 @@ package org.apache.royale.jewel
 		{
 			loadBeadFromValuesManager(IChangePropagator, "iChangePropagator", this);
 			super.addedToParent();
-			dispatchEvent(new Event("initComplete"));
 		}
+
+		private var _emphasis:String;
+        /**
+		 *  Applies emphasis color display. Possible constant values are: PRIMARY, SECONDARY, EMPHASIZED.
+         *  Colors are defined in royale jewel theme CSS.
+         * 
+         *  Left without value to get the default look (light or dark).
+         *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+        public function get emphasis():String
+        {
+            return _emphasis;
+        }
+        [Inspectable(category="General", enumeration="primary,secondary,emphasized")]
+        public function set emphasis(value:String):void
+        {
+            if (_emphasis != value)
+            {
+                if(_emphasis)
+                {
+					toggleClass(_emphasis, false);
+                }
+                _emphasis = value;
+
+                toggleClass(_emphasis, value);
+            }
+        }
 	}
 }
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/models/DataGridPresentationModel.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/models/DataGridPresentationModel.as
index b1df6fd..52d1a76 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/models/DataGridPresentationModel.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/models/DataGridPresentationModel.as
@@ -24,12 +24,12 @@ package org.apache.royale.jewel.beads.models
 	
 	/**
 	 *  The DataGridPresentationModel class contains the data to label the columns
-	 *  of the org.apache.royale.html.DataGrid along with the height of the rows. 
+	 *  of the org.apache.royale.jewel.DataGrid along with the height of the rows. 
 	 *  
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10.2
 	 *  @playerversion AIR 2.6
-	 *  @productversion Royale 0.0
+	 *  @productversion Royale 0.9.7
 	 */
 	public class DataGridPresentationModel extends ListPresentationModel implements IDataGridPresentationModel
 	{
@@ -39,7 +39,7 @@ package org.apache.royale.jewel.beads.models
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.0
+		 *  @productversion Royale 0.9.7
 		 */
 		public function DataGridPresentationModel()
 		{
@@ -56,7 +56,7 @@ package org.apache.royale.jewel.beads.models
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.0
+		 *  @productversion Royale 0.9.7
 		 */
 		public function get columnLabels():Array
 		{
@@ -78,7 +78,7 @@ package org.apache.royale.jewel.beads.models
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.0
+		 *  @productversion Royale 0.9.7
 		 */
 		override public function set strand(value:IStrand):void
 		{
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
index 1916204..45b29b7 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
@@ -18,11 +18,11 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel.beads.views
 {
+	import org.apache.royale.collections.ArrayList;
 	import org.apache.royale.core.IBead;
 	import org.apache.royale.core.IBeadModel;
 	import org.apache.royale.core.IBeadView;
 	import org.apache.royale.core.IChild;
-	import org.apache.royale.core.IDataGrid;
 	import org.apache.royale.core.IDataGridModel;
 	import org.apache.royale.core.IDataGridPresentationModel;
 	import org.apache.royale.core.ILayoutChild;
@@ -38,6 +38,7 @@ package org.apache.royale.jewel.beads.views
 	import org.apache.royale.html.supportClasses.IDataGridColumnList;
 	import org.apache.royale.jewel.supportClasses.Viewport;
 	import org.apache.royale.jewel.supportClasses.datagrid.DataGridButtonBar;
+	import org.apache.royale.jewel.supportClasses.datagrid.IDataGrid;
 	import org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumn;
 
     /**
@@ -96,10 +97,10 @@ package org.apache.royale.jewel.beads.views
             return _header;
         }
 
-        public function refreshContent():void
-        {
-            handleInitComplete(null);
-        }
+        // public function refreshContent():void
+        // {
+        //     handleInitComplete(null);
+        // }
 
         /**
          * @private
@@ -126,7 +127,8 @@ package org.apache.royale.jewel.beads.views
             _header = new columnContainerClass() as DataGridButtonBar;
             // header's height is set in CSS
             _header.percentWidth = 100;
-            _header.dataProvider = sharedModel.columns;
+            _header.dataProvider = new ArrayList(sharedModel.columns);
+            _header.emphasis = host.emphasis;
             _header.labelField = "label";
             sharedModel.headerModel = _header.model as IBeadModel;
 
@@ -234,7 +236,7 @@ package org.apache.royale.jewel.beads.views
             
             // get the name of the class to use for the columns
             var columnClass:Class = ValuesManager.valuesImpl.getValue(host, "columnClass") as Class;
-            assert(columnClass != null,"ColumnClass for DataGrid must be set!")
+            assert(columnClass != null, "ColumnClass for DataGrid must be set!")
 
             var sharedModel:IDataGridModel = host.model as IDataGridModel;
             var presentationModel:IDataGridPresentationModel = host.presentationModel as IDataGridPresentationModel;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
index c5a0b6d..dd751c7 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
@@ -101,7 +101,7 @@ package org.apache.royale.jewel.beads.views
 
 		/**
 		 * @private
-		 * Ensure the list selects the selectedItem if someone is set by the user at creation time
+		 * Ensure the list selects the selectedItem if some is set by the user at creation time
 		 */
 		override protected function itemsCreatedHandler(event:Event):void
 		{
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/IDataGrid.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/IDataGrid.as
new file mode 100644
index 0000000..ed04f42
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/IDataGrid.as
@@ -0,0 +1,38 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.supportClasses.datagrid
+{
+        import org.apache.royale.core.IDataGrid;
+        
+        /**
+         *  The Jewel IDataGrid interface is implemented by any component that supports being
+         *  a "DataGrid" which means its content is generated by a factory and whose
+         *  children are item renderers (IItemRenderer).
+         * 
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.7
+         */
+        public interface IDataGrid extends org.apache.royale.core.IDataGrid
+        {
+                function get emphasis():String;
+                function set emphasis(value:String):void;
+        }
+}


[royale-asjs] 01/42: jewel-datagrid: starting point creating placeholder and some support classes. Created SASS file to start the styling. Added DataGridColumn to manifest and removed from JewelClasses

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 043a58bc14ab335ffc3a2c3a3c3be2af6fb9bcfd
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Nov 25 13:05:33 2019 +0100

    jewel-datagrid: starting point creating placeholder and some support classes. Created SASS file to start the styling. Added DataGridColumn to manifest and removed from JewelClasses
---
 .../projects/Jewel/src/main/resources/defaults.css |  12 ++
 .../Jewel/src/main/resources/jewel-manifest.xml    |   3 +
 .../projects/Jewel/src/main/royale/JewelClasses.as |   1 -
 .../royale/org/apache/royale/jewel/DataGrid.as     | 196 +++++++++++++++++++++
 .../Jewel/src/main/sass/components/_datagrid.sass  |  99 +++++++++++
 .../projects/Jewel/src/main/sass/defaults.sass     |   1 +
 6 files changed, 311 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 766be88..75b0cf4 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -457,6 +457,18 @@ j|ComboBoxPopUp {
   IBeadView: ClassReference("org.apache.royale.jewel.beads.views.ComboBoxPopUpView");
 }
 
+j|DataGrid {
+  IChangePropagator: ClassReference("org.apache.royale.html.beads.DataGridColumnChangePropagator");
+  IDataGridPresentationModel: ClassReference("org.apache.royale.html.beads.models.DataGridPresentationModel");
+  IBeadView: ClassReference("org.apache.royale.html.beads.DataGridView");
+  IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridModel");
+  IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.DataGridLayout");
+  columnClass: ClassReference("org.apache.royale.html.supportClasses.DataGridColumnList");
+  columnContainerClass: ClassReference("org.apache.royale.html.DataGridButtonBar");
+  columnLayoutClass: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout");
+  listAreaClass: ClassReference("org.apache.royale.html.beads.DataGridListArea");
+}
+
 .jewel.datechooser .jewel.table {
   min-width: 324px;
   min-height: 364px;
diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index ecb6a12..b38ee40 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -43,6 +43,9 @@
     <component id="TableHeaderCell" class="org.apache.royale.jewel.supportClasses.table.TableHeaderCell"/>
     <component id="TableColumn" class="org.apache.royale.jewel.supportClasses.table.TableColumn"/>
 
+    <component id="DataGrid" class="org.apache.royale.jewel.DataGrid"/>
+    <component id="DataGridColumn" class="org.apache.royale.jewel.supportClasses.datagrid.DataGridColumn"/>
+
     <component id="SimpleButton" class="org.apache.royale.jewel.supportClasses.button.SimpleButton"/>
     <component id="Button" class="org.apache.royale.jewel.Button"/>
     <component id="IconButton" class="org.apache.royale.jewel.IconButton"/>
diff --git a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
index f180b51..7eb7101 100644
--- a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
+++ b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
@@ -103,7 +103,6 @@ package
         import org.apache.royale.jewel.supportClasses.Viewport; Viewport;
         import org.apache.royale.jewel.supportClasses.NoViewport; NoViewport;
         import org.apache.royale.jewel.supportClasses.scrollbar.ScrollingViewport; ScrollingViewport;
-        import org.apache.royale.jewel.supportClasses.datagrid.DataGridColumn; DataGridColumn;
         import org.apache.royale.jewel.supportClasses.datechooser.DateChooserTable; DateChooserTable;
         import org.apache.royale.jewel.supportClasses.table.TBodyContentArea; TBodyContentArea;
         import org.apache.royale.jewel.supportClasses.combobox.ComboBoxPopUp; ComboBoxPopUp;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
new file mode 100644
index 0000000..cd76f93
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
@@ -0,0 +1,196 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel
+{
+	import org.apache.royale.core.GroupBase;
+	import org.apache.royale.core.IBead;
+	import org.apache.royale.core.IChangePropagator;
+	import org.apache.royale.core.IDataGrid;
+	import org.apache.royale.core.IDataGridModel;
+	import org.apache.royale.core.IDataGridPresentationModel;
+	import org.apache.royale.core.ValuesManager;
+	import org.apache.royale.events.Event;
+	import org.apache.royale.utils.loadBeadFromValuesManager;
+	
+	[Event(name="change", type="org.apache.royale.events.Event")]
+	
+	/**
+	 *  The DataGrid class displays a collection of data using columns and rows. Each
+	 *  column represents a specific field in the data set; each row represents a specific
+	 *  datum. The DataGrid is a composite component built with a org.apache.royale.html.ButtonBar 
+	 *  for the column headers and a org.apache.royale.html.List for each column. The DataGrid's 
+	 *  view bead (usually org.apache.royale.html.beads.DataGridView) constructs these parts while 
+	 *  itemRenderer factories contruct the elements to display the data in each cell.
+	 *  
+     *  @toplevel
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9.7
+	 */
+	public class DataGrid extends GroupBase implements IDataGrid
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function DataGrid()
+		{
+			super();
+			
+			typeNames = "jewel datagrid";
+			
+			// set a reasonable default size
+			width = 200;
+			height = 200;
+		}
+		
+		/**
+		 *  The array of org.apache.royale.html.supportClasses.DataGridColumns used to 
+		 *  describe each column.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 *  @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 */
+		public function get columns():Array
+		{
+			return IDataGridModel(model).columns;
+		}
+		/**
+		 * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 */
+		public function set columns(value:Array):void
+		{
+			IDataGridModel(model).columns = value;
+		}
+		
+		/**
+		 *  The object used to provide data to the org.apache.royale.html.DataGrid.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 *  @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 */
+		public function get dataProvider():Object
+		{
+			return IDataGridModel(model).dataProvider;
+		}
+		/**
+		 * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 */
+		public function set dataProvider(value:Object):void
+		{
+			IDataGridModel(model).dataProvider = value;
+		}
+		
+		/**
+		 *  The currently selected row.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 *  @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 */
+		[Bindable("change")]
+		public function get selectedIndex():int
+		{
+			return IDataGridModel(model).selectedIndex;
+		}
+		/**
+		 * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 */
+		public function set selectedIndex(value:int):void
+		{
+			IDataGridModel(model).selectedIndex = value;
+		}
+		
+		/**
+		 * @private
+		 */
+		private var _presentationModel:IDataGridPresentationModel;
+		
+		/**
+		 *  The DataGrid's presentation model
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 *  @royaleignorecoercion org.apache.royale.core.IDataGridPresentationModel
+		 *  @royaleignorecoercion org.apache.royale.core.IBead
+		 */
+		public function get presentationModel():IBead
+		{
+			if (_presentationModel == null) {
+				var c:Class = ValuesManager.valuesImpl.getValue(this, "iDataGridPresentationModel");
+				if (c) {
+					_presentationModel = new c() as IDataGridPresentationModel;
+					addBead(_presentationModel as IBead);
+				}
+			}
+			
+			return _presentationModel;
+		}
+		/**
+		 * @royaleignorecoercion org.apache.royale.core.IDataGridPresentationModel
+		 */
+		public function set presentationModel(value:IBead):void
+		{
+			_presentationModel = value as IDataGridPresentationModel;
+		}
+				
+		/**
+		 *  The default height of each cell in every column
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 *  @royaleignorecoercion org.apache.royale.core.IDataGridPresentationModel
+		 */
+		public function get rowHeight():Number
+		{
+			return (presentationModel as IDataGridPresentationModel).rowHeight;
+		}
+        /**
+         * @royaleignorecoercion org.apache.royale.core.IDataGridPresentationModel
+         */
+		public function set rowHeight(value:Number):void
+		{
+			(presentationModel as IDataGridPresentationModel).rowHeight = value;
+		}
+		
+		override public function addedToParent():void
+		{
+			loadBeadFromValuesManager(IChangePropagator, "iChangePropagator", this);
+			super.addedToParent();
+			dispatchEvent(new Event("initComplete"));
+		}
+	}
+}
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
new file mode 100644
index 0000000..827b040
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
@@ -0,0 +1,99 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+// Jewel DataGrid
+
+// DataGrid variables
+
+.jewel.datagrid
+
+j|DataGrid
+    IChangePropagator: ClassReference("org.apache.royale.html.beads.DataGridColumnChangePropagator")
+    IDataGridPresentationModel: ClassReference("org.apache.royale.html.beads.models.DataGridPresentationModel")
+    IBeadView: ClassReference("org.apache.royale.html.beads.DataGridView")
+    IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridModel")
+    IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.DataGridLayout")
+    columnClass: ClassReference("org.apache.royale.html.supportClasses.DataGridColumnList")
+    columnContainerClass: ClassReference("org.apache.royale.html.DataGridButtonBar")
+    columnLayoutClass: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout")
+    listAreaClass: ClassReference("org.apache.royale.html.beads.DataGridListArea")
+
+// DataGridButtonBar
+// {
+// IBeadModel: ClassReference("org.apache.royale.html.beads.models.ButtonBarModel")
+// IBeadView:  ClassReference("org.apache.royale.html.beads.ButtonBarView")			
+// IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController")
+// IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout")
+// IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.TextItemRendererFactoryForArrayData")
+// IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory")
+// IItemRenderer: ClassReference("org.apache.royale.html.supportClasses.TextButtonItemRenderer")
+
+// border-style: none
+// height: 40px
+// min-height: 40px
+// flex-grow: 0
+// }
+
+// DataGridColumnList {
+// IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridModel")
+// IBeadView:  ClassReference("org.apache.royale.html.beads.ListView")			
+// IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController")
+// IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.VerticalLayout")
+// IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.DataItemRendererFactoryForArrayData")
+// IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory")
+// IItemRenderer: ClassReference("org.apache.royale.html.supportClasses.StringItemRenderer")
+// IViewport: ClassReference("org.apache.royale.html.supportClasses.Viewport")
+// IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
+// border-style: none
+// background-color: #FFFFFF
+// }
+
+// DataGridListArea {
+// background-color: #FFFFFF
+// IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.HorizontalLayout")
+// IViewport: ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport")
+// IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
+// flex-grow: 1
+// }
+
+// DynamicDataGrid {
+// IChangePropagator: ClassReference("org.apache.royale.html.beads.DataGridColumnChangePropagator")
+// IDataGridPresentationModel: ClassReference("org.apache.royale.html.beads.models.DataGridPresentationModel")
+// IBeadView: ClassReference("org.apache.royale.html.beads.DataGridView")
+// IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel")
+// IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.DataGridLayout")
+// ColumnClass: ClassReference("org.apache.royale.html.supportClasses.DynamicDataGridColumnList")
+
+// background-color: #FFFFFF
+// border: 1px solid #222222
+// }
+
+// DynamicDataGridColumnList {
+// IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel")
+// IBeadView:  ClassReference("org.apache.royale.html.beads.ListView")			
+// IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController")
+// IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.VerticalLayout")
+// IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.DataItemRendererFactoryForCollectionView")
+// IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory")
+// IItemRenderer: ClassReference("org.apache.royale.html.supportClasses.StringItemRenderer")
+// IViewport: ClassReference("org.apache.royale.html.supportClasses.Viewport")
+// IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
+// border-style: none
+// background-color: #FFFFFF
+// }
\ No newline at end of file
diff --git a/frameworks/projects/Jewel/src/main/sass/defaults.sass b/frameworks/projects/Jewel/src/main/sass/defaults.sass
index d17b721..f848b27 100644
--- a/frameworks/projects/Jewel/src/main/sass/defaults.sass
+++ b/frameworks/projects/Jewel/src/main/sass/defaults.sass
@@ -30,6 +30,7 @@
 @import "components/checkbox"
 @import "components/controlbar"
 @import "components/combobox"
+@import "components/datagrid"
 @import "components/datechooser"
 @import "components/datefield"
 @import "components/divider"


[royale-asjs] 32/42: jewel-datagrid: some little changes

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 23eb1eb2057bb9f1cc90c2e729721ebc67e8bb37
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sat Dec 7 10:02:09 2019 +0100

    jewel-datagrid: some little changes
---
 .../apache/royale/jewel/beads/models/ArrayListSelectionModel.as    | 7 +++----
 .../main/royale/org/apache/royale/jewel/beads/views/ListView.as    | 2 +-
 .../supportClasses/datagrid/DataGridColumnChangePropagator.as      | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/models/ArrayListSelectionModel.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/models/ArrayListSelectionModel.as
index 45c247a..96259bd 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/models/ArrayListSelectionModel.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/models/ArrayListSelectionModel.as
@@ -18,6 +18,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel.beads.models
 {
+	COMPILE::SWF{
+	import flash.events.Event;
+	}
 	import org.apache.royale.collections.IArrayList;
 	import org.apache.royale.core.IRollOverModel;
 	import org.apache.royale.core.IStrand;
@@ -26,10 +29,6 @@ package org.apache.royale.jewel.beads.models
 	import org.apache.royale.events.IEventDispatcher;
 	import org.apache.royale.jewel.beads.models.IJewelSelectionModel;
 
-	COMPILE::SWF{
-		import flash.events.Event;
-	}
-
     /**
      *  The ArrayListSelectionModel class is a selection model for
      *  a dataProvider that is an ArrayList. It assumes that items
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
index dd751c7..04f9a08 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
@@ -131,7 +131,7 @@ package org.apache.royale.jewel.beads.views
 		/**
 		 * @private
 		 * @royaleignorecoercion org.apache.royale.core.ISelectableItemRenderer
-		 * * @royaleignorecoercion org.apache.royale.core.IRollOverModel
+		 * @royaleignorecoercion org.apache.royale.core.IRollOverModel
 		 */
 		protected function rollOverIndexChangeHandler(event:Event):void
 		{
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnChangePropagator.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnChangePropagator.as
index 4ef0ac1..8ed6bcc 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnChangePropagator.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnChangePropagator.as
@@ -36,7 +36,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10.2
 	 *  @playerversion AIR 2.6
-	 *  @productversion Royale 0.9
+	 *  @productversion Royale 0.9.7
 	 */
 	public class DataGridColumnChangePropagator implements IChangePropagator
 	{


[royale-asjs] 10/42: jewl-datagroup: clean import

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit faf2f057e153a8ef874bfdfbec5bf24a048a47f3
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Nov 27 18:20:48 2019 +0100

    jewl-datagroup: clean import
---
 .../main/royale/org/apache/royale/jewel/supportClasses/list/DataGroup.as | 1 -
 1 file changed, 1 deletion(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/list/DataGroup.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/list/DataGroup.as
index 4309c85..72f2a87 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/list/DataGroup.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/list/DataGroup.as
@@ -18,7 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel.supportClasses.list
 {
-	import org.apache.royale.html.supportClasses.DataGroup;
 	import org.apache.royale.html.DataContainer;
     import org.apache.royale.core.IBead;
     import org.apache.royale.core.IStrand;


[royale-asjs] 03/42: jewel-datagrid: new DataGrid classes for Jewel

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 567a844922a21964429d53317762a25b2156ec25
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Tue Nov 26 18:15:25 2019 +0100

    jewel-datagrid: new DataGrid classes for Jewel
---
 .../projects/Jewel/src/main/royale/JewelClasses.as |   7 +
 .../royale/org/apache/royale/jewel/DataGrid.as     |   4 -
 .../royale/jewel/beads/layouts/DataGridLayout.as   | 180 +++++++++++++
 .../beads/models/DataGridPresentationModel.as      |  88 +++++++
 .../royale/jewel/beads/views/DataGridView.as       | 279 +++++++++++++++++++++
 .../supportClasses/datagrid/DataGridColumn.as      |  16 +-
 .../datagrid/DataGridColumnChangePropagator.as     |  87 +++++++
 .../supportClasses/datagrid/DataGridColumnList.as  |  77 ++++++
 .../supportClasses/datagrid/DataGridListArea.as    |  35 +++
 9 files changed, 761 insertions(+), 12 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
index 7eb7101..e27ee9b 100644
--- a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
+++ b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
@@ -42,6 +42,8 @@ package
         import org.apache.royale.jewel.beads.models.WizardModel; WizardModel;
         import org.apache.royale.jewel.beads.models.WizardStep; WizardStep;
         import org.apache.royale.jewel.beads.models.PopUpModel; PopUpModel;
+        import org.apache.royale.jewel.beads.models.ListPresentationModel; ListPresentationModel;
+        import org.apache.royale.jewel.beads.models.DataGridPresentationModel; DataGridPresentationModel;
 
         import org.apache.royale.jewel.beads.controllers.PopUpMouseController; PopUpMouseController;
         import org.apache.royale.jewel.beads.controllers.SpinnerMouseController; SpinnerMouseController;
@@ -110,6 +112,11 @@ package
         import org.apache.royale.jewel.supportClasses.formitem.FormItemLayoutProxy; FormItemLayoutProxy;
         import org.apache.royale.jewel.supportClasses.wizard.WizardLayoutProxy; WizardLayoutProxy;
         import org.apache.royale.jewel.supportClasses.button.SelectableButtonBase; SelectableButtonBase;
+        
+        import org.apache.royale.jewel.beads.views.DataGridView; DataGridView;
+        import org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList; DataGridColumnList;
+        import org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator; DataGridColumnChangePropagator;
+        import org.apache.royale.jewel.beads.layouts.DataGridLayout; DataGridLayout;
 
         import org.apache.royale.jewel.supportClasses.util.positionInsideBoundingClientRect; positionInsideBoundingClientRect;
 
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
index cd76f93..37f8f75 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
@@ -59,10 +59,6 @@ package org.apache.royale.jewel
 			super();
 			
 			typeNames = "jewel datagrid";
-			
-			// set a reasonable default size
-			width = 200;
-			height = 200;
 		}
 		
 		/**
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
new file mode 100644
index 0000000..669ee9b
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
@@ -0,0 +1,180 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.beads.layouts
+{	
+    import org.apache.royale.core.IBeadLayout;
+    import org.apache.royale.core.IBorderPaddingMarginValuesImpl;
+    import org.apache.royale.core.IDataGridModel;
+    import org.apache.royale.core.IStrand;
+    import org.apache.royale.core.IUIBase;
+    import org.apache.royale.core.UIBase;
+    import org.apache.royale.core.ValuesManager;
+    import org.apache.royale.core.layout.EdgeData;
+    import org.apache.royale.events.Event;
+    import org.apache.royale.events.IEventDispatcher;
+    import org.apache.royale.html.beads.IDataGridView;
+    import org.apache.royale.html.beads.models.ButtonBarModel;
+    import org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumn;
+	
+	/**
+	 * DataGridLayout is a class that handles the size and positioning of the
+	 * elements of a DataGrid. This includes the ButtonBar used for the column
+	 * headers and the Lists that are the columns.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9
+	 */
+	public class DataGridLayout implements IBeadLayout
+	{
+		/**
+		 *  constructor
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 */
+		public function DataGridLayout()
+		{
+		}
+		
+		protected var _strand:IStrand;
+		
+		/**
+		 *  @copy org.apache.royale.core.IBead#strand
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 *  @royaleignorecoercion org.apache.royale.events.IEventDispatcher
+		 */
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			
+			(_strand as IEventDispatcher).addEventListener("widthChanged", handleSizeChanges);
+			(_strand as IEventDispatcher).addEventListener("heightChanged", handleSizeChanges);
+			(_strand as IEventDispatcher).addEventListener("sizeChanged", handleSizeChanges);
+			(_strand as IEventDispatcher).addEventListener("layoutNeeded", handleLayoutNeeded);
+		}
+		
+		/**
+		 * @royaleignorecoercion org.apache.royale.core.UIBase
+		 */
+		protected function get uiHost():UIBase
+		{
+			return _strand as UIBase;
+		}
+		
+		private function handleSizeChanges(event:Event):void
+		{
+			layout();
+		}
+		
+		private function handleLayoutNeeded(event:Event):void
+		{
+			layout();
+		}
+		
+		/**
+		 * @copy org.apache.royale.core.IBeadLayout#layout
+         * @royaleignorecoercion org.apache.royale.core.IBorderPaddingMarginValuesImpl
+         * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+         * @royaleignorecoercion org.apache.royale.core.IUIBase
+		 * @royaleignorecoercion org.apache.royale.core.UIBase
+		 * @royaleignorecoercion org.apache.royale.html.beads.IDataGridView
+		 * @royaleignorecoercion org.apache.royale.html.beads.models.ButtonBarModel
+		 * @royaleignorecoercion org.apache.royale.html.supportClasses.IDataGridColumn
+		 */
+		public function layout():Boolean
+		{
+		// 	var header:IUIBase = (uiHost.view as IDataGridView).header;
+        //     // fancier DG's will filter invisible columns and only put visible columns
+        //     // in the bbmodel, so do all layout based on the bbmodel, not the set
+        //     // of columns that may contain invisible columns
+        //     var bbmodel:ButtonBarModel = header.getBeadByType(ButtonBarModel) as ButtonBarModel;
+		// 	var listArea:IUIBase = (uiHost.view as IDataGridView).listArea;
+			
+		// 	var displayedColumns:Array = (uiHost.view as IDataGridView).columnLists;
+		// 	var model:IDataGridModel = uiHost.model as IDataGridModel;
+			
+		// 	var borderMetrics:EdgeData = (ValuesManager.valuesImpl as IBorderPaddingMarginValuesImpl).getBorderMetrics(_strand as IUIBase);			
+		// 	var useWidth:Number = uiHost.width - (borderMetrics.left + borderMetrics.right);
+		// 	var useHeight:Number = uiHost.height - (borderMetrics.top + borderMetrics.bottom);
+			
+		// 	var xpos:Number = 0;
+		// 	var defaultColumnWidth:Number = (useWidth) / bbmodel.dataProvider.length;
+		// 	var columnWidths:Array = [];
+			
+		// 	for(var i:int=0; i < bbmodel.dataProvider.length; i++) {
+		// 		var columnDef:IDataGridColumn = bbmodel.dataProvider[i] as IDataGridColumn;
+		// 		var columnList:UIBase = displayedColumns[i] as UIBase;
+				
+		// 		// probably do not need to set (x,y), but if the Container's layout requires it, they will be set.
+		// 		columnList.x = xpos;
+		// 		columnList.y = 0;
+				
+		// 		var columnWidth:Number = defaultColumnWidth;
+		// 		if (!isNaN(columnDef.columnWidth)) {
+		// 			columnWidth = columnDef.columnWidth;
+		// 		}
+				
+		// 		columnList.width = columnWidth;
+		// 		columnWidths.push(columnWidth);
+				
+		// 		xpos += columnList.width;
+		// 	}
+			
+		// 	bbmodel.buttonWidths = columnWidths;
+			
+		// 	COMPILE::SWF {
+        //         header.y = borderMetrics.top;
+        //         header.x = borderMetrics.left;
+		// 		header.width = useWidth;
+		// 	}
+		// 	COMPILE::JS {
+		// 		(header as UIBase).percentWidth = 100;
+		// 		listArea.element.style.position = "absolute";
+        //         if (!(uiHost.element.style.position == 'absolute' ||
+        //               uiHost.element.style.position == 'relative' ||
+        //               uiHost.element.style.position == 'fixed'))
+        //             uiHost.element.style.position = 'relative';
+		// 	}
+		// 	// header's height is set in CSS
+			
+        //     listArea.y = header.height + header.y;
+		// 	COMPILE::SWF {
+        //         listArea.x = borderMetrics.left;
+		// 		listArea.width = useWidth;
+		// 	}
+		// 	COMPILE::JS {
+		// 		(listArea as UIBase).percentWidth = 100;
+		// 	}
+		// 	listArea.height = useHeight - header.height;
+			
+		// 	header.dispatchEvent(new Event("layoutNeeded"));
+		// 	listArea.dispatchEvent(new Event("layoutNeeded"));
+			
+			return true;
+		}
+	}
+}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/models/DataGridPresentationModel.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/models/DataGridPresentationModel.as
new file mode 100644
index 0000000..b1df6fd
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/models/DataGridPresentationModel.as
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.beads.models
+{
+	import org.apache.royale.core.IDataGridPresentationModel;
+	import org.apache.royale.core.IStrand;
+	import org.apache.royale.events.Event;
+	
+	/**
+	 *  The DataGridPresentationModel class contains the data to label the columns
+	 *  of the org.apache.royale.html.DataGrid along with the height of the rows. 
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.0
+	 */
+	public class DataGridPresentationModel extends ListPresentationModel implements IDataGridPresentationModel
+	{
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.0
+		 */
+		public function DataGridPresentationModel()
+		{
+			super();
+			
+			separatorThickness = 1;
+		}
+		
+		private var _columnLabels:Array;
+		
+		/**
+		 *  The labels for each column.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.0
+		 */
+		public function get columnLabels():Array
+		{
+			return _columnLabels;
+		}
+		public function set columnLabels(value:Array):void
+		{
+			if (value != _columnLabels) {
+				_columnLabels = value;
+				dispatchEvent(new Event("columnsChanged"));
+			}
+		}
+		
+		private var _strand:IStrand;
+		
+		/**
+		 *  @copy org.apache.royale.core.IBead#strand
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.0
+		 */
+		override public function set strand(value:IStrand):void
+		{
+			_strand = value;
+		}
+	}
+}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
new file mode 100644
index 0000000..5f4677a
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.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.royale.jewel.beads.views
+{
+	import org.apache.royale.core.IBead;
+	import org.apache.royale.core.IBeadModel;
+	import org.apache.royale.core.IBeadView;
+	import org.apache.royale.core.IChild;
+	import org.apache.royale.core.IDataGrid;
+	import org.apache.royale.core.IDataGridModel;
+	import org.apache.royale.core.IDataGridPresentationModel;
+	import org.apache.royale.core.ILayoutChild;
+	import org.apache.royale.core.IParent;
+	import org.apache.royale.core.IUIBase;
+	import org.apache.royale.core.ValuesManager;
+	import org.apache.royale.debugging.assert;
+	import org.apache.royale.events.Event;
+	import org.apache.royale.events.IEventDispatcher;
+	import org.apache.royale.html.DataGridButtonBar;
+	import org.apache.royale.html.beads.GroupView;
+	import org.apache.royale.html.beads.IDataGridView;
+	import org.apache.royale.html.beads.layouts.ButtonBarLayout;
+	import org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumn;
+	import org.apache.royale.html.supportClasses.IDataGridColumnList;
+	import org.apache.royale.jewel.supportClasses.Viewport;
+
+    /**
+     *  The DataGridView class is the visual bead for the org.apache.royale.jewel.DataGrid.
+     *  This class constructs the items that make the DataGrid: Lists for each column and a
+     *  org.apache.royale.jewel.ButtonBar for the column headers.
+     *
+     *  @viewbead
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.9.7
+     */
+    public class DataGridView extends GroupView implements IBeadView, IDataGridView
+    {
+        /**
+         *  constructor.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.7
+         */
+        public function DataGridView()
+        {
+            super();
+        }
+
+        private var _header:DataGridButtonBar;
+        private var _listArea:IUIBase;
+
+        private var _lists:Array;
+
+        /**
+         * An array of List objects the comprise the columns of the DataGrid.
+         */
+        public function get columnLists():Array
+        {
+            return _lists;
+        }
+
+        /**
+         * The area used to hold the columns
+         *
+         */
+        public function get listArea():IUIBase
+        {
+            return _listArea;
+        }
+
+        /**
+         * Returns the component used as the header for the DataGrid.
+         */
+        public function get header():IUIBase
+        {
+            return _header;
+        }
+
+        public function refreshContent():void
+        {
+            handleInitComplete(null);
+        }
+
+        /**
+         * @private
+         * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+         * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
+         * @royaleignorecoercion org.apache.royale.core.IBead
+         * @royaleignorecoercion org.apache.royale.core.IBeadModel
+         * @royaleignorecoercion org.apache.royale.core.IChild
+         * @royaleignorecoercion org.apache.royale.core.ILayoutChild
+         * @royaleignorecoercion org.apache.royale.core.IUIBase
+         * @royaleignorecoercion org.apache.royale.html.DataGrid
+         */
+        override protected function handleInitComplete(event:Event):void
+        {
+            var host:IDataGrid = _strand as IDataGrid;
+
+            // see if there is a presentation model already in place. if not, add one.
+            var sharedModel:IDataGridModel = host.model as IDataGridModel;
+            IEventDispatcher(sharedModel).addEventListener("dataProviderChanged", handleDataProviderChanged);
+            IEventDispatcher(sharedModel).addEventListener("selectedIndexChanged", handleSelectedIndexChanged);
+
+            var columnContainerClass:Class = ValuesManager.valuesImpl.getValue(host, "columnContainerClass") as Class;
+            assert(columnContainerClass != null,"columnContainerClass for DataGrid must be set!")
+            _header = new columnContainerClass() as DataGridButtonBar;
+            // header's height is set in CSS
+            _header.percentWidth = 100;
+            _header.dataProvider = sharedModel.columns;
+            _header.labelField = "label";
+            sharedModel.headerModel = _header.model as IBeadModel;
+
+            var listAreaClass:Class = ValuesManager.valuesImpl.getValue(host, "listAreaClass") as Class;
+            trace("listAreaClass: " + listAreaClass);
+            assert(listAreaClass != null,"listAreaClass for DataGrid must be set!")
+            _listArea = new listAreaClass() as IUIBase;
+            (_listArea as ILayoutChild).percentWidth = 100;
+
+            if (sharedModel.columns)
+                createLists();
+
+            var columnLayoutClass:Class = ValuesManager.valuesImpl.getValue(host, "columnLayoutClass") as Class;
+            assert(columnLayoutClass != null,"columnLayoutClass for DataGrid must be set!")
+            var bblayout:ButtonBarLayout = new columnLayoutClass() as ButtonBarLayout;
+            _header.addBead(bblayout as IBead);
+            _header.addBead(new Viewport() as IBead);
+            host.strandChildren.addElement(_header as IChild);
+
+            host.strandChildren.addElement(_listArea as IChild);
+
+            handleDataProviderChanged(event);
+
+            host.addEventListener("widthChanged", handleSizeChanges);
+            host.addEventListener("heightChanged", handleSizeChanges);
+
+            host.dispatchEvent(new Event("dataGridViewCreated"));
+        }
+
+        /**
+         * @private
+         */
+        private function handleSizeChanges(event:Event):void
+        {
+            _header.dispatchEvent(new Event("layoutChanged"));
+            _listArea.dispatchEvent(new Event("layoutChanged"));
+        }
+
+        /**
+         * @private
+         */
+        protected function handleDataProviderChanged(event:Event):void
+        {
+            var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+            for (var i:int=0; i < _lists.length; i++)
+            {
+                var list:IDataGridColumnList = _lists[i] as IDataGridColumnList;
+                list.dataProvider = sharedModel.dataProvider;
+            }
+            host.dispatchEvent(new Event("layoutNeeded"));
+        }
+
+        /**
+         * @private
+         * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+         * @royaleignorecoercion org.apache.royale.html.supportClasses.IDataGridColumnList
+         */
+        private function handleSelectedIndexChanged(event:Event):void
+        {
+            var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+            var newIndex:int = sharedModel.selectedIndex;
+
+            for (var i:int=0; i < _lists.length; i++)
+            {
+                var list:IDataGridColumnList = _lists[i] as IDataGridColumnList;
+                list.selectedIndex = newIndex;
+            }
+        }
+
+        /**
+         * @private
+         * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+         * @royaleignorecoercion org.apache.royale.html.supportClasses.IDataGridColumnList
+         */
+        private function handleColumnListChange(event:Event):void
+        {
+            var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+            var list:IDataGridColumnList = event.target as IDataGridColumnList;
+            sharedModel.selectedIndex = list.selectedIndex;
+
+            for(var i:int=0; i < _lists.length; i++) {
+                if (list != _lists[i]) {
+                    var otherList:IDataGridColumnList = _lists[i] as IDataGridColumnList;
+                    otherList.selectedIndex = list.selectedIndex;
+                }
+            }
+
+            host.dispatchEvent(new Event('change'));
+        }
+
+        /**
+         * @private
+         * @royaleignorecoercion String
+         * @royaleignorecoercion Class
+         * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+         * @royaleignorecoercion org.apache.royale.core.IBead
+         * @royaleignorecoercion org.apache.royale.core.IChild
+         * @royaleignorecoercion org.apache.royale.core.IParent
+         * @royaleignorecoercion org.apache.royale.core.IDataGrid
+         * @royaleignorecoercion org.apache.royale.core.IDataGridPresentationModel
+         * @royaleignorecoercion org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumn
+         */
+        protected function createLists():void
+        {
+            var host:IDataGrid = _strand as IDataGrid;
+            
+            // get the name of the class to use for the columns
+            var columnClass:Class = ValuesManager.valuesImpl.getValue(host, "columnClass") as Class;
+            assert(columnClass != null,"ColumnClass for DataGrid must be set!")
+
+            var sharedModel:IDataGridModel = host.model as IDataGridModel;
+            var presentationModel:IDataGridPresentationModel = host.presentationModel as IDataGridPresentationModel;
+
+            _lists = [];
+
+            for (var i:int=0; i < sharedModel.columns.length; i++)
+            {
+                var dataGridColumn:IDataGridColumn = sharedModel.columns[i] as IDataGridColumn;
+
+                var list:IDataGridColumnList = new columnClass();
+                
+                if (i == 0)
+                {
+                    list.className = "first";
+                }
+                else if (i == sharedModel.columns.length-1)
+                {
+                    list.className = "last";
+                }
+                else
+                {
+                    list.className = "middle";
+                }
+                
+                list.id = "dataGridColumn" + i;
+                list.dataProvider = sharedModel.dataProvider;
+                list.itemRenderer = dataGridColumn.itemRenderer;
+                list.labelField = dataGridColumn.dataField;
+                list.addEventListener('change', handleColumnListChange);
+                list.addBead(presentationModel as IBead);
+
+                (_listArea as IParent).addElement(list as IChild);
+                _lists.push(list);
+            }
+
+            host.dispatchEvent(new Event("layoutNeeded"));
+        }
+    }
+}
+
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumn.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumn.as
index ead1b9c..0ef05e3 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumn.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumn.as
@@ -32,7 +32,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10.2
 	 *  @playerversion AIR 2.6
-	 *  @productversion Royale 0.9.4
+	 *  @productversion Royale 0.9.7
 	 */
 	public class DataGridColumn implements IDataGridColumn
 	{
@@ -42,7 +42,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.4
+		 *  @productversion Royale 0.9.7
 		 */
 		public function DataGridColumn()
 		{
@@ -55,7 +55,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.4
+		 *  @productversion Royale 0.9.7
 		 */
 		public function createColumn():IUIBase
 		{
@@ -71,7 +71,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.4
+		 *  @productversion Royale 0.9.7
 		 */
 		public function get itemRenderer():IFactory
 		{
@@ -90,7 +90,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.4
+		 *  @productversion Royale 0.9.7
 		 */
 		public function get columnWidth():Number
 		{
@@ -109,7 +109,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.4
+		 *  @productversion Royale 0.9.7
 		 */
 		public function get label():String
 		{
@@ -129,7 +129,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.4
+		 *  @productversion Royale 0.9.7
 		 */
 		public function get dataField():String
 		{
@@ -149,7 +149,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.4
+		 *  @productversion Royale 0.9.7
 		 */
 		public function get className():String
 		{
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnChangePropagator.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnChangePropagator.as
new file mode 100644
index 0000000..4ef0ac1
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnChangePropagator.as
@@ -0,0 +1,87 @@
+
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.supportClasses.datagrid
+{
+	import org.apache.royale.core.IBeadModel;
+	import org.apache.royale.core.IChangePropagator;
+	import org.apache.royale.core.IDataGridModel;
+	import org.apache.royale.core.ISelectionModel;
+	import org.apache.royale.core.IStrand;
+	import org.apache.royale.events.Event;
+	import org.apache.royale.events.IEventDispatcher;
+	import org.apache.royale.html.beads.IDataGridView;
+
+	/**
+	 *  The DataGridColumnChangePropagator picks up the dataProviderChanged event
+	 *  and lets the data grid columns know about it.
+	 *
+	 *  @viewbead
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9
+	 */
+	public class DataGridColumnChangePropagator implements IChangePropagator
+	{
+		public function DataGridColumnChangePropagator()
+		{
+		}
+		
+		private var _strand:IStrand;
+		/**
+		 * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
+		 */
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			IEventDispatcher(_strand).addEventListener("beadsAdded", finishSetup);
+		}
+		
+		/**
+		 * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
+		 */
+		protected function finishSetup(e:Event):void
+		{
+			var model:IEventDispatcher = _strand.getBeadByType(IBeadModel) as IEventDispatcher;
+			model.addEventListener('dataProviderChanged', handleDataProviderChanged);
+		}
+		
+		/**
+		 * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 * @royaleignorecoercion org.apache.royale.core.ISelectionModel
+		 * @royaleignorecoercion org.apache.royale.html.beads.IDataGridView
+		 * @royaleignorecoercion org.apache.royale.html.supportClasses.DataGridColumnList
+		 */
+		protected function handleDataProviderChanged(e:Event):void
+		{
+			var dataGridView:IDataGridView = _strand.getBeadByType(IDataGridView) as IDataGridView;
+			var lists:Array = dataGridView.columnLists;
+			if (lists == null) return;
+			
+			var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+			for (var i:int=0; i < lists.length; i++)
+			{
+				var list:DataGridColumnList = lists[i] as DataGridColumnList;
+				var listModel:ISelectionModel = list.getBeadByType(IBeadModel) as ISelectionModel;
+				listModel.dataProvider = sharedModel.dataProvider;
+			}
+		}
+	}
+}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as
new file mode 100644
index 0000000..b8a451c
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as
@@ -0,0 +1,77 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.supportClasses.datagrid
+{
+    import org.apache.royale.jewel.List;
+    import org.apache.royale.html.supportClasses.IDataGridColumnList;
+    
+    //--------------------------------------
+    //  Events
+    //--------------------------------------
+    
+    /**
+     *  @copy org.apache.royale.core.ISelectionModel#change
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.9.7
+     */
+    [Event(name="change", type="org.apache.royale.events.Event")]
+    
+    /**
+     *  The DataGridColumnList class is the List class used internally
+     *  by DataGrid for each column.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.9.7
+     */
+	public class DataGridColumnList extends List implements IDataGridColumnList
+	{
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.7
+         */
+		public function DataGridColumnList()
+		{
+			super();
+			//typeNames = "jewel dataGridColumnList";
+		}
+		
+        /**
+         *  The DataGridColumn for this list
+         *  
+         *
+         *  @toplevel
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         * 
+         *  @royalesuppresspublicvarwarning
+         */
+		public var columnInfo: DataGridColumn;
+	}
+}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridListArea.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridListArea.as
new file mode 100644
index 0000000..38bd6d8
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridListArea.as
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 "Licens"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.supportClasses.datagrid
+{
+    import org.apache.royale.jewel.Container;
+
+    public class DataGridListArea extends Container
+    {
+        public function DataGridListArea()
+        {
+            super();
+
+            // COMPILE::JS
+			// {
+			// 	typeNames = 'jewel dataGridListArea';
+			// }
+        }
+    }
+}
\ No newline at end of file


[royale-asjs] 37/42: jewel-datagrid: add rollover behaviour to affect all columns lists in the datagrid to show hovered state

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 4448a7bc9498d3507906303ddc046321b33626b5
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sat Dec 7 20:54:00 2019 +0100

    jewel-datagrid: add rollover behaviour to affect all columns lists in the datagrid to show hovered state
---
 .../org/apache/royale/core/IDataGridModel.as       |  2 +-
 .../royale/org/apache/royale/jewel/DataGrid.as     | 67 ++++++++++++++++++----
 .../royale/jewel/beads/views/DataGridView.as       | 35 ++++++++---
 .../supportClasses/datagrid/DataGridColumnList.as  |  2 +-
 .../supportClasses/datagrid/IDataGridColumnList.as | 36 ++++++++++++
 5 files changed, 122 insertions(+), 20 deletions(-)

diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IDataGridModel.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IDataGridModel.as
index c66d1d6..4ea8eb5 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IDataGridModel.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IDataGridModel.as
@@ -28,7 +28,7 @@ package org.apache.royale.core
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.0
      */
-	public interface IDataGridModel extends ISelectionModel
+	public interface IDataGridModel extends ISelectionModel, IRollOverModel
 	{
         /**
          *  The set of DataGridColumns.
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
index d975d56..43682ea 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
@@ -29,9 +29,9 @@ package org.apache.royale.jewel
 	/**
 	 *  The DataGrid class displays a collection of data using columns and rows. Each
 	 *  column represents a specific field in the data set; each row represents a specific
-	 *  datum. The DataGrid is a composite component built with a org.apache.royale.html.ButtonBar 
-	 *  for the column headers and a org.apache.royale.html.List for each column. The DataGrid's 
-	 *  view bead (usually org.apache.royale.html.beads.DataGridView) constructs these parts while 
+	 *  datum. The DataGrid is a composite component built with a org.apache.royale.jewel.ButtonBar 
+	 *  for the column headers and a org.apache.royale.jewel.List for each column. The DataGrid's 
+	 *  view bead (usually org.apache.royale.jewel.beads.views.DataGridView) constructs these parts while 
 	 *  itemRenderer factories contruct the elements to display the data in each cell.
 	 *  
      *  @toplevel
@@ -58,13 +58,13 @@ package org.apache.royale.jewel
 		}
 		
 		/**
-		 *  The array of org.apache.royale.html.supportClasses.DataGridColumns used to 
+		 *  The array of org.apache.royale.jewel.supportClasses.datagrid.DataGridColumn used to 
 		 *  describe each column.
 		 *
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9
+		 *  @productversion Royale 0.9.7
 		 *  @royaleignorecoercion org.apache.royale.core.IDataGridModel
 		 */
 		public function get columns():Array
@@ -80,12 +80,12 @@ package org.apache.royale.jewel
 		}
 		
 		/**
-		 *  The object used to provide data to the org.apache.royale.html.DataGrid.
+		 *  The object used to provide data to the org.apache.royale.jewel.DataGrid.
 		 *
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9
+		 *  @productversion Royale 0.9.7
 		 *  @royaleignorecoercion org.apache.royale.core.IDataGridModel
 		 */
 		public function get dataProvider():Object
@@ -106,10 +106,10 @@ package org.apache.royale.jewel
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9
+		 *  @productversion Royale 0.9.7
 		 *  @royaleignorecoercion org.apache.royale.core.IDataGridModel
 		 */
-		[Bindable("change")]
+		[Bindable("selectionChanged")]
 		public function get selectedIndex():int
 		{
 			return IDataGridModel(model).selectedIndex;
@@ -121,8 +121,53 @@ package org.apache.royale.jewel
 		{
 			IDataGridModel(model).selectedIndex = value;
 		}
+
+		[Bindable("rollOverIndexChanged")]
+		/**
+		 *  The index of the item currently below the pointer.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 *  @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 */
+        public function get rollOverIndex():int
+		{
+			return IDataGridModel(model).rollOverIndex;
+		}
+		/**
+		 * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 */
+		public function set rollOverIndex(value:int):void
+		{
+			IDataGridModel(model).rollOverIndex = value;
+		}
 		
 		/**
+		 *  The item currently selected. Changing this value also
+		 *  changes the selectedIndex property.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 *  @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 */
+        [Bindable("selectionChanged")]
+		public function get selectedItem():Object
+		{
+			return IDataGridModel(model).selectedItem;
+		}
+		/**
+		 * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 */
+		public function set selectedItem(value:Object):void
+		{
+			IDataGridModel(model).selectedItem = value;
+		}
+
+		/**
 		 * @private
 		 */
 		private var _presentationModel:IDataGridPresentationModel;
@@ -133,7 +178,7 @@ package org.apache.royale.jewel
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9
+		 *  @productversion Royale 0.9.7
 		 *  @royaleignorecoercion org.apache.royale.core.IDataGridPresentationModel
 		 *  @royaleignorecoercion org.apache.royale.core.IBead
 		 */
@@ -163,7 +208,7 @@ package org.apache.royale.jewel
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9
+		 *  @productversion Royale 0.9.7
 		 *  @royaleignorecoercion org.apache.royale.core.IDataGridPresentationModel
 		 */
 		public function get rowHeight():Number
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
index 45b29b7..93cffd8 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
@@ -35,11 +35,11 @@ package org.apache.royale.jewel.beads.views
 	import org.apache.royale.html.beads.GroupView;
 	import org.apache.royale.html.beads.IDataGridView;
 	import org.apache.royale.html.beads.layouts.ButtonBarLayout;
-	import org.apache.royale.html.supportClasses.IDataGridColumnList;
 	import org.apache.royale.jewel.supportClasses.Viewport;
 	import org.apache.royale.jewel.supportClasses.datagrid.DataGridButtonBar;
 	import org.apache.royale.jewel.supportClasses.datagrid.IDataGrid;
 	import org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumn;
+	import org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumnList;
 
     /**
      *  The DataGridView class is the visual bead for the org.apache.royale.jewel.DataGrid.
@@ -105,13 +105,12 @@ package org.apache.royale.jewel.beads.views
         /**
          * @private
          * @royaleignorecoercion org.apache.royale.core.IDataGridModel
-         * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
          * @royaleignorecoercion org.apache.royale.core.IBead
          * @royaleignorecoercion org.apache.royale.core.IBeadModel
          * @royaleignorecoercion org.apache.royale.core.IChild
          * @royaleignorecoercion org.apache.royale.core.ILayoutChild
          * @royaleignorecoercion org.apache.royale.core.IUIBase
-         * @royaleignorecoercion org.apache.royale.html.DataGrid
+         * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
          */
         override protected function handleInitComplete(event:Event):void
         {
@@ -168,6 +167,8 @@ package org.apache.royale.jewel.beads.views
 
         /**
          * @private
+         * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+         * @royaleignorecoercion org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumnList
          */
         protected function handleDataProviderChanged(event:Event):void
         {
@@ -183,7 +184,7 @@ package org.apache.royale.jewel.beads.views
         /**
          * @private
          * @royaleignorecoercion org.apache.royale.core.IDataGridModel
-         * @royaleignorecoercion org.apache.royale.html.supportClasses.IDataGridColumnList
+         * @royaleignorecoercion org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumnList
          */
         private function handleSelectedIndexChanged(event:Event):void
         {
@@ -200,7 +201,7 @@ package org.apache.royale.jewel.beads.views
         /**
          * @private
          * @royaleignorecoercion org.apache.royale.core.IDataGridModel
-         * @royaleignorecoercion org.apache.royale.html.supportClasses.IDataGridColumnList
+         * @royaleignorecoercion org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumnList
          */
         private function handleColumnListChange(event:Event):void
         {
@@ -217,10 +218,29 @@ package org.apache.royale.jewel.beads.views
 
             host.dispatchEvent(new Event('change'));
         }
+        /**
+         * @private
+         * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+         * @royaleignorecoercion org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumnList
+         */
+        private function handleColumnListRollOverChange(event:Event):void
+        {
+            var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+            var list:IDataGridColumnList = event.target as IDataGridColumnList;
+            sharedModel.rollOverIndex = list.rollOverIndex;
+
+            for(var i:int=0; i < _lists.length; i++) {
+                if (list != _lists[i]) {
+                    var otherList:IDataGridColumnList = _lists[i] as IDataGridColumnList;
+                    otherList.rollOverIndex = list.rollOverIndex;
+                }
+            }
+
+            host.dispatchEvent(new Event('rollOverIndex'));
+        }
 
         /**
          * @private
-         * @royaleignorecoercion String
          * @royaleignorecoercion Class
          * @royaleignorecoercion org.apache.royale.core.IDataGridModel
          * @royaleignorecoercion org.apache.royale.core.IBead
@@ -266,7 +286,8 @@ package org.apache.royale.jewel.beads.views
                 list.dataProvider = sharedModel.dataProvider;
                 list.itemRenderer = dataGridColumn.itemRenderer;
                 list.labelField = dataGridColumn.dataField;
-                list.addEventListener('change', handleColumnListChange);
+                list.addEventListener('rollOverIndexChanged', handleColumnListRollOverChange);
+                list.addEventListener('selectionChanged', handleColumnListChange);
                 list.addBead(presentationModel as IBead);
 
                 (_listArea as IParent).addElement(list as IChild);
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as
index 2c04991..7b82a0c 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as
@@ -19,7 +19,7 @@
 package org.apache.royale.jewel.supportClasses.datagrid
 {
     import org.apache.royale.jewel.List;
-    import org.apache.royale.html.supportClasses.IDataGridColumnList;
+    import org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumnList;
     
     //--------------------------------------
     //  Events
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/IDataGridColumnList.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/IDataGridColumnList.as
new file mode 100644
index 0000000..2de9e35
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/IDataGridColumnList.as
@@ -0,0 +1,36 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 "Licens"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.supportClasses.datagrid
+{
+    import org.apache.royale.html.supportClasses.IDataGridColumnList;
+
+    /**
+     *  The Jewel IDataGridColumnList interface is a marker interface for Jewel DataGrid Column Lists
+     * 
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.9.7
+     */
+    public interface IDataGridColumnList extends org.apache.royale.html.supportClasses.IDataGridColumnList
+    {
+        function get rollOverIndex():int;
+        function set rollOverIndex(value:int):void;
+    }
+}
\ No newline at end of file


[royale-asjs] 31/42: jewel-datagrid: cleaning code

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 2e967c2525f8c933553c2c98a92d486a16729f40
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Dec 6 18:59:05 2019 +0100

    jewel-datagrid: cleaning code
---
 .../royale/itemRenderers/ProductItemRenderer.as    | 62 ----------------------
 .../royale/jewel/beads/layouts/DataGridLayout.as   | 33 ------------
 2 files changed, 95 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ProductItemRenderer.as b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ProductItemRenderer.as
deleted file mode 100644
index 60deb8a..0000000
--- a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ProductItemRenderer.as
+++ /dev/null
@@ -1,62 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package itemRenderers
-{
-	import org.apache.royale.html.supportClasses.DataItemRenderer;
-	import org.apache.royale.jewel.Image;
-	
-	public class ProductItemRenderer extends DataItemRenderer
-	{
-		public function ProductItemRenderer()
-		{
-			super();
-		}
-
-		private var image:Image = new Image();
-
-		override public function addedToParent():void
-		{
-			super.addedToParent();
-			addElement(image);
-		}
-
-		override public function get data():Object
-		{
-			return super.data;
-		}
-		override public function set data(value:Object):void
-		{
-			super.data = value;
-
-			image.src = value.image;
-		}
-
-		override public function adjustSize():void
-		{
-			var cy:Number = this.height/2;
-
-			image.x = 4;
-			image.y = cy - 16;
-			image.width = 32;
-			image.height = 32;
-
-			updateRenderer();
-		}
-	}
-}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
index a91c6f9..8dff87f 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
@@ -120,9 +120,7 @@ package org.apache.royale.jewel.beads.layouts
 			
 			var borderMetrics:EdgeData = (ValuesManager.valuesImpl as IBorderPaddingMarginValuesImpl).getBorderMetrics(_strand as IUIBase);			
 			var useWidth:Number = uiHost.width - (borderMetrics.left + borderMetrics.right);
-			var useHeight:Number = uiHost.height - (borderMetrics.top + borderMetrics.bottom);
 			
-			// var xpos:Number = 0;
 			var defaultColumnWidth:Number = (useWidth) / bbmodel.dataProvider.length;
 			var columnWidths:Array = [];
 			
@@ -130,10 +128,6 @@ package org.apache.royale.jewel.beads.layouts
 				var columnDef:IDataGridColumn = (bbmodel.dataProvider as ArrayList).getItemAt(i) as IDataGridColumn;
 				var columnList:UIBase = displayedColumns[i] as UIBase;
 				
-				// probably do not need to set (x,y), but if the Container's layout requires it, they will be set.
-				// columnList.x = xpos;
-				// columnList.y = 0;
-				
 				var columnWidth:Number = defaultColumnWidth;
 				if (!isNaN(columnDef.columnWidth)) {
 					columnWidth = columnDef.columnWidth;
@@ -141,37 +135,10 @@ package org.apache.royale.jewel.beads.layouts
 				
 				columnList.width = columnWidth;
 				columnWidths.push(columnWidth);
-				
-				// xpos += columnList.width;
 			}
 			
 			bbmodel.buttonWidths = columnWidths;
 			
-			// COMPILE::SWF {
-            //     header.y = borderMetrics.top;
-            //     header.x = borderMetrics.left;
-			// 	header.width = useWidth;
-			// }
-			// COMPILE::JS {
-			// 	(header as UIBase).percentWidth = 100;
-			// 	listArea.element.style.position = "absolute";
-            //     if (!(uiHost.element.style.position == 'absolute' ||
-            //           uiHost.element.style.position == 'relative' ||
-            //           uiHost.element.style.position == 'fixed'))
-            //         uiHost.element.style.position = 'relative';
-			// }
-			// header's height is set in CSS
-			
-            // listArea.y = header.height + header.y;
-			// COMPILE::SWF {
-            //     listArea.x = borderMetrics.left;
-			// 	listArea.width = useWidth;
-			// }
-			// COMPILE::JS {
-			// 	(listArea as UIBase).percentWidth = 100;
-			// }
-			// listArea.height = useHeight - header.height;
-			
 			header.dispatchEvent(new Event("layoutNeeded"));
 			listArea.dispatchEvent(new Event("layoutNeeded"));
 			


[royale-asjs] 20/42: jewel-buttonbar: add ButtonBarLayout and make ButtonBar support Collections instead of simple arrays

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 280649bbff8173487b0c8c15c63001d979d4194c
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Dec 2 14:33:56 2019 +0100

    jewel-buttonbar: add ButtonBarLayout and make ButtonBar support Collections instead of simple arrays
---
 .../src/main/royale/ButtonBarPlayGround.mxml       |  45 +++---
 .../projects/Jewel/src/main/resources/defaults.css |   4 +-
 .../projects/Jewel/src/main/royale/JewelClasses.as |   5 +-
 .../main/royale/org/apache/royale/jewel/Button.as  | 162 ++++++++++-----------
 .../royale/org/apache/royale/jewel/ButtonBar.as    |  11 +-
 .../royale/jewel/beads/layouts/ButtonBarLayout.as  | 148 +++++++++++++++++++
 .../jewel/itemRenderers/ButtonBarItemRenderer.as   |   6 +-
 .../Jewel/src/main/sass/components/_buttonbar.sass |   5 +-
 8 files changed, 263 insertions(+), 123 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
index d546be6..6175926 100644
--- a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
@@ -23,16 +23,6 @@ limitations under the License.
 	xmlns:js="library://ns.apache.org/royale/basic"
 	xmlns:models="models.*" 
 	xmlns:c="components.*" sourceCodeUrl="ButtonBarPlayGround.mxml">
-	
-	<fx:Script>
-		<![CDATA[
-			[Bindable]
-			public var two_options:Array = ["Features", "Support"];
-			
-			[Bindable]
-			public var three_options:Array = ["Features", "Support", "Service & Operations", "four"];
-		]]>
-	</fx:Script>
 
 	<c:beads>
 		<js:ContainerDataBinding/>
@@ -43,16 +33,19 @@ limitations under the License.
 			<j:Card>
 				<html:H3 text="Jewel ButtonBar"/>
 
-				<j:ButtonBar localId="bb1" change="bb1_label.text = bb1.selectedItem as String"
-					dataProvider="{two_options}">
-					<!-- <j:dataProvider>
-						<fx:Array>
-							<fx:String>Features</fx:String>
-							<fx:String>Support</fx:String>
-						</fx:Array>
-					</j:dataProvider> -->
+				<j:ButtonBar localId="bb1" change="bb_label.text = bb1.selectedItem as String">
+					<j:dataProvider>
+						<js:ArrayList source="[Features, Support]" />
+					</j:dataProvider>
+				</j:ButtonBar>
+
+				<j:ButtonBar localId="bb" change="bb_label.text = bb.selectedItem as String"
+					emphasis="primary">
+					<j:dataProvider>
+						<js:ArrayList source="[Iron Man, Hulk, Thor, Captain America, Black Widow]" />
+					</j:dataProvider>
 				</j:ButtonBar>
-				<j:Label localId="bb1_label"/>
+				<j:Label localId="bb_label"/>
 			</j:Card>
 		</j:GridCell>
 		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
@@ -60,16 +53,12 @@ limitations under the License.
 				<html:H4 text="ButtonBar"/>
 
 				<j:ButtonBar localId="bb2" change="bb2_label.text = bb2.selectedItem as String"
-					emphasis="{ButtonBar.SECONDARY}"
-					dataProvider="{three_options}">
-					<!-- <js:dataProvider>
-						<fx:Array>
-							<fx:String>Features</fx:String>
-							<fx:String>Support</fx:String>
-							<fx:String>Control</fx:String>
-						</fx:Array>
-					</js:dataProvider> -->
+					emphasis="secondary">
+					<j:dataProvider>
+						<js:ArrayList source="[Features, Support, Service and Operations, four]" />
+					</j:dataProvider>
 				</j:ButtonBar>
+
 				<j:Label localId="bb2_label"/>
 			</j:Card>
 		</j:GridCell>
diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index e95ab07..0b31caa 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -276,8 +276,8 @@ j|ButtonBar {
   IBeadModel: ClassReference("org.apache.royale.html.beads.models.ButtonBarModel");
   IBeadView: ClassReference("org.apache.royale.jewel.beads.views.ButtonBarView");
   IBeadController: ClassReference("org.apache.royale.jewel.beads.controllers.ListSingleSelectionMouseController");
-  IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout");
-  IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.TextItemRendererFactoryForArrayData");
+  IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.ButtonBarLayout");
+  IDataProviderItemRendererMapper: ClassReference("org.apache.royale.jewel.beads.itemRenderers.DataItemRendererFactoryForCollectionView");
   IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory");
   IItemRenderer: ClassReference("org.apache.royale.jewel.itemRenderers.ButtonBarItemRenderer");
 }
diff --git a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
index 97d0a07..4d48f3b 100644
--- a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
+++ b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
@@ -118,6 +118,7 @@ package
         import org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList; DataGridColumnList;
         import org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator; DataGridColumnChangePropagator;
         import org.apache.royale.jewel.beads.layouts.DataGridLayout; DataGridLayout;
+        import org.apache.royale.jewel.beads.layouts.ButtonBarLayout; ButtonBarLayout;
 
         import org.apache.royale.jewel.supportClasses.util.positionInsideBoundingClientRect; positionInsideBoundingClientRect;
 
@@ -129,8 +130,8 @@ package
 
         COMPILE::JS
         {
-            import dialogPolyfill; dialogPolyfill;
-            import org.apache.royale.utils.transparentPixelElement; transparentPixelElement;
+        import dialogPolyfill; dialogPolyfill;
+        import org.apache.royale.utils.transparentPixelElement; transparentPixelElement;
         }
     }
 }
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Button.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Button.as
index bca7d02..4a8fb27 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Button.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Button.as
@@ -44,98 +44,98 @@ package org.apache.royale.jewel
      */
     public class Button extends SimpleButton
     {
-        public static const PRIMARY:String = "primary";
-        public static const SECONDARY:String = "secondary";
-        public static const EMPHASIZED:String = "emphasized";
-        
-        /**
-         *  Constructor.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.9.4
-         */
-		public function Button()
-		{
-			super();
-		}
-
-        [Bindable("textChange")]
-        /**
-         *  The text to appear on the control.
-         * 
-         *  @copy org.apache.royale.jewel.Label#text
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.9.4
-         */
-		public function get text():String
-		{
-            COMPILE::SWF
-            {
-            return ITextModel(model).text;
-            }
-            COMPILE::JS
+            public static const PRIMARY:String = "primary";
+            public static const SECONDARY:String = "secondary";
+            public static const EMPHASIZED:String = "emphasized";
+                  
+            /**
+             *  Constructor.
+             *  
+             *  @langversion 3.0
+             *  @playerversion Flash 10.2
+             *  @playerversion AIR 2.6
+             *  @productversion Royale 0.9.4
+             */
+            public function Button()
             {
-            return (element as HTMLButtonElement).innerHTML;
+                  super();
             }
-		}
-        /**
-         *  @private
-         */
-		public function set text(value:String):void
-		{
-            COMPILE::SWF
+
+            [Bindable("textChange")]
+            /**
+             *  The text to appear on the control.
+             * 
+             *  @copy org.apache.royale.jewel.Label#text
+             *
+             *  @langversion 3.0
+             *  @playerversion Flash 10.2
+             *  @playerversion AIR 2.6
+             *  @productversion Royale 0.9.4
+             */
+            public function get text():String
             {
-            ITextModel(model).text = value;
+                  COMPILE::SWF
+                  {
+                  return ITextModel(model).text;
+                  }
+                  COMPILE::JS
+                  {
+                  return (element as HTMLButtonElement).innerHTML;
+                  }
             }
-            COMPILE::JS
+            /**
+             *  @private
+             */
+            public function set text(value:String):void
             {
-            (element as HTMLButtonElement).innerHTML = value;
-            dispatchEvent(new Event('textChange'));
+                  COMPILE::SWF
+                  {
+                  ITextModel(model).text = value;
+                  }
+                  COMPILE::JS
+                  {
+                  (element as HTMLButtonElement).innerHTML = value;
+                  dispatchEvent(new Event('textChange'));
+                  }
             }
-		}
 
 
-        [Bindable("htmlChange")]
-        /**
-         *  The html text to appear on the control.
-		 *  
-         *  @copy org.apache.royale.jewel.Label#html
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.9.4
-         */
-		public function get html():String
-		{
-            COMPILE::SWF
-            {
-            return ITextModel(model).html;
-            }
-            COMPILE::JS
-            {
-            return (element as HTMLButtonElement).innerHTML;
-            }
-		}
-        /**
-         *  @private
-         */
-		public function set html(value:String):void
-		{
-            COMPILE::SWF
+            [Bindable("htmlChange")]
+            /**
+             *  The html text to appear on the control.
+             *  
+             *  @copy org.apache.royale.jewel.Label#html
+             *
+             *  @langversion 3.0
+             *  @playerversion Flash 10.2
+             *  @playerversion AIR 2.6
+             *  @productversion Royale 0.9.4
+             */
+            public function get html():String
             {
-            ITextModel(model).html = value;
+                  COMPILE::SWF
+                  {
+                  return ITextModel(model).html;
+                  }
+                  COMPILE::JS
+                  {
+                  return (element as HTMLButtonElement).innerHTML;
+                  }
             }
-            COMPILE::JS
+            /**
+             *  @private
+             */
+            public function set html(value:String):void
             {
-            (element as HTMLButtonElement).innerHTML = value;
-            dispatchEvent(new Event('htmlChange'));
+                  COMPILE::SWF
+                  {
+                  ITextModel(model).html = value;
+                  }
+                  COMPILE::JS
+                  {
+                  (element as HTMLButtonElement).innerHTML = value;
+                  dispatchEvent(new Event('htmlChange'));
+                  }
             }
-		}
 	}
 }
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as
index 9de3f06..26c6eef 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as
@@ -18,13 +18,12 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel
 {
-	import org.apache.royale.html.beads.models.ButtonBarModel;
-	
     COMPILE::JS
     {
     import org.apache.royale.core.WrappedHTMLElement;
     import org.apache.royale.html.util.addElementToWrapper;
     }
+	import org.apache.royale.html.beads.models.ButtonBarModel;
 
 	/**
 	 *  The ButtonBar class is a component that displays a set of Buttons. The ButtonBar
@@ -71,7 +70,7 @@ package org.apache.royale.jewel
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9
+		 *  @productversion Royale 0.9.7
 		 *  @royaleignorecoercion org.apache.royale.html.beads.models.ButtonBarModel
 		 */
 		public function get buttonWidths():Array
@@ -92,7 +91,7 @@ package org.apache.royale.jewel
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9
+		 *  @productversion Royale 0.9.7
 		 *  @royaleignorecoercion org.apache.royale.html.beads.models.ButtonBarModel
 		 */
 		public function get widthType():Number
@@ -107,7 +106,7 @@ package org.apache.royale.jewel
 			ButtonBarModel(model).widthType = value;
 		}
 
-		private var _emphasis:String = "primary";
+		private var _emphasis:String;
         /**
 		 *  Applies emphasis color display. Possible constant values are: PRIMARY, SECONDARY, EMPHASIZED.
          *  Colors are defined in royale jewel theme CSS.
@@ -117,7 +116,7 @@ package org.apache.royale.jewel
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.6
+		 *  @productversion Royale 0.9.7
 		 */
         public function get emphasis():String
         {
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as
new file mode 100644
index 0000000..9ddd3c8
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as
@@ -0,0 +1,148 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.beads.layouts
+{
+	import org.apache.royale.core.ILayoutChild;
+	import org.apache.royale.core.ILayoutView;
+	import org.apache.royale.core.IStrand;
+	import org.apache.royale.core.IStyleableObject;
+	import org.apache.royale.html.beads.models.ButtonBarModel;
+
+	/**
+	 *  The ButtonBarLayout class bead sizes and positions the button
+	 *  elements that make up a org.apache.royale.jewel.ButtonBar. This bead arranges the Buttons
+	 *  horizontally and makes them all the same width unless the buttonWidths property has been set in which case
+	 *  the values stored in that array are used.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9.7
+	 */
+	public class ButtonBarLayout extends HorizontalLayout
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function ButtonBarLayout()
+		{
+			super();
+		}
+
+		private var _widthType:Number = ButtonBarModel.PIXEL_WIDTHS;
+		private var _buttonWidths:Array = null;
+
+		/**
+		 *  An array of widths (Number), one per button. These values supersede the
+		 *  default of equally-sized buttons.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function get buttonWidths():Array
+		{
+			return _buttonWidths;
+		}
+		public function set buttonWidths(value:Array):void
+		{
+			_buttonWidths = value;
+		}
+
+		/**
+		 * @copy org.apache.royale.core.IBeadLayout#layout
+		 * @royaleignorecoercion org.apache.royale.core.ILayoutChild
+		 * @royaleignorecoercion org.apache.royale.core.IStrand
+		 * @royaleignorecoercion org.apache.royale.html.beads.models.ButtonBarModel
+		 */
+		override public function layout():Boolean
+		{
+			var contentView:ILayoutView = layoutView;
+
+			var model:ButtonBarModel = (host as IStrand).getBeadByType(ButtonBarModel) as ButtonBarModel;
+			if (model) {
+				buttonWidths = model.buttonWidths;
+				_widthType = model.widthType;
+			}
+
+			var n:int = contentView.numElements;
+			if (n <= 0) return false;
+
+			for (var i:int=0; i < n; i++)
+			{	
+				var ilc:ILayoutChild = contentView.getElementAt(i) as ILayoutChild;
+				if (ilc == null || !ilc.visible) continue;
+				if (!(ilc is IStyleableObject)) continue;
+				
+				COMPILE::SWF {
+					if (buttonWidths) {
+						var widthValue:* = buttonWidths[i];
+
+						if (_widthType == ButtonBarModel.PIXEL_WIDTHS) {
+							if (widthValue != null) ilc.width = Number(widthValue);
+							IStyleableObject(ilc).style.flexGrow = 0;
+						}
+						else if (_widthType == ButtonBarModel.PROPORTIONAL_WIDTHS) {
+							if (widthValue != null) {
+								IStyleableObject(ilc).style.flexGrow = Number(widthValue);
+							}
+						}
+						else if (_widthType == ButtonBarModel.PERCENT_WIDTHS) {
+							if (widthValue != null) ilc.percentWidth = Number(widthValue);
+							IStyleableObject(ilc).style.flexGrow = 0;
+						}
+					} else if (!_widthType == ButtonBarModel.NATURAL_WIDTHS) {
+						IStyleableObject(ilc).style.flexGrow = 1;
+					}
+				}
+
+				COMPILE::JS {
+					// otherwise let the flexbox layout handle matters on its own.
+					if (buttonWidths) {
+						var widthValue:* = buttonWidths[i];
+
+						if (_widthType == ButtonBarModel.PIXEL_WIDTHS) {
+							if (widthValue != null) ilc.width = Number(widthValue);
+						}
+						else if (_widthType == ButtonBarModel.PROPORTIONAL_WIDTHS) {
+							if (widthValue != null) ilc.element.style["flex-grow"] = String(widthValue);
+						}
+						else if (_widthType == ButtonBarModel.PERCENT_WIDTHS) {
+							if (widthValue != null) ilc.percentWidth = Number(widthValue);
+						}
+					} else if (!_widthType == ButtonBarModel.NATURAL_WIDTHS) {
+						ilc.element.style["flex-grow"] = "1";
+					}
+
+                    if (!host.isHeightSizedToContent())
+    					ilc.height = contentView.height;
+				}
+			}
+
+			// now let the horizontal layout take care of things.
+			return super.layout();
+		}
+	}
+}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
index aa210be..438b7a4 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
@@ -31,7 +31,6 @@ package org.apache.royale.jewel.itemRenderers
 	import org.apache.royale.jewel.Button;
 	import org.apache.royale.jewel.ButtonBar;
 	import org.apache.royale.jewel.beads.views.ButtonBarView;
-	import org.apache.royale.core.IItemRendererParent;
 
 	/**
 	 * The ButtonBarItemRenderer class extends Button and turns it into an itemRenderer
@@ -129,7 +128,10 @@ package org.apache.royale.jewel.itemRenderers
 			_itemRendererParent = value;
 
 			var buttonBar:ButtonBar = (itemRendererParent as ButtonBarView).buttonBar;
-			emphasis = buttonBar.emphasis;
+			if(buttonBar.emphasis != null)
+			{
+				emphasis = buttonBar.emphasis;
+			}
 		}
 
 		private var _labelField:String = null;
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
index db7237a..7a2bdf7 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
@@ -38,8 +38,9 @@ j|ButtonBar
     IBeadModel: ClassReference("org.apache.royale.html.beads.models.ButtonBarModel")
     IBeadView:  ClassReference("org.apache.royale.jewel.beads.views.ButtonBarView")			
     IBeadController: ClassReference("org.apache.royale.jewel.beads.controllers.ListSingleSelectionMouseController")
-    IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout")
-    IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.TextItemRendererFactoryForArrayData")
+    IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.ButtonBarLayout")
+    // IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.TextItemRendererFactoryForArrayData")
+    IDataProviderItemRendererMapper: ClassReference("org.apache.royale.jewel.beads.itemRenderers.DataItemRendererFactoryForCollectionView")
     IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory")
     IItemRenderer: ClassReference("org.apache.royale.jewel.itemRenderers.ButtonBarItemRenderer")
     // border-style: none


[royale-asjs] 34/42: jewel-itemrenderer: avoid renders to depend on ":hover" css state so we can manage hover programatically

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 900b6cacf7447c5bd59d2e1c15903ed10cfc7565
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sat Dec 7 20:42:48 2019 +0100

    jewel-itemrenderer: avoid renders to depend on ":hover" css state so we can manage hover programatically
---
 frameworks/themes/JewelTheme/src/main/resources/defaults.css      | 8 ++++----
 .../src/main/sass/components-primary/_itemRenderer.sass           | 2 +-
 .../JewelTheme/src/main/sass/components-primary/_navigation.sass  | 2 +-
 .../JewelTheme/src/main/sass/components-primary/_tabbar.sass      | 2 +-
 .../JewelTheme/src/main/sass/components-primary/_table.sass       | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/frameworks/themes/JewelTheme/src/main/resources/defaults.css b/frameworks/themes/JewelTheme/src/main/resources/defaults.css
index b0ed671..dac3156 100644
--- a/frameworks/themes/JewelTheme/src/main/resources/defaults.css
+++ b/frameworks/themes/JewelTheme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #3CADF1;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #3CADF1;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(60, 173, 241, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #3CADF1;
 }
diff --git a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_itemRenderer.sass b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_itemRenderer.sass
index 4b6ac72..7ee919d 100644
--- a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_itemRenderer.sass
+++ b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_itemRenderer.sass
@@ -24,7 +24,7 @@ $itemrenderer-padding: 16px
 .jewel.item
     padding: 8px
 
-    &.hovered:hover
+    &.hovered
         color: $font-theme-color
         background: $primary-color
 
diff --git a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_navigation.sass b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_navigation.sass
index 48e4187..c4206e4 100644
--- a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_navigation.sass
+++ b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_navigation.sass
@@ -41,7 +41,7 @@
 
     color: rgba(black, 0.6)
     
-    &.hovered:hover
+    &.hovered
         //color: $font-theme-color
         background: lighten($default-color, 10%) !important
 
diff --git a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_tabbar.sass b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_tabbar.sass
index 68cbe04..68f7780 100644
--- a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_tabbar.sass
+++ b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_tabbar.sass
@@ -65,7 +65,7 @@
                 // animation-duration: .3s
                 // animation-timing-function: ease-in-out
                 // animation-fill-mode: both
-        &.hovered:hover
+        &.hovered
             // color: $font-theme-color
             background: rgba($primary-color, .2)
             
diff --git a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_table.sass b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_table.sass
index b17204b..0c8d1e3 100644
--- a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_table.sass
+++ b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_table.sass
@@ -122,7 +122,7 @@ $table-border-radius: $border-radius
 
 .jewel.tableitem
 
-    &.hovered:hover
+    &.hovered
         color: $font-theme-color
         background: $primary-color
 


[royale-asjs] 33/42: jewel-datagrid: remove change propagator since is not needed anymore

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit a7315196900047458daab5366867a340ed3a1781
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sat Dec 7 12:19:22 2019 +0100

    jewel-datagrid: remove change propagator since is not needed anymore
---
 .../projects/Jewel/src/main/resources/defaults.css |  1 -
 .../projects/Jewel/src/main/royale/JewelClasses.as |  1 -
 .../royale/org/apache/royale/jewel/DataGrid.as     |  9 ---
 .../datagrid/DataGridColumnChangePropagator.as     | 87 ----------------------
 .../Jewel/src/main/sass/components/_datagrid.sass  |  1 -
 5 files changed, 99 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 9dd08f1..9cd6e14 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -512,7 +512,6 @@ j|ComboBoxPopUp {
 }
 
 j|DataGrid {
-  IChangePropagator: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator");
   IDataGridPresentationModel: ClassReference("org.apache.royale.jewel.beads.models.DataGridPresentationModel");
   IBeadView: ClassReference("org.apache.royale.jewel.beads.views.DataGridView");
   IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel");
diff --git a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
index aa2f480..cb3102a 100644
--- a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
+++ b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
@@ -116,7 +116,6 @@ package
         
         import org.apache.royale.jewel.beads.views.DataGridView; DataGridView;
         import org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList; DataGridColumnList;
-        import org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator; DataGridColumnChangePropagator;
         import org.apache.royale.jewel.beads.layouts.DataGridLayout; DataGridLayout;
 
         import org.apache.royale.jewel.supportClasses.util.positionInsideBoundingClientRect; positionInsideBoundingClientRect;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
index 6df6f83..d975d56 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/DataGrid.as
@@ -19,12 +19,9 @@
 package org.apache.royale.jewel
 {
 	import org.apache.royale.core.IBead;
-	import org.apache.royale.core.IChangePropagator;
 	import org.apache.royale.core.IDataGridModel;
 	import org.apache.royale.core.IDataGridPresentationModel;
 	import org.apache.royale.core.ValuesManager;
-	import org.apache.royale.events.Event;
-	import org.apache.royale.utils.loadBeadFromValuesManager;
 	import org.apache.royale.jewel.supportClasses.datagrid.IDataGrid;
 	
 	[Event(name="change", type="org.apache.royale.events.Event")]
@@ -180,12 +177,6 @@ package org.apache.royale.jewel
 		{
 			(presentationModel as IDataGridPresentationModel).rowHeight = value;
 		}
-		
-		override public function addedToParent():void
-		{
-			loadBeadFromValuesManager(IChangePropagator, "iChangePropagator", this);
-			super.addedToParent();
-		}
 
 		private var _emphasis:String;
         /**
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnChangePropagator.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnChangePropagator.as
deleted file mode 100644
index 8ed6bcc..0000000
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnChangePropagator.as
+++ /dev/null
@@ -1,87 +0,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.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.royale.jewel.supportClasses.datagrid
-{
-	import org.apache.royale.core.IBeadModel;
-	import org.apache.royale.core.IChangePropagator;
-	import org.apache.royale.core.IDataGridModel;
-	import org.apache.royale.core.ISelectionModel;
-	import org.apache.royale.core.IStrand;
-	import org.apache.royale.events.Event;
-	import org.apache.royale.events.IEventDispatcher;
-	import org.apache.royale.html.beads.IDataGridView;
-
-	/**
-	 *  The DataGridColumnChangePropagator picks up the dataProviderChanged event
-	 *  and lets the data grid columns know about it.
-	 *
-	 *  @viewbead
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10.2
-	 *  @playerversion AIR 2.6
-	 *  @productversion Royale 0.9.7
-	 */
-	public class DataGridColumnChangePropagator implements IChangePropagator
-	{
-		public function DataGridColumnChangePropagator()
-		{
-		}
-		
-		private var _strand:IStrand;
-		/**
-		 * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
-		 */
-		public function set strand(value:IStrand):void
-		{
-			_strand = value;
-			IEventDispatcher(_strand).addEventListener("beadsAdded", finishSetup);
-		}
-		
-		/**
-		 * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
-		 */
-		protected function finishSetup(e:Event):void
-		{
-			var model:IEventDispatcher = _strand.getBeadByType(IBeadModel) as IEventDispatcher;
-			model.addEventListener('dataProviderChanged', handleDataProviderChanged);
-		}
-		
-		/**
-		 * @royaleignorecoercion org.apache.royale.core.IDataGridModel
-		 * @royaleignorecoercion org.apache.royale.core.ISelectionModel
-		 * @royaleignorecoercion org.apache.royale.html.beads.IDataGridView
-		 * @royaleignorecoercion org.apache.royale.html.supportClasses.DataGridColumnList
-		 */
-		protected function handleDataProviderChanged(e:Event):void
-		{
-			var dataGridView:IDataGridView = _strand.getBeadByType(IDataGridView) as IDataGridView;
-			var lists:Array = dataGridView.columnLists;
-			if (lists == null) return;
-			
-			var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
-			for (var i:int=0; i < lists.length; i++)
-			{
-				var list:DataGridColumnList = lists[i] as DataGridColumnList;
-				var listModel:ISelectionModel = list.getBeadByType(IBeadModel) as ISelectionModel;
-				listModel.dataProvider = sharedModel.dataProvider;
-			}
-		}
-	}
-}
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
index 1a5bd0d..6af0bc2 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
@@ -50,7 +50,6 @@ $border-radius: .25rem
 
 
 j|DataGrid
-    IChangePropagator: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator")
     IDataGridPresentationModel: ClassReference("org.apache.royale.jewel.beads.models.DataGridPresentationModel")
     IBeadView: ClassReference("org.apache.royale.jewel.beads.views.DataGridView")
     IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel")


[royale-asjs] 24/42: jewel-buttonbar: more examples

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit cde27427b83ad5d471f026dee3cc4205c51c47fd
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Tue Dec 3 07:49:00 2019 +0100

    jewel-buttonbar: more examples
---
 .../src/main/royale/ButtonBarPlayGround.mxml       | 44 +++++++++++++++++++---
 1 file changed, 39 insertions(+), 5 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
index 420f27b..b838ac3 100644
--- a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
@@ -37,27 +37,61 @@ limitations under the License.
 			<j:Card>
 				<html:H3 text="Jewel ButtonBar"/>
 
-				<j:ButtonBar localId="bb1" change="bb_label.text = bb1.selectedItem as String">
+				<j:Label text="All buttons has same widths"/>
+				
+				<html:H4 text="No Width"/>
+
+				<j:ButtonBar localId="bb" change="bb_label.text = bb.selectedItem as String">
 					<j:dataProvider>
 						<js:ArrayList source="[Features, Support]" />
 					</j:dataProvider>
 				</j:ButtonBar>
+				
+				<html:H4 text="Width: 100% and primary color"/>
 
-				<j:ButtonBar localId="bb" change="bb_label.text = bb.selectedItem.label"
+				<j:ButtonBar localId="bb1" change="bb_label.text = bb1.selectedItem.label"
 					emphasis="primary" width="100%"
 					dataProvider="{listModel.suravengers}"/>
+				
+				<html:H4 text="Width: 70% and emphasized color"/>
+
+				<j:ButtonBar localId="bb2" change="bb_label.text = bb2.selectedItem as String"
+					emphasis="emphasized" width="70%">
+					<j:dataProvider>
+						<js:ArrayList source="[First, Second, Third]" />
+					</j:dataProvider>
+				</j:ButtonBar>
 
 				<j:Label localId="bb_label"/>
 			</j:Card>
 		</j:GridCell>
 		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
 			<j:Card>
-				<html:H4 text="ButtonBar"/>
+				<html:H4 text="Jewel ButtonBar"/>
+
+				<j:Label text="Different button widths"/>
+				
+				<html:H4 text="No Width"/>
+
+				<j:ButtonBar localId="bb3" change="bb2_label.text = bb3.selectedItem as String"
+					emphasis="primary">
+					<j:beads>
+						<j:HorizontalLayout/>
+					</j:beads>
+					<j:dataProvider>
+						<js:ArrayList source="[Home, Support, Operations, Service]" />
+					</j:dataProvider>
+				</j:ButtonBar>
+
+				<html:H4 text="Width 100%, With gap"/>
 
-				<j:ButtonBar localId="bb2" change="bb2_label.text = bb2.selectedItem as String"
+				<j:ButtonBar localId="bb4" change="bb2_label.text = bb4.selectedItem as String"
 					emphasis="secondary" width="100%">
+					<j:beads>
+						<j:HorizontalLayout gap="3"/>
+					</j:beads>
 					<j:dataProvider>
-						<js:ArrayList source="[Features, Support, Operations, Service]" />
+						<js:ArrayList source="[Home, Support, Operations, Service]" />
 					</j:dataProvider>
 				</j:ButtonBar>
 


[royale-asjs] 09/42: jewel-datagrid: Add DataGridButoonBar

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 12cbb2b47a134fa3465fcb9b4eb3a16e1d2a55a1
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Nov 27 18:20:19 2019 +0100

    jewel-datagrid: Add DataGridButoonBar
---
 .../projects/Jewel/src/main/resources/defaults.css |  2 +-
 .../Jewel/src/main/resources/jewel-manifest.xml    |  1 +
 .../royale/jewel/beads/views/DataGridView.as       |  2 +-
 .../supportClasses/datagrid/DataGridButtonBar.as   | 53 ++++++++++++++++++++++
 .../Jewel/src/main/sass/components/_datagrid.sass  |  2 +-
 5 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 192f5ea..dcc84bc 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -494,7 +494,7 @@ j|DataGrid {
   IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel");
   IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.DataGridLayout");
   columnClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList");
-  columnContainerClass: ClassReference("org.apache.royale.html.DataGridButtonBar");
+  columnContainerClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridButtonBar");
   columnLayoutClass: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout");
   listAreaClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridListArea");
 }
diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index aecc645..7d7dfc1 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -46,6 +46,7 @@
     <component id="DataGrid" class="org.apache.royale.jewel.DataGrid"/>
     <component id="DataGridColumn" class="org.apache.royale.jewel.supportClasses.datagrid.DataGridColumn"/>
     <component id="DataGridListArea" class="org.apache.royale.jewel.supportClasses.datagrid.DataGridListArea"/>
+    <component id="DataGridButtonBar" class="org.apache.royale.jewel.supportClasses.datagrid.DataGridButtonBar"/>
     <component id="ButtonBarItemRenderer" class="org.apache.royale.jewel.itemRenderers.ButtonBarItemRenderer"/>
 
     <component id="SimpleButton" class="org.apache.royale.jewel.supportClasses.button.SimpleButton"/>
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
index a62aac7..1916204 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
@@ -32,12 +32,12 @@ package org.apache.royale.jewel.beads.views
 	import org.apache.royale.debugging.assert;
 	import org.apache.royale.events.Event;
 	import org.apache.royale.events.IEventDispatcher;
-	import org.apache.royale.html.DataGridButtonBar;
 	import org.apache.royale.html.beads.GroupView;
 	import org.apache.royale.html.beads.IDataGridView;
 	import org.apache.royale.html.beads.layouts.ButtonBarLayout;
 	import org.apache.royale.html.supportClasses.IDataGridColumnList;
 	import org.apache.royale.jewel.supportClasses.Viewport;
+	import org.apache.royale.jewel.supportClasses.datagrid.DataGridButtonBar;
 	import org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumn;
 
     /**
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridButtonBar.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridButtonBar.as
new file mode 100644
index 0000000..2e6f854
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridButtonBar.as
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.supportClasses.datagrid
+{
+    import org.apache.royale.jewel.ButtonBar;
+
+    COMPILE::JS
+    {
+    import org.apache.royale.core.WrappedHTMLElement;            
+    }
+
+	/**
+	 *  The DataGridButtonBar class extends ButtonBar and provides a class for styling
+	 *  the header region of the DataGrid.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9.7
+	 */
+	public class DataGridButtonBar extends ButtonBar
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function DataGridButtonBar()
+		{
+			super();
+			typeNames = "jewel dataGridButtonBar";
+		}
+	}
+}
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
index 86d3185..7523558 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
@@ -39,7 +39,7 @@ j|DataGrid
     IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel")
     IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.DataGridLayout")
     columnClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList")
-    columnContainerClass: ClassReference("org.apache.royale.html.DataGridButtonBar")
+    columnContainerClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridButtonBar")
     columnLayoutClass: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout")
     listAreaClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridListArea")
 


[royale-asjs] 38/42: jewel-themes: update for hover state changes

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 2a08eaf07969b29efe765398f8f3e13cf8a339f0
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun Dec 8 11:04:25 2019 +0100

    jewel-themes: update for hover state changes
---
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 .../src/main/resources/defaults.css                               | 8 ++++----
 24 files changed, 96 insertions(+), 96 deletions(-)

diff --git a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Amethyst-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Amethyst-Theme/src/main/resources/defaults.css
index 2372bb3..3fce1af 100644
--- a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Amethyst-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Amethyst-Theme/src/main/resources/defaults.css
@@ -576,7 +576,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #C92CC6;
 }
@@ -622,7 +622,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #737373 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -884,7 +884,7 @@ j|FormItem {
   height: 2px;
   background-color: #C92CC6;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(201, 44, 198, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -960,7 +960,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 #a6a6a6;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #C92CC6;
 }
diff --git a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Blue-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Blue-Theme/src/main/resources/defaults.css
index ec9c6c7..69ff26d 100644
--- a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Blue-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Blue-Theme/src/main/resources/defaults.css
@@ -576,7 +576,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #3CADF1;
 }
@@ -622,7 +622,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #737373 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -884,7 +884,7 @@ j|FormItem {
   height: 2px;
   background-color: #3CADF1;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(60, 173, 241, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -960,7 +960,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 #a6a6a6;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #3CADF1;
 }
diff --git a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Emerald-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Emerald-Theme/src/main/resources/defaults.css
index 24bce58..4383ce4 100644
--- a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Emerald-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Emerald-Theme/src/main/resources/defaults.css
@@ -576,7 +576,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #8CC63C;
 }
@@ -622,7 +622,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #737373 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -884,7 +884,7 @@ j|FormItem {
   height: 2px;
   background-color: #8CC63C;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(140, 198, 60, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -960,7 +960,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 #a6a6a6;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #8CC63C;
 }
diff --git a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Green-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Green-Theme/src/main/resources/defaults.css
index c3683c6..d383d12 100644
--- a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Green-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Green-Theme/src/main/resources/defaults.css
@@ -576,7 +576,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #3AB549;
 }
@@ -622,7 +622,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #737373 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -884,7 +884,7 @@ j|FormItem {
   height: 2px;
   background-color: #3AB549;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(58, 181, 73, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -960,7 +960,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 #a6a6a6;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #3AB549;
 }
diff --git a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Orange-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Orange-Theme/src/main/resources/defaults.css
index cfa7586..a97276e 100644
--- a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Orange-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Orange-Theme/src/main/resources/defaults.css
@@ -576,7 +576,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #F7941D;
 }
@@ -622,7 +622,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #737373 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -884,7 +884,7 @@ j|FormItem {
   height: 2px;
   background-color: #F7941D;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(247, 148, 29, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -960,7 +960,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 #a6a6a6;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #F7941D;
 }
diff --git a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Red-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Red-Theme/src/main/resources/defaults.css
index 91979d6..1936889 100644
--- a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Red-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Red-Theme/src/main/resources/defaults.css
@@ -576,7 +576,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #EC1C24;
 }
@@ -622,7 +622,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #737373 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -884,7 +884,7 @@ j|FormItem {
   height: 2px;
   background-color: #EC1C24;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(236, 28, 36, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -960,7 +960,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 #a6a6a6;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #EC1C24;
 }
diff --git a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Sapphire-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Sapphire-Theme/src/main/resources/defaults.css
index b67f75c..4ce5ee9 100644
--- a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Sapphire-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Sapphire-Theme/src/main/resources/defaults.css
@@ -576,7 +576,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #2C74BE;
 }
@@ -622,7 +622,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #737373 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -884,7 +884,7 @@ j|FormItem {
   height: 2px;
   background-color: #2C74BE;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(44, 116, 190, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -960,7 +960,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 #a6a6a6;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #2C74BE;
 }
diff --git a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Sunflower-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Sunflower-Theme/src/main/resources/defaults.css
index 5b5f494..c0c4600 100644
--- a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Sunflower-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Sunflower-Theme/src/main/resources/defaults.css
@@ -576,7 +576,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #F8B13F;
 }
@@ -622,7 +622,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #737373 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -884,7 +884,7 @@ j|FormItem {
   height: 2px;
   background-color: #F8B13F;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(248, 177, 63, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -960,7 +960,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 #a6a6a6;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #F8B13F;
 }
diff --git a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Topaz-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Topaz-Theme/src/main/resources/defaults.css
index 20556ec..9705dcb 100644
--- a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Topaz-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Topaz-Theme/src/main/resources/defaults.css
@@ -576,7 +576,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #EF5A2A;
 }
@@ -622,7 +622,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #737373 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -884,7 +884,7 @@ j|FormItem {
   height: 2px;
   background-color: #EF5A2A;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(239, 90, 42, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -960,7 +960,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 #a6a6a6;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #EF5A2A;
 }
diff --git a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Turquoise-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Turquoise-Theme/src/main/resources/defaults.css
index ad01ea2..44fb947 100644
--- a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Turquoise-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Turquoise-Theme/src/main/resources/defaults.css
@@ -576,7 +576,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #29A89F;
 }
@@ -622,7 +622,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #737373 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -884,7 +884,7 @@ j|FormItem {
   height: 2px;
   background-color: #29A89F;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(41, 168, 159, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -960,7 +960,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 #a6a6a6;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #29A89F;
 }
diff --git a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Violet-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Violet-Theme/src/main/resources/defaults.css
index fb3415a..60b9a50 100644
--- a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Violet-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Violet-Theme/src/main/resources/defaults.css
@@ -576,7 +576,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #662C90;
 }
@@ -622,7 +622,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #737373 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -884,7 +884,7 @@ j|FormItem {
   height: 2px;
   background-color: #662C90;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(102, 44, 144, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -960,7 +960,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 #a6a6a6;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #662C90;
 }
diff --git a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Yellow-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Yellow-Theme/src/main/resources/defaults.css
index 6d5e1e3..cadd1eb 100644
--- a/frameworks/themes/Jewel-Dark-NoFlat-Primary-Yellow-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Dark-NoFlat-Primary-Yellow-Theme/src/main/resources/defaults.css
@@ -576,7 +576,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #E2D70B;
 }
@@ -622,7 +622,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #737373 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -884,7 +884,7 @@ j|FormItem {
   height: 2px;
   background-color: #E2D70B;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(226, 215, 11, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -960,7 +960,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 #a6a6a6;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #E2D70B;
 }
diff --git a/frameworks/themes/Jewel-Light-NoFlat-Primary-Amethyst-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Light-NoFlat-Primary-Amethyst-Theme/src/main/resources/defaults.css
index 218cf4b..d094a1b 100644
--- a/frameworks/themes/Jewel-Light-NoFlat-Primary-Amethyst-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Light-NoFlat-Primary-Amethyst-Theme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #C92CC6;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #C92CC6;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(201, 44, 198, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #C92CC6;
 }
diff --git a/frameworks/themes/Jewel-Light-NoFlat-Primary-Blue-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Light-NoFlat-Primary-Blue-Theme/src/main/resources/defaults.css
index f014bf4..5182a84 100644
--- a/frameworks/themes/Jewel-Light-NoFlat-Primary-Blue-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Light-NoFlat-Primary-Blue-Theme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #3CADF1;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #3CADF1;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(60, 173, 241, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #3CADF1;
 }
diff --git a/frameworks/themes/Jewel-Light-NoFlat-Primary-Emerald-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Light-NoFlat-Primary-Emerald-Theme/src/main/resources/defaults.css
index 23ab0fd..0b6b695 100644
--- a/frameworks/themes/Jewel-Light-NoFlat-Primary-Emerald-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Light-NoFlat-Primary-Emerald-Theme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #8CC63C;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #8CC63C;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(140, 198, 60, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #8CC63C;
 }
diff --git a/frameworks/themes/Jewel-Light-NoFlat-Primary-Green-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Light-NoFlat-Primary-Green-Theme/src/main/resources/defaults.css
index 3df75ab..f621e10 100644
--- a/frameworks/themes/Jewel-Light-NoFlat-Primary-Green-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Light-NoFlat-Primary-Green-Theme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #3AB549;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #3AB549;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(58, 181, 73, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #3AB549;
 }
diff --git a/frameworks/themes/Jewel-Light-NoFlat-Primary-Orange-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Light-NoFlat-Primary-Orange-Theme/src/main/resources/defaults.css
index 7723ca5..99185e6 100644
--- a/frameworks/themes/Jewel-Light-NoFlat-Primary-Orange-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Light-NoFlat-Primary-Orange-Theme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #F7941D;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #F7941D;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(247, 148, 29, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #F7941D;
 }
diff --git a/frameworks/themes/Jewel-Light-NoFlat-Primary-Red-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Light-NoFlat-Primary-Red-Theme/src/main/resources/defaults.css
index 85b2914..cd233a5 100644
--- a/frameworks/themes/Jewel-Light-NoFlat-Primary-Red-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Light-NoFlat-Primary-Red-Theme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #EC1C24;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #EC1C24;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(236, 28, 36, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #EC1C24;
 }
diff --git a/frameworks/themes/Jewel-Light-NoFlat-Primary-Sapphire-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Light-NoFlat-Primary-Sapphire-Theme/src/main/resources/defaults.css
index ea75c7a..2e8388a 100644
--- a/frameworks/themes/Jewel-Light-NoFlat-Primary-Sapphire-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Light-NoFlat-Primary-Sapphire-Theme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #2C74BE;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #2C74BE;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(44, 116, 190, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #2C74BE;
 }
diff --git a/frameworks/themes/Jewel-Light-NoFlat-Primary-Sunflower-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Light-NoFlat-Primary-Sunflower-Theme/src/main/resources/defaults.css
index ca71dc2..2cc834d 100644
--- a/frameworks/themes/Jewel-Light-NoFlat-Primary-Sunflower-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Light-NoFlat-Primary-Sunflower-Theme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #F8B13F;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #F8B13F;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(248, 177, 63, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #F8B13F;
 }
diff --git a/frameworks/themes/Jewel-Light-NoFlat-Primary-Topaz-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Light-NoFlat-Primary-Topaz-Theme/src/main/resources/defaults.css
index 0314db3..ee61bf0 100644
--- a/frameworks/themes/Jewel-Light-NoFlat-Primary-Topaz-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Light-NoFlat-Primary-Topaz-Theme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #EF5A2A;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #EF5A2A;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(239, 90, 42, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #EF5A2A;
 }
diff --git a/frameworks/themes/Jewel-Light-NoFlat-Primary-Turquoise-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Light-NoFlat-Primary-Turquoise-Theme/src/main/resources/defaults.css
index c53083b..553eb20 100644
--- a/frameworks/themes/Jewel-Light-NoFlat-Primary-Turquoise-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Light-NoFlat-Primary-Turquoise-Theme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #29A89F;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #29A89F;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(41, 168, 159, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #29A89F;
 }
diff --git a/frameworks/themes/Jewel-Light-NoFlat-Primary-Violet-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Light-NoFlat-Primary-Violet-Theme/src/main/resources/defaults.css
index 1e2cc33..f5fcdff 100644
--- a/frameworks/themes/Jewel-Light-NoFlat-Primary-Violet-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Light-NoFlat-Primary-Violet-Theme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #662C90;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #662C90;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(102, 44, 144, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #662C90;
 }
diff --git a/frameworks/themes/Jewel-Light-NoFlat-Primary-Yellow-Theme/src/main/resources/defaults.css b/frameworks/themes/Jewel-Light-NoFlat-Primary-Yellow-Theme/src/main/resources/defaults.css
index 7a8ef1f..e158296 100644
--- a/frameworks/themes/Jewel-Light-NoFlat-Primary-Yellow-Theme/src/main/resources/defaults.css
+++ b/frameworks/themes/Jewel-Light-NoFlat-Primary-Yellow-Theme/src/main/resources/defaults.css
@@ -575,7 +575,7 @@ j|FormItem {
 .jewel.item {
   padding: 8px;
 }
-.jewel.item.hovered:hover {
+.jewel.item.hovered {
   color: #FFFFFF;
   background: #E2D70B;
 }
@@ -621,7 +621,7 @@ j|FormItem {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.6);
 }
-.jewel.navigationlink.hovered:hover {
+.jewel.navigationlink.hovered {
   background: #f3f3f3 !important;
 }
 .jewel.navigationlink .hint.fonticon {
@@ -883,7 +883,7 @@ j|FormItem {
   height: 2px;
   background-color: #E2D70B;
 }
-.jewel.tabbarbutton.hovered:hover {
+.jewel.tabbarbutton.hovered {
   background: rgba(226, 215, 11, 0.2);
 }
 .jewel.tabbarbutton.selected, .jewel.tabbarbutton.selectable:active {
@@ -959,7 +959,7 @@ j|FormItem {
   box-shadow: inset 0 1px 0 white;
 }
 
-.jewel.tableitem.hovered:hover {
+.jewel.tableitem.hovered {
   color: #FFFFFF;
   background: #E2D70B;
 }


[royale-asjs] 22/42: jewel-layout: some cleanup

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 9281de5e3ff0fa7126c350fa5a283d1cbbc37a6f
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Dec 2 19:35:20 2019 +0100

    jewel-layout: some cleanup
---
 .../main/royale/org/apache/royale/jewel/ApplicationResponsiveView.as | 2 +-
 .../projects/Jewel/src/main/royale/org/apache/royale/jewel/Card.as   | 1 -
 .../Jewel/src/main/royale/org/apache/royale/jewel/GridCell.as        | 5 ++++-
 .../royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as | 4 ++--
 .../org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as  | 2 +-
 5 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ApplicationResponsiveView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ApplicationResponsiveView.as
index c15ea88..1cd93d3 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ApplicationResponsiveView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ApplicationResponsiveView.as
@@ -55,7 +55,7 @@ package org.apache.royale.jewel
 		{
 			super();
 
-            typeNames = "applicationResponsiveView"; //+ VerticalLayout.LAYOUT_TYPE_NAMES;
+            typeNames = "applicationResponsiveView";
 		}
         
 		private var _applicationModel:Object;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Card.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Card.as
index 223e3e6..a24216e 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Card.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Card.as
@@ -19,7 +19,6 @@
 package org.apache.royale.jewel
 {
 	import org.apache.royale.jewel.Group;
-	import org.apache.royale.core.IBeadLayout;
 
 	/**
 	 *  The Card class is a container that surronds other components.
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/GridCell.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/GridCell.as
index db70556..b71b0d8 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/GridCell.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/GridCell.as
@@ -18,8 +18,11 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel
 {
-	import org.apache.royale.jewel.beads.layouts.GridCellLayout;
+	COMPILE::JS
+	{
 	import org.apache.royale.utils.StringUtil;
+	}
+	import org.apache.royale.jewel.beads.layouts.GridCellLayout;
 
 	/**
 	 *  The GridCell class is the inmediate container in a Grid Layout
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as
index 4354555..2bd8144 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as
@@ -19,8 +19,8 @@
 package org.apache.royale.jewel.beads.layouts
 {
 	COMPILE::JS {
-        import org.apache.royale.core.UIBase;
-        import org.apache.royale.core.WrappedHTMLElement;
+	import org.apache.royale.core.UIBase;
+	import org.apache.royale.core.WrappedHTMLElement;
     }
 	import org.apache.royale.core.IBorderPaddingMarginValuesImpl;
 	import org.apache.royale.core.ILayoutChild;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
index 3ec3ce5..e56807b 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
@@ -20,7 +20,7 @@ package org.apache.royale.jewel.beads.layouts
 {
 	COMPILE::JS 
 	{
-		import org.apache.royale.core.UIBase;
+	import org.apache.royale.core.UIBase;
 	}
 	import org.apache.royale.core.IBorderPaddingMarginValuesImpl;
 	import org.apache.royale.core.ILayoutChild;


[royale-asjs] 14/42: jewel-buttonbar: add emphasis to colorize buttons in the bar

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 2bb4e4641a0b7c8204d1c3a9919453c4c622724c
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Thu Nov 28 20:03:46 2019 +0100

    jewel-buttonbar: add emphasis to colorize buttons in the bar
---
 .../src/main/royale/ButtonBarPlayGround.mxml       |  1 +
 .../royale/org/apache/royale/jewel/ButtonBar.as    | 35 ++++++++++++++++++++++
 .../royale/jewel/beads/views/ButtonBarView.as      | 10 ++++---
 .../jewel/itemRenderers/ButtonBarItemRenderer.as   | 22 +++++++++-----
 .../Jewel/src/main/sass/components/_buttonbar.sass |  1 +
 5 files changed, 58 insertions(+), 11 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
index 2a6047a..5349a5a 100644
--- a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
@@ -60,6 +60,7 @@ limitations under the License.
 				<html:H4 text="ButtonBar"/>
 
 				<j:ButtonBar localId="bb2" change="bb2_label.text = bb2.selectedItem as String"
+					emphasis="{ButtonBar.SECONDARY}"
 					dataProvider="{three_options}">
 					<!-- <js:dataProvider>
 						<fx:Array>
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as
index 20bdbb7..9de3f06 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as
@@ -46,6 +46,10 @@ package org.apache.royale.jewel
 	 */
 	public class ButtonBar extends List
 	{
+		public static const PRIMARY:String = "primary";
+        public static const SECONDARY:String = "secondary";
+        public static const EMPHASIZED:String = "emphasized";
+		
 		/**
 		 *  constructor.
 		 *
@@ -103,6 +107,37 @@ package org.apache.royale.jewel
 			ButtonBarModel(model).widthType = value;
 		}
 
+		private var _emphasis:String = "primary";
+        /**
+		 *  Applies emphasis color display. Possible constant values are: PRIMARY, SECONDARY, EMPHASIZED.
+         *  Colors are defined in royale jewel theme CSS.
+         * 
+         *  Left without value to get the default look (light or dark).
+         *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.6
+		 */
+        public function get emphasis():String
+        {
+            return _emphasis;
+        }
+        [Inspectable(category="General", enumeration="primary,secondary,emphasized")]
+        public function set emphasis(value:String):void
+        {
+            if (_emphasis != value)
+            {
+                if(_emphasis)
+                {
+					toggleClass(_emphasis, false);
+                }
+                _emphasis = value;
+
+                toggleClass(_emphasis, value);
+            }
+        }
+
         /**
          * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
          */
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ButtonBarView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ButtonBarView.as
index 1414f76..77bef33 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ButtonBarView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ButtonBarView.as
@@ -19,10 +19,11 @@
 package org.apache.royale.jewel.beads.views
 {
 	import org.apache.royale.core.IStrand;
+	import org.apache.royale.jewel.ButtonBar;
 
 	/**
-	 *  The ButtonBarView class creates the visual elements of the org.apache.royale.html.ButtonBar 
-	 *  component. A ButtonBar is a type of List and ButtonBarView extends the ListView bead, adding a border.
+	 *  The ButtonBarView class creates the visual elements of the org.apache.royale.jewel.ButtonBar 
+	 *  component. A ButtonBar is a type of List and ButtonBarView extends the ListView bead.
 	 *  
 	 *  @langversion 3.0
 	 *  @playerversion Flash 10.2
@@ -43,7 +44,8 @@ package org.apache.royale.jewel.beads.views
 		{
 			super();
 		}
-				
+		
+		public var buttonBar:ButtonBar;
 		/**
 		 *  @copy org.apache.royale.core.IBead#strand
 		 *  
@@ -54,8 +56,8 @@ package org.apache.royale.jewel.beads.views
 		 */
 		override public function set strand(value:IStrand):void
 		{
-			_strand = value;
 			super.strand = value;
+			buttonBar = value as ButtonBar;
 		}		
 	}
 }
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
index 4407527..5d4ebcb 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
@@ -18,17 +18,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel.itemRenderers
 {
+	COMPILE::JS
+	{
+	import org.apache.royale.core.WrappedHTMLElement;
+	}
+
 	import org.apache.royale.core.SimpleCSSStylesWithFlex;
 	import org.apache.royale.events.ItemClickedEvent;
 	import org.apache.royale.events.MouseEvent;
 	import org.apache.royale.html.beads.ITextItemRenderer;
 	import org.apache.royale.html.util.getLabelFromData;
 	import org.apache.royale.jewel.Button;
-
-	COMPILE::JS
-	{
-	import org.apache.royale.core.WrappedHTMLElement;
-	}
+	import org.apache.royale.jewel.ButtonBar;
+	import org.apache.royale.jewel.beads.views.ButtonBarView;
 
 	/**
 	 * The ButtonBarItemRenderer class extends Button and turns it into an itemRenderer
@@ -47,7 +49,8 @@ package org.apache.royale.jewel.itemRenderers
 
 			style = new SimpleCSSStylesWithFlex();
 
-			addEventListener('click',handleClickEvent);
+			addEventListener('click', handleClickEvent);
+
 		}
 
 		private var _data:Object;
@@ -71,6 +74,9 @@ package org.apache.royale.jewel.itemRenderers
 			_data = value;
 
 			updateButtonLabelFromData();
+
+			var buttonBar:ButtonBar = (itemRendererParent as ButtonBarView).buttonBar;
+			emphasis = buttonBar.emphasis;
 		}
 
 		/**
@@ -86,7 +92,9 @@ package org.apache.royale.jewel.itemRenderers
 				valueAsString = "" + data["title"];
 			}
 
-			if (valueAsString) text = valueAsString;
+			if (valueAsString) {
+				text = valueAsString;
+			}
 		}
 
 		/**
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
index 9d67b50..7497aaa 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
@@ -21,6 +21,7 @@
 
 // ButtonVar variables
 jewel.buttonbar
+    
 
 j|ButtonBar
     IBeadModel: ClassReference("org.apache.royale.html.beads.models.ButtonBarModel")


[royale-asjs] 27/42: jewel-datagrid: get initial layout working

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 6b1c95de33a2c9f7bcb395b163825accfbbf3f0c
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Dec 6 11:47:49 2019 +0100

    jewel-datagrid: get initial layout working
---
 .../src/main/royale/DataGridPlayGround.mxml        |   6 +-
 .../royale/jewel/beads/layouts/DataGridLayout.as   | 111 +++++++++++----------
 .../supportClasses/datagrid/DataGridColumnList.as  |   2 +-
 3 files changed, 60 insertions(+), 59 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
index 9d11a51..b9b3b7a 100644
--- a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
@@ -65,9 +65,9 @@ limitations under the License.
 							destinationPropertyName="dataProvider" />
 					</j:beads>
 					<j:columns>
-						<j:DataGridColumn label="Images and Pictures" dataField="image" columnWidth="15" itemRenderer="itemRenderers.ProductItemRenderer"/>
-						<j:DataGridColumn label="Title" dataField="title" columnWidth="60" />
-						<j:DataGridColumn label="Sales" dataField="sales" columnWidth="25" />
+						<j:DataGridColumn label="Images and Pictures" dataField="image" columnWidth="45" itemRenderer="itemRenderers.ProductItemRenderer"/>
+						<j:DataGridColumn label="Title" dataField="title" columnWidth="120" />
+						<j:DataGridColumn label="Sales" dataField="sales" columnWidth="50" />
 					</j:columns>
 				</j:DataGrid>
 
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
index 669ee9b..a91c6f9 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
@@ -18,6 +18,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel.beads.layouts
 {	
+    import org.apache.royale.collections.ArrayList;
     import org.apache.royale.core.IBeadLayout;
     import org.apache.royale.core.IBorderPaddingMarginValuesImpl;
     import org.apache.royale.core.IDataGridModel;
@@ -103,76 +104,76 @@ package org.apache.royale.jewel.beads.layouts
 		 * @royaleignorecoercion org.apache.royale.core.UIBase
 		 * @royaleignorecoercion org.apache.royale.html.beads.IDataGridView
 		 * @royaleignorecoercion org.apache.royale.html.beads.models.ButtonBarModel
-		 * @royaleignorecoercion org.apache.royale.html.supportClasses.IDataGridColumn
+		 * @royaleignorecoercion org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumn
 		 */
 		public function layout():Boolean
 		{
-		// 	var header:IUIBase = (uiHost.view as IDataGridView).header;
-        //     // fancier DG's will filter invisible columns and only put visible columns
-        //     // in the bbmodel, so do all layout based on the bbmodel, not the set
-        //     // of columns that may contain invisible columns
-        //     var bbmodel:ButtonBarModel = header.getBeadByType(ButtonBarModel) as ButtonBarModel;
-		// 	var listArea:IUIBase = (uiHost.view as IDataGridView).listArea;
+			var header:IUIBase = (uiHost.view as IDataGridView).header;
+            // fancier DG's will filter invisible columns and only put visible columns
+            // in the bbmodel, so do all layout based on the bbmodel, not the set
+            // of columns that may contain invisible columns
+            var bbmodel:ButtonBarModel = header.getBeadByType(ButtonBarModel) as ButtonBarModel;
+			var listArea:IUIBase = (uiHost.view as IDataGridView).listArea;
 			
-		// 	var displayedColumns:Array = (uiHost.view as IDataGridView).columnLists;
-		// 	var model:IDataGridModel = uiHost.model as IDataGridModel;
+			var displayedColumns:Array = (uiHost.view as IDataGridView).columnLists;
+			var model:IDataGridModel = uiHost.model as IDataGridModel;
 			
-		// 	var borderMetrics:EdgeData = (ValuesManager.valuesImpl as IBorderPaddingMarginValuesImpl).getBorderMetrics(_strand as IUIBase);			
-		// 	var useWidth:Number = uiHost.width - (borderMetrics.left + borderMetrics.right);
-		// 	var useHeight:Number = uiHost.height - (borderMetrics.top + borderMetrics.bottom);
+			var borderMetrics:EdgeData = (ValuesManager.valuesImpl as IBorderPaddingMarginValuesImpl).getBorderMetrics(_strand as IUIBase);			
+			var useWidth:Number = uiHost.width - (borderMetrics.left + borderMetrics.right);
+			var useHeight:Number = uiHost.height - (borderMetrics.top + borderMetrics.bottom);
 			
-		// 	var xpos:Number = 0;
-		// 	var defaultColumnWidth:Number = (useWidth) / bbmodel.dataProvider.length;
-		// 	var columnWidths:Array = [];
+			// var xpos:Number = 0;
+			var defaultColumnWidth:Number = (useWidth) / bbmodel.dataProvider.length;
+			var columnWidths:Array = [];
 			
-		// 	for(var i:int=0; i < bbmodel.dataProvider.length; i++) {
-		// 		var columnDef:IDataGridColumn = bbmodel.dataProvider[i] as IDataGridColumn;
-		// 		var columnList:UIBase = displayedColumns[i] as UIBase;
+			for(var i:int=0; i < bbmodel.dataProvider.length; i++) {
+				var columnDef:IDataGridColumn = (bbmodel.dataProvider as ArrayList).getItemAt(i) as IDataGridColumn;
+				var columnList:UIBase = displayedColumns[i] as UIBase;
 				
-		// 		// probably do not need to set (x,y), but if the Container's layout requires it, they will be set.
-		// 		columnList.x = xpos;
-		// 		columnList.y = 0;
+				// probably do not need to set (x,y), but if the Container's layout requires it, they will be set.
+				// columnList.x = xpos;
+				// columnList.y = 0;
 				
-		// 		var columnWidth:Number = defaultColumnWidth;
-		// 		if (!isNaN(columnDef.columnWidth)) {
-		// 			columnWidth = columnDef.columnWidth;
-		// 		}
+				var columnWidth:Number = defaultColumnWidth;
+				if (!isNaN(columnDef.columnWidth)) {
+					columnWidth = columnDef.columnWidth;
+				}
 				
-		// 		columnList.width = columnWidth;
-		// 		columnWidths.push(columnWidth);
+				columnList.width = columnWidth;
+				columnWidths.push(columnWidth);
 				
-		// 		xpos += columnList.width;
-		// 	}
+				// xpos += columnList.width;
+			}
 			
-		// 	bbmodel.buttonWidths = columnWidths;
+			bbmodel.buttonWidths = columnWidths;
 			
-		// 	COMPILE::SWF {
-        //         header.y = borderMetrics.top;
-        //         header.x = borderMetrics.left;
-		// 		header.width = useWidth;
-		// 	}
-		// 	COMPILE::JS {
-		// 		(header as UIBase).percentWidth = 100;
-		// 		listArea.element.style.position = "absolute";
-        //         if (!(uiHost.element.style.position == 'absolute' ||
-        //               uiHost.element.style.position == 'relative' ||
-        //               uiHost.element.style.position == 'fixed'))
-        //             uiHost.element.style.position = 'relative';
-		// 	}
-		// 	// header's height is set in CSS
+			// COMPILE::SWF {
+            //     header.y = borderMetrics.top;
+            //     header.x = borderMetrics.left;
+			// 	header.width = useWidth;
+			// }
+			// COMPILE::JS {
+			// 	(header as UIBase).percentWidth = 100;
+			// 	listArea.element.style.position = "absolute";
+            //     if (!(uiHost.element.style.position == 'absolute' ||
+            //           uiHost.element.style.position == 'relative' ||
+            //           uiHost.element.style.position == 'fixed'))
+            //         uiHost.element.style.position = 'relative';
+			// }
+			// header's height is set in CSS
 			
-        //     listArea.y = header.height + header.y;
-		// 	COMPILE::SWF {
-        //         listArea.x = borderMetrics.left;
-		// 		listArea.width = useWidth;
-		// 	}
-		// 	COMPILE::JS {
-		// 		(listArea as UIBase).percentWidth = 100;
-		// 	}
-		// 	listArea.height = useHeight - header.height;
+            // listArea.y = header.height + header.y;
+			// COMPILE::SWF {
+            //     listArea.x = borderMetrics.left;
+			// 	listArea.width = useWidth;
+			// }
+			// COMPILE::JS {
+			// 	(listArea as UIBase).percentWidth = 100;
+			// }
+			// listArea.height = useHeight - header.height;
 			
-		// 	header.dispatchEvent(new Event("layoutNeeded"));
-		// 	listArea.dispatchEvent(new Event("layoutNeeded"));
+			header.dispatchEvent(new Event("layoutNeeded"));
+			listArea.dispatchEvent(new Event("layoutNeeded"));
 			
 			return true;
 		}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as
index 310c406..2c04991 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as
@@ -68,7 +68,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
-         *  @productversion Royale 0.9
+         *  @productversion Royale 0.9.7
          * 
          *  @royalesuppresspublicvarwarning
          */


[royale-asjs] 36/42: jewel-mousecontroller: add "rollOverIndexChanged" listener to manage hover state from other places like in DataGrid columns

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit e07765a353d0b115ab545e0e221273cf6a0653aa
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sat Dec 7 20:45:46 2019 +0100

    jewel-mousecontroller: add "rollOverIndexChanged" listener to manage hover state from other places like in DataGrid columns
---
 .../royale/jewel/beads/controllers/ListSingleSelectionMouseController.as | 1 +
 1 file changed, 1 insertion(+)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ListSingleSelectionMouseController.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ListSingleSelectionMouseController.as
index 08c426d..c18927a 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ListSingleSelectionMouseController.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ListSingleSelectionMouseController.as
@@ -118,6 +118,7 @@ package org.apache.royale.jewel.beads.controllers
                  IJewelSelectionModel(listModel).dispatcher = IEventDispatcher(value);
 			}
             else {
+				IEventDispatcher(listModel).addEventListener('rollOverIndexChanged', modelChangeHandler);
 				IEventDispatcher(listModel).addEventListener('selectionChanged', modelChangeHandler);
                 IEventDispatcher(listModel).addEventListener('dataProviderChanged', modelChangeHandler);
             }


[royale-asjs] 15/42: jewel-datagrid: fix header typenames

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit abe9672c7d1b26f617a23f84ad100af5ffef1383
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Thu Nov 28 20:07:00 2019 +0100

    jewel-datagrid: fix header typenames
---
 .../apache/royale/jewel/supportClasses/datagrid/DataGridButtonBar.as    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridButtonBar.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridButtonBar.as
index 2e6f854..414d11d 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridButtonBar.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridButtonBar.as
@@ -47,7 +47,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
 		public function DataGridButtonBar()
 		{
 			super();
-			typeNames = "jewel dataGridButtonBar";
+			typeNames = "jewel buttonbar header";
 		}
 	}
 }


[royale-asjs] 30/42: jewel-datagrid: remove top columns borders and add a soft light inner shadow as it comes from the header buttons

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 14dc77bd3d06d8756bc8b9e1ac9dda63b31bdfd1
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Dec 6 18:58:43 2019 +0100

    jewel-datagrid: remove top columns borders and add a soft light inner shadow as it comes from the header buttons
---
 frameworks/projects/Jewel/src/main/resources/defaults.css         | 2 ++
 frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 2c37850..9dd08f1 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -496,6 +496,8 @@ j|ComboBoxPopUp {
 }
 .jewel.datagrid .jewel.list.column {
   border-radius: 0px;
+  border-top-width: 0px;
+  box-shadow: inset 0px 1px 1px 0px rgba(0, 0, 0, 0.25);
 }
 .jewel.datagrid .jewel.list.column.first {
   border-right: 0px;
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
index bcc7d16..1a5bd0d 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
@@ -35,6 +35,9 @@ $border-radius: .25rem
 
     .jewel.list.column
         border-radius: 0px
+        border-top-width: 0px
+        box-shadow: inset 0px 1px 1px 0px rgba(0,0,0,0.25)
+
         &.first
             border-right: 0px
             border-bottom-left-radius: $border-radius


[royale-asjs] 17/42: jewel-buttonbar: fix first and last rounded styles

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit b5cfb6c4d5358cf88dbe622563151e34cbd6d017
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sat Nov 30 11:19:41 2019 +0100

    jewel-buttonbar: fix first and last rounded styles
---
 frameworks/projects/Jewel/src/main/resources/defaults.css     |  8 ++++++++
 .../royale/jewel/itemRenderers/ButtonBarItemRenderer.as       |  2 +-
 .../projects/Jewel/src/main/sass/components/_buttonbar.sass   | 11 ++++++++++-
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index fc8aede..512d3a4 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -263,6 +263,14 @@ j|Alert {
 .jewel.buttonbar .jewel.button {
   border-radius: 0;
 }
+.jewel.buttonbar .jewel.button.first {
+  border-top-left-radius: 0.25rem;
+  border-bottom-left-radius: 0.25rem;
+}
+.jewel.buttonbar .jewel.button.last {
+  border-top-right-radius: 0.25rem;
+  border-bottom-right-radius: 0.25rem;
+}
 
 j|ButtonBar {
   IBeadModel: ClassReference("org.apache.royale.html.beads.models.ButtonBarModel");
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
index 7d5decd..d852528 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
@@ -197,7 +197,7 @@ package org.apache.royale.jewel.itemRenderers
 			{
 				addClass("first");
 			} 
-			else if( _index == ( itemRendererParent as IItemRendererParent).numItemRenderers - 1 )
+			else if( _index == (itemRendererParent as ButtonBarView).buttonBar.dataProvider.length - 1 )
 			{
 				addClass("last");
 			}
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
index c5dd0d5..db7237a 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
@@ -18,12 +18,21 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 // Jewel ButtonBar
+$border-radius: .25rem
 
 // ButtonVar variables
 .jewel.buttonbar
     .jewel.button
         border-radius: 0
-    
+
+        &.first
+            border-top-left-radius: $border-radius
+            border-bottom-left-radius: $border-radius
+
+        &.last
+            border-top-right-radius: $border-radius
+            border-bottom-right-radius: $border-radius
+
 
 j|ButtonBar
     IBeadModel: ClassReference("org.apache.royale.html.beads.models.ButtonBarModel")


[royale-asjs] 06/42: jewel-datagrid: a bit of style in list columns

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 04902f4b2c0ccb1a64a7468a39dcaf3bdd3c28b0
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Tue Nov 26 20:25:01 2019 +0100

    jewel-datagrid: a bit of style in list columns
---
 frameworks/projects/Jewel/src/main/resources/defaults.css      | 10 ++++++++++
 .../royale/org/apache/royale/jewel/beads/views/DataGridView.as |  2 +-
 .../royale/jewel/supportClasses/datagrid/DataGridColumnList.as |  2 +-
 .../projects/Jewel/src/main/sass/components/_datagrid.sass     |  7 +++++++
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 8014d04..4fbf413 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -462,6 +462,16 @@ j|ComboBoxPopUp {
   height: 290px;
 }
 
+.jewel.list.column {
+  border-radius: 0px;
+}
+.jewel.list.column.first {
+  border-right: 0px;
+}
+.jewel.list.column.last {
+  border-left: 0px;
+}
+
 j|DataGrid {
   IChangePropagator: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator");
   IDataGridPresentationModel: ClassReference("org.apache.royale.jewel.beads.models.DataGridPresentationModel");
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
index 5f4677a..815e803 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
@@ -36,9 +36,9 @@ package org.apache.royale.jewel.beads.views
 	import org.apache.royale.html.beads.GroupView;
 	import org.apache.royale.html.beads.IDataGridView;
 	import org.apache.royale.html.beads.layouts.ButtonBarLayout;
-	import org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumn;
 	import org.apache.royale.html.supportClasses.IDataGridColumnList;
 	import org.apache.royale.jewel.supportClasses.Viewport;
+	import org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumn;
 
     /**
      *  The DataGridView class is the visual bead for the org.apache.royale.jewel.DataGrid.
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as
index b8a451c..310c406 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridColumnList.as
@@ -57,7 +57,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
 		public function DataGridColumnList()
 		{
 			super();
-			//typeNames = "jewel dataGridColumnList";
+			typeNames = "jewel list column";
 		}
 		
         /**
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
index 50c3853..86d3185 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
@@ -25,6 +25,13 @@
     width: 200px
     height: 290px
 
+.jewel.list.column
+    border-radius: 0px
+    &.first
+        border-right: 0px
+    &.last
+        border-left: 0px
+
 j|DataGrid
     IChangePropagator: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator")
     IDataGridPresentationModel: ClassReference("org.apache.royale.jewel.beads.models.DataGridPresentationModel")


[royale-asjs] 35/42: tour-de-jewel: improve DataGrid example

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 6f5e740898191816cbd8530c5570e950220d9e1e
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sat Dec 7 20:43:58 2019 +0100

    tour-de-jewel: improve DataGrid example
---
 .../src/main/royale/DataGridPlayGround.mxml        | 33 +++++++++++++---------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
index e479d64..230cb0e 100644
--- a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
@@ -30,13 +30,13 @@ limitations under the License.
 
         private function dataGridChange(grid:DataGrid, output:Label) : void
 		{
-			output.text = "Clicked on row "+grid.selectedIndex;
+			output.text = "Clicked on row " + grid.selectedIndex;
 		}
 
-		private function refreshGrid():void
+		private function refreshGrid(grid:DataGrid):void
 		{
-			dataGrid.dataProvider = null;
-			dataGrid.dataProvider = (productModel as ProductModel).productList;
+			grid.dataProvider = null;
+			grid.dataProvider = (productModel as ProductModel).productList;
 		}
 		]]>
 	</fx:Script>
@@ -56,8 +56,8 @@ limitations under the License.
 				
 				<j:Label text="Basic configuration with no column widths"/>
 
-				<j:DataGrid localId="dataGrid" width="100%" height="100%" 
-					change="dataGridChange(event.target as DataGrid, output1)">
+				<j:DataGrid localId="datagrid" width="100%" height="100%" 
+					change="dataGridChange(event.target as DataGrid, datagrid_lb)">
 					<j:beads>
 						<js:ConstantBinding
 							sourceID="productModel"
@@ -65,15 +65,15 @@ limitations under the License.
 							destinationPropertyName="dataProvider" />
 					</j:beads>
 					<j:columns>
-						<j:DataGridColumn label="Images" dataField="image" itemRenderer="itemRenderers.ImageListItemRenderer"/>
+						<j:DataGridColumn label="Images" dataField="image" 
+											itemRenderer="itemRenderers.ImageListItemRenderer"/>
 						<j:DataGridColumn label="Title" dataField="title"/>
 						<j:DataGridColumn label="Sales" dataField="sales"/>
 					</j:columns>
 				</j:DataGrid>
 
-				<j:Label id="output1" text="output1"/>
-				<j:Button text="Refresh Grid" click="refreshGrid()"/>
-				<j:Label text="Refresh this grid after add or removing values"/>
+				<j:Label id="datagrid_lb" text="DagaGrid selection will be shown here"/>
+				<j:Button text="Refresh Grid" click="refreshGrid(datagrid)" emphasis="primary"/>
 			</j:Card>
 		</j:GridCell>
 		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
@@ -82,15 +82,20 @@ limitations under the License.
 				
 				<j:Label text="Using specific column widths"/>
 
-				<j:DataGrid width="100%" height="100%" rowHeight="40"
-					emphasis="primary" change="dataGridChange(event.target as DataGrid, output1)"
+				<j:DataGrid localId="datagrid2" width="100%" height="100%" 
+					rowHeight="40" emphasis="primary" 
+					change="dataGridChange(event.target as DataGrid, datagrid2_lb)"
 					dataProvider="{productModel.productList}">
 					<j:columns>
-						<j:DataGridColumn label="Images" dataField="image" columnWidth="45" itemRenderer="itemRenderers.ImageListItemRenderer"/>
+						<j:DataGridColumn label="Images" dataField="image" columnWidth="90" 
+											itemRenderer="itemRenderers.ImageListItemRenderer"/>
 						<j:DataGridColumn label="Title" dataField="title" columnWidth="120" />
-						<j:DataGridColumn label="Sales" dataField="sales" columnWidth="50" />
+						<j:DataGridColumn label="Sales" dataField="sales" columnWidth="70" />
 					</j:columns>
 				</j:DataGrid>
+
+				<j:Label id="datagrid2_lb" text="DagaGrid selection will be shown here"/>
+				<j:Button text="Refresh Grid" click="refreshGrid(datagrid2)" emphasis="primary"/>
 			</j:Card>
 		</j:GridCell>
 	</j:Grid>


[royale-asjs] 28/42: jewel-datagrid: decorate data grid item renderers with a separator light line

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit d5ca90d2a90bbb71e8e1cc267b2dee5d83928c18
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Dec 6 18:15:40 2019 +0100

    jewel-datagrid: decorate data grid item renderers with a separator light line
---
 frameworks/projects/Jewel/src/main/resources/defaults.css         | 3 +++
 frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 90e0c5b..2c37850 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -505,6 +505,9 @@ j|ComboBoxPopUp {
   border-left: 0px;
   border-bottom-right-radius: 0.25rem;
 }
+.jewel.datagrid .jewel.list.column .jewel.item {
+  border-bottom: 1px solid #efefef;
+}
 
 j|DataGrid {
   IChangePropagator: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator");
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
index 4679d9d..bcc7d16 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
@@ -41,6 +41,10 @@ $border-radius: .25rem
         &.last
             border-left: 0px
             border-bottom-right-radius: $border-radius
+        
+        .jewel.item
+            border-bottom: 1px solid #efefef
+
 
 j|DataGrid
     IChangePropagator: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator")


[royale-asjs] 29/42: jewel-datagrid: use jewel itemenderer

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit ec630447d713a7c4b0b099c503c5e181a154568c
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Dec 6 18:57:19 2019 +0100

    jewel-datagrid: use jewel itemenderer
---
 .../src/main/royale/DataGridPlayGround.mxml        | 37 +++++++++---------
 .../itemRenderers/ImageListItemRenderer.mxml       | 44 ++++++++++++++++++++++
 .../TourDeJewel/src/main/royale/vos/Product.as     |  2 +
 3 files changed, 65 insertions(+), 18 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
index b9b3b7a..e479d64 100644
--- a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
@@ -53,11 +53,11 @@ limitations under the License.
 		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
 			<j:Card>
 				<html:H3 text="Jewel DataGrid"/>
+				
+				<j:Label text="Basic configuration with no column widths"/>
 
 				<j:DataGrid localId="dataGrid" width="100%" height="100%" 
-					change="dataGridChange(dataGrid, output1)" 
-					rowHeight="40" className="PercentageColumnWidths"
-					emphasis="primary">
+					change="dataGridChange(event.target as DataGrid, output1)">
 					<j:beads>
 						<js:ConstantBinding
 							sourceID="productModel"
@@ -65,9 +65,9 @@ limitations under the License.
 							destinationPropertyName="dataProvider" />
 					</j:beads>
 					<j:columns>
-						<j:DataGridColumn label="Images and Pictures" dataField="image" columnWidth="45" itemRenderer="itemRenderers.ProductItemRenderer"/>
-						<j:DataGridColumn label="Title" dataField="title" columnWidth="120" />
-						<j:DataGridColumn label="Sales" dataField="sales" columnWidth="50" />
+						<j:DataGridColumn label="Images" dataField="image" itemRenderer="itemRenderers.ImageListItemRenderer"/>
+						<j:DataGridColumn label="Title" dataField="title"/>
+						<j:DataGridColumn label="Sales" dataField="sales"/>
 					</j:columns>
 				</j:DataGrid>
 
@@ -78,7 +78,19 @@ limitations under the License.
 		</j:GridCell>
 		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
 			<j:Card>
-				<html:H4 text="DataGrid"/>
+				<html:H3 text="Jewel DataGrid"/>
+				
+				<j:Label text="Using specific column widths"/>
+
+				<j:DataGrid width="100%" height="100%" rowHeight="40"
+					emphasis="primary" change="dataGridChange(event.target as DataGrid, output1)"
+					dataProvider="{productModel.productList}">
+					<j:columns>
+						<j:DataGridColumn label="Images" dataField="image" columnWidth="45" itemRenderer="itemRenderers.ImageListItemRenderer"/>
+						<j:DataGridColumn label="Title" dataField="title" columnWidth="120" />
+						<j:DataGridColumn label="Sales" dataField="sales" columnWidth="50" />
+					</j:columns>
+				</j:DataGrid>
 			</j:Card>
 		</j:GridCell>
 	</j:Grid>
@@ -86,17 +98,6 @@ limitations under the License.
 	<fx:Style>
 		@namespace j "library://ns.apache.org/royale/jewel";
 		
-		/* Puts a box around each cell of the DataGrids.
-		 */
-		j|DataGrid .DataItemRenderer {
-			border: 1px solid #ACACAC;
-			line-height: 40px;
-		}
-		j|DataGrid .StringItemRenderer {
-			border: 1px solid #ACACAC;
-			line-height: 40px;
-		}
-		
 		/* Allows the DataGrid to be specified with percentage widths for the columns (rather
 		 * than pixel widths) and does not respond to changes to its dataProvider.
 		 */
diff --git a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ImageListItemRenderer.mxml b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ImageListItemRenderer.mxml
new file mode 100644
index 0000000..f2e3786
--- /dev/null
+++ b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ImageListItemRenderer.mxml
@@ -0,0 +1,44 @@
+<?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.
+
+-->
+<j:ListItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
+    xmlns:j="library://ns.apache.org/royale/jewel" 
+    xmlns:js="library://ns.apache.org/royale/basic" 
+    xmlns="http://www.w3.org/1999/xhtml">
+
+    <fx:Script>
+        <![CDATA[
+			import vos.Product;
+			
+            [Bindable("dataChange")]
+            public function get product():Product
+            {
+                return data as Product;
+            }
+		]]>
+    </fx:Script>
+
+    <j:beads>
+        <js:ItemRendererDataBinding/>
+    </j:beads>
+
+    <j:Image src="{ product ? product.image : '' }"/>
+
+</j:ListItemRenderer>
+
diff --git a/examples/royale/TourDeJewel/src/main/royale/vos/Product.as b/examples/royale/TourDeJewel/src/main/royale/vos/Product.as
index 106c86c..3a26fb0 100644
--- a/examples/royale/TourDeJewel/src/main/royale/vos/Product.as
+++ b/examples/royale/TourDeJewel/src/main/royale/vos/Product.as
@@ -17,6 +17,8 @@
 //
 ////////////////////////////////////////////////////////////////////////////////
 package vos {
+	
+	[Bindable]
 	public class Product
 	{
 		private var _id:String;


[royale-asjs] 21/42: jewel-buttonbar: improvements to example

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit af7f91a683fc5d9cf081e2c10072c740550299e1
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Dec 2 14:53:07 2019 +0100

    jewel-buttonbar: improvements to example
---
 .../TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml   | 14 ++++++++------
 .../TourDeJewel/src/main/royale/models/ListsModel.as       | 10 ++++++++++
 .../royale/jewel/itemRenderers/ButtonBarItemRenderer.as    |  1 -
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
index 6175926..3b0c965 100644
--- a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
@@ -28,6 +28,10 @@ limitations under the License.
 		<js:ContainerDataBinding/>
 	</c:beads>
 
+	<c:model>
+		<models:ListsModel id="listModel"/>
+	</c:model>
+
 	<j:Grid gap="true" itemsVerticalAlign="itemsSameHeight">
 		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
 			<j:Card>
@@ -39,12 +43,10 @@ limitations under the License.
 					</j:dataProvider>
 				</j:ButtonBar>
 
-				<j:ButtonBar localId="bb" change="bb_label.text = bb.selectedItem as String"
-					emphasis="primary">
-					<j:dataProvider>
-						<js:ArrayList source="[Iron Man, Hulk, Thor, Captain America, Black Widow]" />
-					</j:dataProvider>
-				</j:ButtonBar>
+				<j:ButtonBar localId="bb" change="bb_label.text = bb.selectedItem.label"
+					emphasis="primary"
+					dataProvider="{listModel.suravengers}"/>
+
 				<j:Label localId="bb_label"/>
 			</j:Card>
 		</j:GridCell>
diff --git a/examples/royale/TourDeJewel/src/main/royale/models/ListsModel.as b/examples/royale/TourDeJewel/src/main/royale/models/ListsModel.as
index 873deda..dcc8649 100644
--- a/examples/royale/TourDeJewel/src/main/royale/models/ListsModel.as
+++ b/examples/royale/TourDeJewel/src/main/royale/models/ListsModel.as
@@ -60,6 +60,16 @@ package models
 			return _avengers;
 		}
 		
+		private var _suravengers:ArrayList = new ArrayList([
+			new IconListVO("Hulk", MaterialIconType.WEB_ASSET),
+			new IconListVO("Thor", MaterialIconType.WEB_ASSET),
+			new IconListVO("Hawkeye", MaterialIconType.WEB_ASSET)
+		]);
+		
+		public function get suravengers():ArrayList
+		{
+			return _suravengers;
+		}
 
 		
 		/**
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
index 438b7a4..794a89c 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
@@ -110,7 +110,6 @@ package org.apache.royale.jewel.itemRenderers
 		 */
 
 		private var _itemRendererParent:Object;
-
 		/**
 		 * The parent container for the itemRenderer instance.
 		 *


[royale-asjs] 07/42: jewel-datagrid: remove trace

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit cc1fe227d470cec8d3311fa0bd651ad1dae1077d
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Nov 27 00:35:28 2019 +0100

    jewel-datagrid: remove trace
---
 .../src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as  | 1 -
 1 file changed, 1 deletion(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
index 815e803..a62aac7 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
@@ -131,7 +131,6 @@ package org.apache.royale.jewel.beads.views
             sharedModel.headerModel = _header.model as IBeadModel;
 
             var listAreaClass:Class = ValuesManager.valuesImpl.getValue(host, "listAreaClass") as Class;
-            trace("listAreaClass: " + listAreaClass);
             assert(listAreaClass != null,"listAreaClass for DataGrid must be set!")
             _listArea = new listAreaClass() as IUIBase;
             (_listArea as ILayoutChild).percentWidth = 100;


[royale-asjs] 02/42: jewel-datagrid: starting example for Jewel DataGrid in Tour De Jewel

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 5f716f8bec76568cd59463aa80f425498d8c2f11
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Nov 25 13:06:34 2019 +0100

    jewel-datagrid: starting example for Jewel DataGrid in Tour De Jewel
---
 .../src/main/royale/DataGridPlayGround.mxml        | 119 +++++++++++++++++++++
 .../TourDeJewel/src/main/royale/MainContent.mxml   |   1 +
 .../royale/itemRenderers/ProductItemRenderer.as    |  66 ++++++++++++
 .../src/main/royale/models/MainNavigationModel.as  |   1 +
 .../src/main/royale/models/ProductModel.as         |  52 +++++++++
 .../TourDeJewel/src/main/royale/vos/Product.as     |  67 ++++++++++++
 6 files changed, 306 insertions(+)

diff --git a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
new file mode 100644
index 0000000..6bce9cb
--- /dev/null
+++ b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
@@ -0,0 +1,119 @@
+<?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.
+
+-->
+<c:ExampleAndSourceCodeTabbedSectionContent xmlns:fx="http://ns.adobe.com/mxml/2009" 
+	xmlns:j="library://ns.apache.org/royale/jewel" 
+	xmlns:html="library://ns.apache.org/royale/html" 
+	xmlns:js="library://ns.apache.org/royale/basic"
+	xmlns:models="models.*" 
+	xmlns:c="components.*" sourceCodeUrl="DataGridPlayGround.mxml">
+	
+	<fx:Script>
+		<![CDATA[      
+        import org.apache.royale.jewel.Label;
+        import models.ProductModel;
+
+        private function dataGridChange(grid:DataGrid, output:Label) : void
+		{
+			output.text = "Clicked on row "+grid.selectedIndex;
+		}
+
+		private function refreshGrid():void
+		{
+			dataGrid.dataProvider = null;
+			dataGrid.dataProvider = (productModel as ProductModel).productArray;
+		}
+		]]>
+	</fx:Script>
+
+	<js:model>
+		<models:ProductModel localId="productModel"/>
+	</js:model>
+	
+	<j:beads>
+		<js:ContainerDataBinding/>
+	</j:beads>
+
+	<j:Grid gap="true" itemsVerticalAlign="itemsSameHeight">
+		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
+			<j:Card>
+				<html:H3 text="Jewel DataGrid"/>
+
+				<j:DataGrid localId="dataGrid" width="100%" height="100%" change="dataGridChange(dataGrid, output1)" 
+					rowHeight="40" className="PercentageColumnWidths DataGrid">
+					<j:beads>
+						<js:ConstantBinding
+							sourceID="productModel"
+							sourcePropertyName="productArray"
+							destinationPropertyName="dataProvider" />
+					</j:beads>
+					<j:columns>
+						<j:DataGridColumn label="Image" dataField="image" columnWidth="15" itemRenderer="itemRenderers.ProductItemRenderer"/>
+						<j:DataGridColumn label="Title" dataField="title" columnWidth="60" />
+						<j:DataGridColumn label="Sales" dataField="sales" columnWidth="25" />
+					</j:columns>
+				</j:DataGrid>
+
+				<!-- controls for first grid -->
+				<j:Label id="output1" x="30" y="430"/>
+				<j:Button text="Refresh Grid" x="20" y="460" click="refreshGrid()" />
+				<j:Label text="Refresh this grid after add or removing values" x="30" y="490" />
+	
+			</j:Card>
+		</j:GridCell>
+		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
+			<j:Card>
+				<html:H4 text="DataGrid"/>
+			</j:Card>
+		</j:GridCell>
+	</j:Grid>
+
+	<fx:Style>
+		@namespace j "library://ns.apache.org/royale/jewel";
+		
+		/* Puts a box around each cell of the DataGrids.
+		 */
+		j|DataGrid .DataItemRenderer {
+			border: 1px solid #ACACAC;
+			line-height: 40px;
+		}
+		j|DataGrid .StringItemRenderer {
+			border: 1px solid #ACACAC;
+			line-height: 40px;
+		}
+		
+		/* Allows the DataGrid to be specified with percentage widths for the columns (rather
+		 * than pixel widths) and does not respond to changes to its dataProvider.
+		 */
+		.PercentageColumnWidths {
+			IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.DataGridPercentageLayout");
+			border: 1px solid #ACACAC;
+		}
+		
+		.OuterGroup {
+			background-color: orange;
+			padding: 10px;
+		}
+		.OuterGroup .DataGrid {
+			position: relative;
+		}
+
+	</fx:Style>
+	
+</c:ExampleAndSourceCodeTabbedSectionContent>
diff --git a/examples/royale/TourDeJewel/src/main/royale/MainContent.mxml b/examples/royale/TourDeJewel/src/main/royale/MainContent.mxml
index 72e00ca..60c6257 100644
--- a/examples/royale/TourDeJewel/src/main/royale/MainContent.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/MainContent.mxml
@@ -248,6 +248,7 @@ limitations under the License.
         <local:TextInputPlayGround name="textinput_panel"/>
         <local:GridPlayGround name="grid_panel"/>
         <local:CardPlayGround name="card_panel"/>
+        <local:DataGridPlayGround name="datagrid_panel"/>
         <local:TablePlayGround name="tables_panel"/>
         <local:FormsValidationPlayGround name="form_validation_panel"/>
         <local:DropDownListPlayGround name="dropdownlist_panel"/>
diff --git a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ProductItemRenderer.as b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ProductItemRenderer.as
new file mode 100644
index 0000000..347c370
--- /dev/null
+++ b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/ProductItemRenderer.as
@@ -0,0 +1,66 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 itemRenderers
+{
+	import org.apache.royale.html.Image;
+	import org.apache.royale.html.supportClasses.DataItemRenderer;
+
+	public class ProductItemRenderer extends DataItemRenderer
+	{
+		public function ProductItemRenderer()
+		{
+			super();
+		}
+
+		private var image:Image;
+
+		override public function addedToParent():void
+		{
+			super.addedToParent();
+
+			// add an image and two labels
+			image = new Image();
+			addElement(image);
+		}
+
+		override public function get data():Object
+		{
+			return super.data;
+		}
+
+		override public function set data(value:Object):void
+		{
+			super.data = value;
+
+			image.src = value.image;
+		}
+
+		override public function adjustSize():void
+		{
+			var cy:Number = this.height/2;
+
+			image.x = 4;
+			image.y = cy - 16;
+			image.width = 32;
+			image.height = 32;
+
+			updateRenderer();
+		}
+	}
+}
diff --git a/examples/royale/TourDeJewel/src/main/royale/models/MainNavigationModel.as b/examples/royale/TourDeJewel/src/main/royale/models/MainNavigationModel.as
index 19254f7..0e1bd4b 100644
--- a/examples/royale/TourDeJewel/src/main/royale/models/MainNavigationModel.as
+++ b/examples/royale/TourDeJewel/src/main/royale/models/MainNavigationModel.as
@@ -56,6 +56,7 @@ package models
             new NavigationLinkVO("Card", "card_panel", MaterialIconType.WEB_ASSET),
             new NavigationLinkVO("Layouts", "layouts_panel", MaterialIconType.VIEW_QUILT),
             new NavigationLinkVO("Grid", "grid_panel", MaterialIconType.GRID_ON),
+            new NavigationLinkVO("DataGrid", "datagrid_panel", MaterialIconType.VIEW_LIST),
             new NavigationLinkVO("Tables", "tables_panel", MaterialIconType.VIEW_LIST),
             new NavigationLinkVO("TabBar", "tabbar_panel", MaterialIconType.TAB),
             new NavigationLinkVO("View States", "viewstates_panel", MaterialIconType.CHORME_READER_MODE),
diff --git a/examples/royale/TourDeJewel/src/main/royale/models/ProductModel.as b/examples/royale/TourDeJewel/src/main/royale/models/ProductModel.as
new file mode 100644
index 0000000..edbb6fe
--- /dev/null
+++ b/examples/royale/TourDeJewel/src/main/royale/models/ProductModel.as
@@ -0,0 +1,52 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 models
+{
+	import org.apache.royale.collections.ArrayList;
+	import vos.Product;
+
+	public class ProductModel
+	{
+		private var _productList:ArrayList = new ArrayList([
+            new Product("ps100","Widgets",44,200,"assets/smallbluerect.jpg"),
+            new Product("tx200","Thingys",5,285,"assets/smallgreenrect.jpg"),
+            new Product("rz300","Sprockets",80,105,"assets/smallyellowrect.jpg"),
+            new Product("dh440","Doohickies",10,340,"assets/smallredrect.jpg"),
+            new Product("ps220","Weejets",35,190,"assets/smallorangerect.jpg")
+		]);
+
+		public function get productList():ArrayList
+		{
+			return _productList;
+		}
+		
+		private var _productArray:Array = [
+			new Product("ps100","Blueberries",44,200,"assets/smallbluerect.jpg"),
+			new Product("tx200","Kiwis",5,285,"assets/smallgreenrect.jpg"),
+			new Product("rz300","Bananas",80,105,"assets/smallyellowrect.jpg"),
+			new Product("dh440","Strawberries",10,340,"assets/smallredrect.jpg"),
+			new Product("ps220","Oranges",35,190,"assets/smallorangerect.jpg")
+		];
+		
+		public function get productArray():Array
+		{
+			return _productArray;
+		}
+	}
+}
diff --git a/examples/royale/TourDeJewel/src/main/royale/vos/Product.as b/examples/royale/TourDeJewel/src/main/royale/vos/Product.as
new file mode 100644
index 0000000..106c86c
--- /dev/null
+++ b/examples/royale/TourDeJewel/src/main/royale/vos/Product.as
@@ -0,0 +1,67 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 vos {
+	public class Product
+	{
+		private var _id:String;
+		private var _title:String;
+		private var _detail:Number;
+		private var _image:String;
+		private var _sales:Number;
+		
+		public function Product(id:String,title:String,detail:Number,sales:Number,image:String)
+		{
+			this._id = id;
+			this._title = title;
+			this._detail = detail;
+			this._sales = sales;
+			this._image = image;
+		}
+		
+		public function get id():String
+		{
+			return _id;
+		}
+		
+		public function get title():String
+		{
+			return _title;
+		}
+		
+		public function get detail():Number
+		{
+			return _detail;
+		}
+		
+		public function get image():String
+		{
+			return _image;
+		}
+		
+		public function get sales():Number
+		{
+			return _sales;
+		}
+		
+		public function toString():String
+		{
+			return title;
+		}
+	}
+}


[royale-asjs] 26/42: jewel-buttonbar: add proportional widths in opposite to same widths

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit dc64f67e792bfa377f4da40981c1a3299efb7698
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Tue Dec 3 12:53:15 2019 +0100

    jewel-buttonbar: add proportional widths in opposite to same widths
---
 .../src/main/royale/ButtonBarPlayGround.mxml       |  7 +-
 .../projects/Jewel/src/main/resources/defaults.css |  4 +-
 .../Jewel/src/main/resources/jewel-manifest.xml    |  1 +
 .../projects/Jewel/src/main/royale/JewelClasses.as |  1 -
 .../royale/jewel/beads/layouts/ButtonBarLayout.as  | 97 ++++++++++++++++------
 .../Jewel/src/main/sass/components/_layout.sass    |  4 +-
 6 files changed, 81 insertions(+), 33 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
index b838ac3..2f149a1 100644
--- a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
@@ -76,7 +76,7 @@ limitations under the License.
 				<j:ButtonBar localId="bb3" change="bb2_label.text = bb3.selectedItem as String"
 					emphasis="primary">
 					<j:beads>
-						<j:HorizontalLayout/>
+						<j:ButtonBarLayout proportionalWidths="true"/>
 					</j:beads>
 					<j:dataProvider>
 						<js:ArrayList source="[Home, Support, Operations, Service]" />
@@ -88,13 +88,16 @@ limitations under the License.
 				<j:ButtonBar localId="bb4" change="bb2_label.text = bb4.selectedItem as String"
 					emphasis="secondary" width="100%">
 					<j:beads>
-						<j:HorizontalLayout gap="3"/>
+						<j:ButtonBarLayout localId="ppw" proportionalWidths="true" gap="3"/>
 					</j:beads>
 					<j:dataProvider>
 						<js:ArrayList source="[Home, Support, Operations, Service]" />
 					</j:dataProvider>
 				</j:ButtonBar>
 
+				<j:CheckBox change="ppw.proportionalWidths = !ppw.proportionalWidths" selected="true"
+					text="Proportional Widths (true) / Same Widths (false)"/>
+
 				<j:Label localId="bb2_label"/>
 			</j:Card>
 		</j:GridCell>
diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 9236006..90e0c5b 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -1070,10 +1070,10 @@ j|Label {
 .layout.horizontal.gap-10x3px > * {
   margin: 0px 0px 0px 30px;
 }
-.layout.horizontal.samewidth > * {
+.layout.horizontal.sameWidths > * {
   flex: 1 0;
 }
-.layout.horizontal.nosamewidth > * {
+.layout.horizontal.proportinalWidths > * {
   flex: 1 0 auto;
 }
 .layout.vertical {
diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index 7d7dfc1..4b586d9 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -185,6 +185,7 @@
     <component id="GridLayout" class="org.apache.royale.jewel.beads.layouts.GridLayout"/>
     <component id="GridCellLayout" class="org.apache.royale.jewel.beads.layouts.GridCellLayout"/>
     <component id="TableLayout" class="org.apache.royale.jewel.beads.layouts.TableLayout"/>
+    <component id="ButtonBarLayout" class="org.apache.royale.jewel.beads.layouts.ButtonBarLayout"/>
 
     <component id="StringItemRenderer" class="org.apache.royale.jewel.itemRenderers.StringItemRenderer"/>
     <component id="ListItemRenderer" class="org.apache.royale.jewel.itemRenderers.ListItemRenderer"/>
diff --git a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
index 4d48f3b..aa2f480 100644
--- a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
+++ b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
@@ -118,7 +118,6 @@ package
         import org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList; DataGridColumnList;
         import org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator; DataGridColumnChangePropagator;
         import org.apache.royale.jewel.beads.layouts.DataGridLayout; DataGridLayout;
-        import org.apache.royale.jewel.beads.layouts.ButtonBarLayout; ButtonBarLayout;
 
         import org.apache.royale.jewel.supportClasses.util.positionInsideBoundingClientRect; positionInsideBoundingClientRect;
 
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as
index f91fbbf..68b5e61 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as
@@ -22,8 +22,8 @@ package org.apache.royale.jewel.beads.layouts
 	import org.apache.royale.core.ILayoutView;
 	import org.apache.royale.core.IStrand;
 	import org.apache.royale.core.IStyleableObject;
-	import org.apache.royale.html.beads.models.ButtonBarModel;
 	import org.apache.royale.events.Event;
+	import org.apache.royale.html.beads.models.ButtonBarModel;
 
 	/**
 	 *  The ButtonBarLayout class bead sizes and positions the button
@@ -56,7 +56,7 @@ package org.apache.royale.jewel.beads.layouts
 		/**
 		 * @royalesuppresspublicvarwarning
 		 */
-		public static const LAYOUT_TYPE_NAMES:String = "layout horizontal samewidth";
+		public static const LAYOUT_TYPE_NAMES:String = "layout horizontal";
 
 		/**
 		 *  Add class selectors when the component is addedToParent
@@ -66,7 +66,7 @@ package org.apache.royale.jewel.beads.layouts
  		 *  @langversion 3.0
  		 *  @playerversion Flash 10.2
  		 *  @playerversion AIR 2.6
- 		 *  @productversion Royale 0.9.4
+ 		 *  @productversion Royale 0.9.7
  		 */
 		override public function beadsAddedHandler(event:Event = null):void
 		{
@@ -74,9 +74,54 @@ package org.apache.royale.jewel.beads.layouts
 
 			COMPILE::JS
 			{
-				if (hostClassList.contains("samewidth"))
-					hostClassList.remove("samewidth");
-				hostClassList.add("samewidth");
+				if(proportionalWidths)
+				{
+					hostClassList.add("proportinalWidths");
+				} else 
+				{
+					hostClassList.add("sameWidths");
+				}
+			}
+		}
+
+		private var _proportionalWidths:Boolean;
+		/**
+		 *  Switch between "proportionalWidth" and "sameWidths".
+		 *  Default is false (sameWidths) and all buttons are has the same width.
+		 *  True to make all buttons fill all size available proportionally.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+        public function get proportionalWidths():Boolean
+        {
+            return _proportionalWidths;
+        }
+
+        public function set proportionalWidths(value:Boolean):void
+        {
+			if (_proportionalWidths != value)
+            {
+                COMPILE::JS
+                {
+				if(hostComponent)
+				{
+					if(value)
+					{
+						if (hostClassList.contains("sameWidths"))
+							hostClassList.remove("sameWidths");
+						hostClassList.add("proportinalWidths");
+					} else 
+					{
+						if (hostClassList.contains("proportinalWidths"))
+							hostClassList.remove("proportinalWidths");
+						hostClassList.add("sameWidths");
+					}
+				}
+				}
+				_proportionalWidths = value;
 			}
 		}
 
@@ -126,27 +171,27 @@ package org.apache.royale.jewel.beads.layouts
 				if (ilc == null || !ilc.visible) continue;
 				if (!(ilc is IStyleableObject)) continue;
 				
-				COMPILE::SWF {
-				if (buttonWidths) {
-					var widthValue:* = buttonWidths[i];
+				// COMPILE::SWF {
+				// if (buttonWidths) {
+				// 	var widthValue:* = buttonWidths[i];
 
-					if (_widthType == ButtonBarModel.PIXEL_WIDTHS) {
-						if (widthValue != null) ilc.width = Number(widthValue);
-						IStyleableObject(ilc).style.flexGrow = 0;
-					}
-					else if (_widthType == ButtonBarModel.PROPORTIONAL_WIDTHS) {
-						if (widthValue != null) {
-							IStyleableObject(ilc).style.flexGrow = Number(widthValue);
-						}
-					}
-					else if (_widthType == ButtonBarModel.PERCENT_WIDTHS) {
-						if (widthValue != null) ilc.percentWidth = Number(widthValue);
-						IStyleableObject(ilc).style.flexGrow = 0;
-					}
-				} else if (!_widthType == ButtonBarModel.NATURAL_WIDTHS) {
-					IStyleableObject(ilc).style.flexGrow = 1;
-				}
-				}
+				// 	if (_widthType == ButtonBarModel.PIXEL_WIDTHS) {
+				// 		if (widthValue != null) ilc.width = Number(widthValue);
+				// 		IStyleableObject(ilc).style.flexGrow = 0;
+				// 	}
+				// 	else if (_widthType == ButtonBarModel.PROPORTIONAL_WIDTHS) {
+				// 		if (widthValue != null) {
+				// 			IStyleableObject(ilc).style.flexGrow = Number(widthValue);
+				// 		}
+				// 	}
+				// 	else if (_widthType == ButtonBarModel.PERCENT_WIDTHS) {
+				// 		if (widthValue != null) ilc.percentWidth = Number(widthValue);
+				// 		IStyleableObject(ilc).style.flexGrow = 0;
+				// 	}
+				// } else if (!_widthType == ButtonBarModel.NATURAL_WIDTHS) {
+				// 	IStyleableObject(ilc).style.flexGrow = 1;
+				// }
+				// }
 
 				// COMPILE::JS {
 				// // otherwise let the flexbox layout handle matters on its own.
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_layout.sass b/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
index 381f003..5d5bfcd 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
@@ -81,10 +81,10 @@ $gap-size: 10px !default
 				> *
 					margin: 0px 0px 0px ($gap + $i * $gap-step)
 
-		&.samewidth
+		&.sameWidths
 			> *
 				flex: 1 0
-		&.nosamewidth
+		&.proportinalWidths
 			> *
 				flex: 1 0 auto
 


[royale-asjs] 13/42: jewel: various import organizations and use toggleClass method in SimpleButton

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 4a3e9f90d7cc5133ee2c86268d0ee547be8c396f
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Thu Nov 28 20:02:24 2019 +0100

    jewel: various import organizations and use toggleClass method in SimpleButton
---
 .../org/apache/royale/jewel/beads/views/ListView.as       |  5 ++++-
 .../org/apache/royale/jewel/supportClasses/Viewport.as    |  5 ++++-
 .../royale/jewel/supportClasses/button/SimpleButton.as    |  4 ++--
 .../apache/royale/jewel/supportClasses/list/DataGroup.as  | 15 +++++++--------
 4 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
index e64912d..c5a0b6d 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
@@ -18,6 +18,10 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel.beads.views
 {
+	COMPILE::JS
+	{
+	import org.apache.royale.events.IEventDispatcher;
+	}
 	import org.apache.royale.core.IItemRendererParent;
 	import org.apache.royale.core.ILayoutView;
 	import org.apache.royale.core.IRollOverModel;
@@ -25,7 +29,6 @@ package org.apache.royale.jewel.beads.views
 	import org.apache.royale.core.ISelectionModel;
 	import org.apache.royale.core.IStrand;
 	import org.apache.royale.events.Event;
-	import org.apache.royale.events.IEventDispatcher;
 	import org.apache.royale.html.beads.DataContainerView;
 
 	/**
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/Viewport.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/Viewport.as
index 21ab897..d0ee025 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/Viewport.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/Viewport.as
@@ -18,11 +18,14 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel.supportClasses
 {
+	COMPILE::JS
+	{
 	import org.apache.royale.core.IContentView;
 	import org.apache.royale.core.IStrand;
 	import org.apache.royale.core.UIBase;
-	import org.apache.royale.html.supportClasses.Viewport;
 	import org.apache.royale.utils.loadBeadFromValuesManager;
+	}
+	import org.apache.royale.html.supportClasses.Viewport;
 
     /**
      * A Viewport is the area of a Container set aside for displaying
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/button/SimpleButton.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/button/SimpleButton.as
index f3da34e..a9c8999 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/button/SimpleButton.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/button/SimpleButton.as
@@ -205,11 +205,11 @@ package org.apache.royale.jewel.supportClasses.button
             {
                 if(_emphasis)
                 {
-                    classSelectorList.toggle(_emphasis, false);
+                    toggleClass(_emphasis, false);
                 }
                 _emphasis = value;
 
-                classSelectorList.toggle(_emphasis, value);
+                toggleClass(_emphasis, value);
             }
         }
 
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/list/DataGroup.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/list/DataGroup.as
index 72f2a87..2e37891 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/list/DataGroup.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/list/DataGroup.as
@@ -18,17 +18,16 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel.supportClasses.list
 {
-	import org.apache.royale.html.DataContainer;
-    import org.apache.royale.core.IBead;
-    import org.apache.royale.core.IStrand;
-
     COMPILE::JS
     {
-        import org.apache.royale.core.WrappedHTMLElement;
-		import org.apache.royale.html.util.addElementToWrapper;
-		import org.apache.royale.html.beads.DataContainerView;
+	import org.apache.royale.core.WrappedHTMLElement;
+	import org.apache.royale.html.util.addElementToWrapper;
+	import org.apache.royale.html.beads.DataContainerView;
     }
-
+	import org.apache.royale.html.DataContainer;
+    import org.apache.royale.core.IBead;
+    import org.apache.royale.core.IStrand;
+	
 	/**
 	 *  The DataGroup class is the IItemRendererParent used internally
      *  by org.apache.royale.jewel.List class.


[royale-asjs] 25/42: jewel-buttonbar: other style with buttons with no equal widths

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 3ac9fad879d40348115b0e6d8af1047ccfb1d7cf
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Tue Dec 3 07:49:43 2019 +0100

    jewel-buttonbar: other style with buttons with no equal widths
---
 frameworks/projects/Jewel/src/main/resources/defaults.css       | 3 +++
 frameworks/projects/Jewel/src/main/sass/components/_layout.sass | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 415fecc..9236006 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -1073,6 +1073,9 @@ j|Label {
 .layout.horizontal.samewidth > * {
   flex: 1 0;
 }
+.layout.horizontal.nosamewidth > * {
+  flex: 1 0 auto;
+}
 .layout.vertical {
   flex-direction: column;
   flex-wrap: nowrap;
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_layout.sass b/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
index 6eaf222..381f003 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
@@ -84,6 +84,9 @@ $gap-size: 10px !default
 		&.samewidth
 			> *
 				flex: 1 0
+		&.nosamewidth
+			> *
+				flex: 1 0 auto
 
 	// Vertical
 	&.vertical


[royale-asjs] 11/42: required-by-compiler-fix: fix child namespaces (royale/royale-compiler#101)

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit f0080de7df5ef2f70cb69f7712a72a37c49c3c10
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Nov 27 18:54:28 2019 +0100

    required-by-compiler-fix: fix child namespaces (royale/royale-compiler#101)
---
 .../royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
index 6ed39eb..bffd6f1 100644
--- a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
@@ -41,13 +41,13 @@ limitations under the License.
 		]]>
 	</fx:Script>
 
-	<js:model>
+	<c:model>
 		<models:ProductModel localId="productModel"/>
-	</js:model>
+	</c:model>
 	
-	<j:beads>
+	<c:beads>
 		<js:ContainerDataBinding/>
-	</j:beads>
+	</c:beads>
 
 	<j:Grid gap="true" itemsVerticalAlign="itemsSameHeight">
 		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">


[royale-asjs] 16/42: jewel-buttonbar: improve styles

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 21b8eb50e6d66ec91cb139c4b311bfa7ba13e9e1
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sat Nov 30 09:50:36 2019 +0100

    jewel-buttonbar: improve styles
---
 .../src/main/royale/ButtonBarPlayGround.mxml         |  2 +-
 .../projects/Jewel/src/main/resources/defaults.css   |  4 ++++
 .../jewel/itemRenderers/ButtonBarItemRenderer.as     | 20 +++++++++++++++++---
 .../Jewel/src/main/sass/components/_buttonbar.sass   |  4 +++-
 4 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
index 5349a5a..d546be6 100644
--- a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
@@ -30,7 +30,7 @@ limitations under the License.
 			public var two_options:Array = ["Features", "Support"];
 			
 			[Bindable]
-			public var three_options:Array = ["Features", "Support", "Service & Operations"];
+			public var three_options:Array = ["Features", "Support", "Service & Operations", "four"];
 		]]>
 	</fx:Script>
 
diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index dcc84bc..fc8aede 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -260,6 +260,10 @@ j|Alert {
     IBeadView: ClassReference("org.apache.royale.jewel.beads.views.ButtonView");
   }
 }
+.jewel.buttonbar .jewel.button {
+  border-radius: 0;
+}
+
 j|ButtonBar {
   IBeadModel: ClassReference("org.apache.royale.html.beads.models.ButtonBarModel");
   IBeadView: ClassReference("org.apache.royale.jewel.beads.views.ButtonBarView");
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
index 5d4ebcb..7d5decd 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
@@ -31,6 +31,7 @@ package org.apache.royale.jewel.itemRenderers
 	import org.apache.royale.jewel.Button;
 	import org.apache.royale.jewel.ButtonBar;
 	import org.apache.royale.jewel.beads.views.ButtonBarView;
+	import org.apache.royale.core.IItemRendererParent;
 
 	/**
 	 * The ButtonBarItemRenderer class extends Button and turns it into an itemRenderer
@@ -74,9 +75,6 @@ package org.apache.royale.jewel.itemRenderers
 			_data = value;
 
 			updateButtonLabelFromData();
-
-			var buttonBar:ButtonBar = (itemRendererParent as ButtonBarView).buttonBar;
-			emphasis = buttonBar.emphasis;
 		}
 
 		/**
@@ -129,6 +127,9 @@ package org.apache.royale.jewel.itemRenderers
 		public function set itemRendererParent(value:Object):void
 		{
 			_itemRendererParent = value;
+
+			var buttonBar:ButtonBar = (itemRendererParent as ButtonBarView).buttonBar;
+			emphasis = buttonBar.emphasis;
 		}
 
 		private var _labelField:String = null;
@@ -191,6 +192,19 @@ package org.apache.royale.jewel.itemRenderers
 		public function set index(value:int):void
 		{
 			_index = value;
+
+			if(_index == 0)
+			{
+				addClass("first");
+			} 
+			else if( _index == ( itemRendererParent as IItemRendererParent).numItemRenderers - 1 )
+			{
+				addClass("last");
+			}
+			else
+			{
+				addClass("middle");
+			}
 		}
 
 		private var _selectable:Boolean = true;
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
index 7497aaa..c5dd0d5 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
@@ -20,7 +20,9 @@
 // Jewel ButtonBar
 
 // ButtonVar variables
-jewel.buttonbar
+.jewel.buttonbar
+    .jewel.button
+        border-radius: 0
     
 
 j|ButtonBar


[royale-asjs] 42/42: jewel-examples: upgrade tour de jewel for the changes in ButtonBar and DataGrid

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 6270a038ecf8edc97d2fb4e8edbde7decd10c283
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Dec 13 00:29:33 2019 +0100

    jewel-examples: upgrade tour de jewel for the changes in ButtonBar and DataGrid
---
 .../src/main/royale/ButtonBarPlayGround.mxml           | 13 +++++++++----
 .../src/main/royale/DataGridPlayGround.mxml            | 18 +++---------------
 .../TourDeJewel/src/main/royale/models/ListsModel.as   | 17 +++++++++++++++++
 3 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
index 2f149a1..09a9bb1 100644
--- a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
@@ -76,7 +76,7 @@ limitations under the License.
 				<j:ButtonBar localId="bb3" change="bb2_label.text = bb3.selectedItem as String"
 					emphasis="primary">
 					<j:beads>
-						<j:ButtonBarLayout proportionalWidths="true"/>
+						<j:ButtonBarLayout/>
 					</j:beads>
 					<j:dataProvider>
 						<js:ArrayList source="[Home, Support, Operations, Service]" />
@@ -88,15 +88,20 @@ limitations under the License.
 				<j:ButtonBar localId="bb4" change="bb2_label.text = bb4.selectedItem as String"
 					emphasis="secondary" width="100%">
 					<j:beads>
-						<j:ButtonBarLayout localId="ppw" proportionalWidths="true" gap="3"/>
+						<j:ButtonBarLayout localId="ppw" gap="3"/>
 					</j:beads>
 					<j:dataProvider>
 						<js:ArrayList source="[Home, Support, Operations, Service]" />
 					</j:dataProvider>
 				</j:ButtonBar>
 
-				<j:CheckBox change="ppw.proportionalWidths = !ppw.proportionalWidths" selected="true"
-					text="Proportional Widths (true) / Same Widths (false)"/>
+				<j:DropDownList dataProvider="{listModel.bblayout_options}"
+					labelField="label" selectedIndex="2" width="230"
+					change="ppw.widthType = event.target.selectedItem.value">
+					<j:beads>
+						<j:RequireSelection requireSelection="true"/> 
+					</j:beads>
+				</j:DropDownList>
 
 				<j:Label localId="bb2_label"/>
 			</j:Card>
diff --git a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
index 230cb0e..e8e4ef5 100644
--- a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
@@ -54,7 +54,7 @@ limitations under the License.
 			<j:Card>
 				<html:H3 text="Jewel DataGrid"/>
 				
-				<j:Label text="Basic configuration with no column widths"/>
+				<j:Label text="Basic configuration, width = 100%, no column widths"/>
 
 				<j:DataGrid localId="datagrid" width="100%" height="100%" 
 					change="dataGridChange(event.target as DataGrid, datagrid_lb)">
@@ -73,7 +73,7 @@ limitations under the License.
 				</j:DataGrid>
 
 				<j:Label id="datagrid_lb" text="DagaGrid selection will be shown here"/>
-				<j:Button text="Refresh Grid" click="refreshGrid(datagrid)" emphasis="primary"/>
+				<!-- <j:Button text="Refresh Grid" click="refreshGrid(datagrid)" emphasis="primary"/> -->
 			</j:Card>
 		</j:GridCell>
 		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
@@ -82,7 +82,7 @@ limitations under the License.
 				
 				<j:Label text="Using specific column widths"/>
 
-				<j:DataGrid localId="datagrid2" width="100%" height="100%" 
+				<j:DataGrid localId="datagrid2" width="100%" height="100%"
 					rowHeight="40" emphasis="primary" 
 					change="dataGridChange(event.target as DataGrid, datagrid2_lb)"
 					dataProvider="{productModel.productList}">
@@ -99,17 +99,5 @@ limitations under the License.
 			</j:Card>
 		</j:GridCell>
 	</j:Grid>
-
-	<fx:Style>
-		@namespace j "library://ns.apache.org/royale/jewel";
-		
-		/* Allows the DataGrid to be specified with percentage widths for the columns (rather
-		 * than pixel widths) and does not respond to changes to its dataProvider.
-		 */
-		/* .PercentageColumnWidths {
-			IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.DataGridPercentageLayout");
-			border: 1px solid #ACACAC;
-		} */
-	</fx:Style>
 	
 </c:ExampleAndSourceCodeTabbedSectionContent>
diff --git a/examples/royale/TourDeJewel/src/main/royale/models/ListsModel.as b/examples/royale/TourDeJewel/src/main/royale/models/ListsModel.as
index dcc8649..a3f726d 100644
--- a/examples/royale/TourDeJewel/src/main/royale/models/ListsModel.as
+++ b/examples/royale/TourDeJewel/src/main/royale/models/ListsModel.as
@@ -133,5 +133,22 @@ package models
 		{
 			return _iconLDetailistDataSource.slice();
 		}
+
+
+		/**
+		 * Used in the ButtonBar example. Commented options need to be implemented
+		 */
+		private var _bblayout_options:ArrayList = new ArrayList([
+			{label: "PIXEL_WIDTHS", value: 0},
+			// {label: "PROPORTIONAL_WIDTHS", value: 1},
+			{label: "PERCENT_WIDTHS", value: 2},
+			// {label: "NATURAL_WIDTHS", value: 3},
+			{label: "SAME_WIDTHS", value: NaN}
+		]);
+		
+		public function get bblayout_options():ArrayList
+		{
+			return _bblayout_options;
+		}
 	}
 }


[royale-asjs] 40/42: jewel-datagrid: clean and redo some parts in datagrid to support changes in buttonbar

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 445879550aaad3ac7ec0998c1bf569d97622545d
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Dec 13 00:27:58 2019 +0100

    jewel-datagrid: clean and redo some parts in datagrid to support changes in buttonbar
---
 .../royale/jewel/beads/layouts/DataGridLayout.as   |  21 +--
 .../royale/jewel/beads/views/DataGridView.as       | 146 ++++++++++-----------
 .../supportClasses/datagrid/DataGridListArea.as    |   5 +-
 .../Jewel/src/main/sass/components/_datagrid.sass  |  65 ++-------
 4 files changed, 96 insertions(+), 141 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
index 8dff87f..bec60ca 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/DataGridLayout.as
@@ -20,13 +20,10 @@ package org.apache.royale.jewel.beads.layouts
 {	
     import org.apache.royale.collections.ArrayList;
     import org.apache.royale.core.IBeadLayout;
-    import org.apache.royale.core.IBorderPaddingMarginValuesImpl;
     import org.apache.royale.core.IDataGridModel;
     import org.apache.royale.core.IStrand;
     import org.apache.royale.core.IUIBase;
     import org.apache.royale.core.UIBase;
-    import org.apache.royale.core.ValuesManager;
-    import org.apache.royale.core.layout.EdgeData;
     import org.apache.royale.events.Event;
     import org.apache.royale.events.IEventDispatcher;
     import org.apache.royale.html.beads.IDataGridView;
@@ -113,24 +110,26 @@ package org.apache.royale.jewel.beads.layouts
             // in the bbmodel, so do all layout based on the bbmodel, not the set
             // of columns that may contain invisible columns
             var bbmodel:ButtonBarModel = header.getBeadByType(ButtonBarModel) as ButtonBarModel;
+            var bblayout:ButtonBarLayout = header.getBeadByType(ButtonBarLayout) as ButtonBarLayout;
+			// (header as ButtonBar).widthType = ButtonBarModel.PROPORTIONAL_WIDTHS;
 			var listArea:IUIBase = (uiHost.view as IDataGridView).listArea;
 			
 			var displayedColumns:Array = (uiHost.view as IDataGridView).columnLists;
 			var model:IDataGridModel = uiHost.model as IDataGridModel;
 			
-			var borderMetrics:EdgeData = (ValuesManager.valuesImpl as IBorderPaddingMarginValuesImpl).getBorderMetrics(_strand as IUIBase);			
-			var useWidth:Number = uiHost.width - (borderMetrics.left + borderMetrics.right);
-			
-			var defaultColumnWidth:Number = (useWidth) / bbmodel.dataProvider.length;
+			var defaultColumnWidth:Number = (uiHost.percentWidth) / bbmodel.dataProvider.length;
 			var columnWidths:Array = [];
 			
 			for(var i:int=0; i < bbmodel.dataProvider.length; i++) {
 				var columnDef:IDataGridColumn = (bbmodel.dataProvider as ArrayList).getItemAt(i) as IDataGridColumn;
 				var columnList:UIBase = displayedColumns[i] as UIBase;
 				
+				//temporal- if only 1 isNaN(columnDef.columnWidth) make it true so widthType = ButtonBarModel.PIXEL_WIDTHS
+				var pixelflag:Boolean = false;
 				var columnWidth:Number = defaultColumnWidth;
 				if (!isNaN(columnDef.columnWidth)) {
 					columnWidth = columnDef.columnWidth;
+					pixelflag = true;
 				}
 				
 				columnList.width = columnWidth;
@@ -138,6 +137,12 @@ package org.apache.royale.jewel.beads.layouts
 			}
 			
 			bbmodel.buttonWidths = columnWidths;
+			if(pixelflag)
+			{
+				// bbmodel.widthType = ButtonBarModel.PIXEL_WIDTHS;
+				bblayout.widthType = ButtonBarModel.PIXEL_WIDTHS;
+				// bblayout.layout();
+			}
 			
 			header.dispatchEvent(new Event("layoutNeeded"));
 			listArea.dispatchEvent(new Event("layoutNeeded"));
@@ -145,4 +150,4 @@ package org.apache.royale.jewel.beads.layouts
 			return true;
 		}
 	}
-}
+}
\ No newline at end of file
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
index 93cffd8..15874af 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DataGridView.as
@@ -25,26 +25,29 @@ package org.apache.royale.jewel.beads.views
 	import org.apache.royale.core.IChild;
 	import org.apache.royale.core.IDataGridModel;
 	import org.apache.royale.core.IDataGridPresentationModel;
-	import org.apache.royale.core.ILayoutChild;
 	import org.apache.royale.core.IParent;
+	import org.apache.royale.core.IStrand;
 	import org.apache.royale.core.IUIBase;
 	import org.apache.royale.core.ValuesManager;
-	import org.apache.royale.debugging.assert;
 	import org.apache.royale.events.Event;
 	import org.apache.royale.events.IEventDispatcher;
 	import org.apache.royale.html.beads.GroupView;
 	import org.apache.royale.html.beads.IDataGridView;
-	import org.apache.royale.html.beads.layouts.ButtonBarLayout;
+	import org.apache.royale.jewel.beads.layouts.ButtonBarLayout;
 	import org.apache.royale.jewel.supportClasses.Viewport;
 	import org.apache.royale.jewel.supportClasses.datagrid.DataGridButtonBar;
 	import org.apache.royale.jewel.supportClasses.datagrid.IDataGrid;
 	import org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumn;
 	import org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumnList;
-
+	import org.apache.royale.core.UIBase;
+    
     /**
      *  The DataGridView class is the visual bead for the org.apache.royale.jewel.DataGrid.
      *  This class constructs the items that make the DataGrid: Lists for each column and a
      *  org.apache.royale.jewel.ButtonBar for the column headers.
+     * 
+     *  Columns without specific columnWidths gets 1/n of the maximun space available where n is the
+     *  number of columns.
      *
      *  @viewbead
      *  @langversion 3.0
@@ -67,11 +70,60 @@ package org.apache.royale.jewel.beads.views
             super();
         }
 
+        private var _dg:IDataGrid = _strand as IDataGrid;
+        private var _sharedModel:IDataGridModel;
         private var _header:DataGridButtonBar;
         private var _listArea:IUIBase;
-
         private var _lists:Array;
 
+        COMPILE::JS
+        private var rq:int;
+        
+        override public function set strand(value:IStrand):void
+		{
+			super.strand = value;
+
+            _dg = _strand as IDataGrid;
+            _dg.addEventListener("widthChanged", handleSizeChanges);
+            _dg.addEventListener("heightChanged", handleSizeChanges);
+            
+            // see if there is a presentation model already in place. if not, add one.
+            _sharedModel = _dg.model as IDataGridModel;
+            IEventDispatcher(_sharedModel).addEventListener("dataProviderChanged", handleDataProviderChanged);
+            IEventDispatcher(_sharedModel).addEventListener("selectedIndexChanged", handleSelectedIndexChanged);
+
+            createChildren();
+		}
+
+        /**
+		 * @private
+		 */
+		private function createChildren():void
+		{
+            // header
+            var headerClass:Class = ValuesManager.valuesImpl.getValue(host, "headerClass") as Class;
+            _header = new headerClass() as DataGridButtonBar;
+            _header.dataProvider = new ArrayList(_sharedModel.columns);
+            _header.emphasis = _dg.emphasis;
+            _header.labelField = "label";
+            var headerLayoutClass:Class = ValuesManager.valuesImpl.getValue(host, "headerLayoutClass") as Class;
+            var bblayout:ButtonBarLayout = new headerLayoutClass() as ButtonBarLayout;
+            _header.addBead(bblayout as IBead);
+            _header.addBead(new Viewport() as IBead);
+            _sharedModel.headerModel = _header.model as IBeadModel;
+            _dg.strandChildren.addElement(_header as IChild);
+
+            // columns
+            var listAreaClass:Class = ValuesManager.valuesImpl.getValue(host, "listAreaClass") as Class;
+            _listArea = new listAreaClass() as IUIBase;
+            _dg.strandChildren.addElement(_listArea as IChild);
+
+            if (_sharedModel.columns)
+                createLists();
+            
+            handleDataProviderChanged(null);
+        }
+
         /**
          * An array of List objects the comprise the columns of the DataGrid.
          */
@@ -82,7 +134,6 @@ package org.apache.royale.jewel.beads.views
 
         /**
          * The area used to hold the columns
-         *
          */
         public function get listArea():IUIBase
         {
@@ -97,63 +148,19 @@ package org.apache.royale.jewel.beads.views
             return _header;
         }
 
-        // public function refreshContent():void
-        // {
-        //     handleInitComplete(null);
-        // }
-
         /**
          * @private
          * @royaleignorecoercion org.apache.royale.core.IDataGridModel
          * @royaleignorecoercion org.apache.royale.core.IBead
          * @royaleignorecoercion org.apache.royale.core.IBeadModel
          * @royaleignorecoercion org.apache.royale.core.IChild
-         * @royaleignorecoercion org.apache.royale.core.ILayoutChild
          * @royaleignorecoercion org.apache.royale.core.IUIBase
          * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
          */
         override protected function handleInitComplete(event:Event):void
         {
-            var host:IDataGrid = _strand as IDataGrid;
-
-            // see if there is a presentation model already in place. if not, add one.
-            var sharedModel:IDataGridModel = host.model as IDataGridModel;
-            IEventDispatcher(sharedModel).addEventListener("dataProviderChanged", handleDataProviderChanged);
-            IEventDispatcher(sharedModel).addEventListener("selectedIndexChanged", handleSelectedIndexChanged);
-
-            var columnContainerClass:Class = ValuesManager.valuesImpl.getValue(host, "columnContainerClass") as Class;
-            assert(columnContainerClass != null,"columnContainerClass for DataGrid must be set!")
-            _header = new columnContainerClass() as DataGridButtonBar;
-            // header's height is set in CSS
-            _header.percentWidth = 100;
-            _header.dataProvider = new ArrayList(sharedModel.columns);
-            _header.emphasis = host.emphasis;
-            _header.labelField = "label";
-            sharedModel.headerModel = _header.model as IBeadModel;
-
-            var listAreaClass:Class = ValuesManager.valuesImpl.getValue(host, "listAreaClass") as Class;
-            assert(listAreaClass != null,"listAreaClass for DataGrid must be set!")
-            _listArea = new listAreaClass() as IUIBase;
-            (_listArea as ILayoutChild).percentWidth = 100;
-
-            if (sharedModel.columns)
-                createLists();
-
-            var columnLayoutClass:Class = ValuesManager.valuesImpl.getValue(host, "columnLayoutClass") as Class;
-            assert(columnLayoutClass != null,"columnLayoutClass for DataGrid must be set!")
-            var bblayout:ButtonBarLayout = new columnLayoutClass() as ButtonBarLayout;
-            _header.addBead(bblayout as IBead);
-            _header.addBead(new Viewport() as IBead);
-            host.strandChildren.addElement(_header as IChild);
-
-            host.strandChildren.addElement(_listArea as IChild);
-
-            handleDataProviderChanged(event);
-
-            host.addEventListener("widthChanged", handleSizeChanges);
-            host.addEventListener("heightChanged", handleSizeChanges);
-
-            host.dispatchEvent(new Event("dataGridViewCreated"));
+            // _header.dispatchEvent(new Event("layoutNeeded"));
+            // _listArea.dispatchEvent(new Event("layoutNeeded"));
         }
 
         /**
@@ -161,8 +168,8 @@ package org.apache.royale.jewel.beads.views
          */
         private function handleSizeChanges(event:Event):void
         {
-            _header.dispatchEvent(new Event("layoutChanged"));
-            _listArea.dispatchEvent(new Event("layoutChanged"));
+            _header.dispatchEvent(new Event("layoutNeeded"));
+            _listArea.dispatchEvent(new Event("layoutNeeded"));
         }
 
         /**
@@ -172,11 +179,10 @@ package org.apache.royale.jewel.beads.views
          */
         protected function handleDataProviderChanged(event:Event):void
         {
-            var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
             for (var i:int=0; i < _lists.length; i++)
             {
                 var list:IDataGridColumnList = _lists[i] as IDataGridColumnList;
-                list.dataProvider = sharedModel.dataProvider;
+                list.dataProvider = _sharedModel.dataProvider;
             }
             host.dispatchEvent(new Event("layoutNeeded"));
         }
@@ -188,8 +194,7 @@ package org.apache.royale.jewel.beads.views
          */
         private function handleSelectedIndexChanged(event:Event):void
         {
-            var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
-            var newIndex:int = sharedModel.selectedIndex;
+            var newIndex:int = _sharedModel.selectedIndex;
 
             for (var i:int=0; i < _lists.length; i++)
             {
@@ -205,9 +210,8 @@ package org.apache.royale.jewel.beads.views
          */
         private function handleColumnListChange(event:Event):void
         {
-            var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
             var list:IDataGridColumnList = event.target as IDataGridColumnList;
-            sharedModel.selectedIndex = list.selectedIndex;
+            _sharedModel.selectedIndex = list.selectedIndex;
 
             for(var i:int=0; i < _lists.length; i++) {
                 if (list != _lists[i]) {
@@ -225,9 +229,8 @@ package org.apache.royale.jewel.beads.views
          */
         private function handleColumnListRollOverChange(event:Event):void
         {
-            var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
             var list:IDataGridColumnList = event.target as IDataGridColumnList;
-            sharedModel.rollOverIndex = list.rollOverIndex;
+            _sharedModel.rollOverIndex = list.rollOverIndex;
 
             for(var i:int=0; i < _lists.length; i++) {
                 if (list != _lists[i]) {
@@ -252,20 +255,15 @@ package org.apache.royale.jewel.beads.views
          */
         protected function createLists():void
         {
-            var host:IDataGrid = _strand as IDataGrid;
-            
             // get the name of the class to use for the columns
             var columnClass:Class = ValuesManager.valuesImpl.getValue(host, "columnClass") as Class;
-            assert(columnClass != null, "ColumnClass for DataGrid must be set!")
-
-            var sharedModel:IDataGridModel = host.model as IDataGridModel;
-            var presentationModel:IDataGridPresentationModel = host.presentationModel as IDataGridPresentationModel;
+            var presentationModel:IDataGridPresentationModel = _dg.presentationModel as IDataGridPresentationModel;
 
             _lists = [];
 
-            for (var i:int=0; i < sharedModel.columns.length; i++)
+            for (var i:int=0; i < _sharedModel.columns.length; i++)
             {
-                var dataGridColumn:IDataGridColumn = sharedModel.columns[i] as IDataGridColumn;
+                var dataGridColumn:IDataGridColumn = _sharedModel.columns[i] as IDataGridColumn;
 
                 var list:IDataGridColumnList = new columnClass();
                 
@@ -273,7 +271,7 @@ package org.apache.royale.jewel.beads.views
                 {
                     list.className = "first";
                 }
-                else if (i == sharedModel.columns.length-1)
+                else if (i == _sharedModel.columns.length-1)
                 {
                     list.className = "last";
                 }
@@ -282,8 +280,8 @@ package org.apache.royale.jewel.beads.views
                     list.className = "middle";
                 }
                 
-                list.id = "dataGridColumn" + i;
-                list.dataProvider = sharedModel.dataProvider;
+                // by default make columns get the 1/n of the maximun space available
+                (list as UIBase).percentWidth = 100 / _sharedModel.columns.length;
                 list.itemRenderer = dataGridColumn.itemRenderer;
                 list.labelField = dataGridColumn.dataField;
                 list.addEventListener('rollOverIndexChanged', handleColumnListRollOverChange);
@@ -293,8 +291,6 @@ package org.apache.royale.jewel.beads.views
                 (_listArea as IParent).addElement(list as IChild);
                 _lists.push(list);
             }
-
-            host.dispatchEvent(new Event("layoutNeeded"));
         }
     }
 }
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridListArea.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridListArea.as
index 38bd6d8..c818bca 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridListArea.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/DataGridListArea.as
@@ -26,10 +26,7 @@ package org.apache.royale.jewel.supportClasses.datagrid
         {
             super();
 
-            // COMPILE::JS
-			// {
-			// 	typeNames = 'jewel dataGridListArea';
-			// }
+			typeNames = 'listarea';
         }
     }
 }
\ No newline at end of file
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
index 6af0bc2..f3215d2 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
@@ -26,12 +26,17 @@ $border-radius: .25rem
     height: 290px
 
     .jewel.buttonbar.header
+        width: 100%
+
         .jewel.button
             &.first
                 border-bottom-left-radius: 0
 
             &.last
                 border-bottom-right-radius: 0
+    
+    .listarea
+        width: 100%
 
     .jewel.list.column
         border-radius: 0px
@@ -54,36 +59,20 @@ j|DataGrid
     IBeadView: ClassReference("org.apache.royale.jewel.beads.views.DataGridView")
     IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel")
     IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.DataGridLayout")
-    columnClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList")
-    columnContainerClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridButtonBar")
-    columnLayoutClass: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout")
+    headerClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridButtonBar")
+    headerLayoutClass: ClassReference("org.apache.royale.jewel.beads.layouts.ButtonBarLayout")
     listAreaClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridListArea")
+    columnClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList")
 
 j|DataGridListArea
     IBeadView: ClassReference("org.apache.royale.html.beads.ContainerView")
     IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.HorizontalLayout")
     IViewport: ClassReference("org.apache.royale.jewel.supportClasses.scrollbar.ScrollingViewport")
     IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
-//align-items: flex-start
-// DataGridListArea {
-// background-color: #FFFFFF
-// IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.HorizontalLayout")
-// IViewport: ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport")
-// IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
-// flex-grow: 1
-// }
-
-// j|DataGridColumnList
-//     IBeadView:  ClassReference("org.apache.royale.html.beads.ListView")			
-//     IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController")
-//     IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.VerticalLayout")
-//     IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory")
-//     IItemRenderer: ClassReference("org.apache.royale.html.supportClasses.StringItemRenderer")
-//     IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridModel")
-//     IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.DataItemRendererFactoryForArrayData")
-//     IViewport: ClassReference("org.apache.royale.html.supportClasses.Viewport")
-//     IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
 
+//Nothing to change from j|ButtonBar
+j|DataGridButtonBar
+// flex-grow: 1
 
 // DynamicDataGrid {
 // IChangePropagator: ClassReference("org.apache.royale.html.beads.DataGridColumnChangePropagator")
@@ -97,38 +86,6 @@ j|DataGridListArea
 // border: 1px solid #222222
 // }
 
-// DataGridButtonBar
-// {
-// IBeadModel: ClassReference("org.apache.royale.html.beads.models.ButtonBarModel")
-// IBeadView:  ClassReference("org.apache.royale.html.beads.ButtonBarView")			
-// IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController")
-// IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout")
-// IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.TextItemRendererFactoryForArrayData")
-// IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory")
-// IItemRenderer: ClassReference("org.apache.royale.html.supportClasses.TextButtonItemRenderer")
-
-// border-style: none
-// height: 40px
-// min-height: 40px
-// flex-grow: 0
-// }
-
-// DataGridColumnList {
-// IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridModel")
-// IBeadView:  ClassReference("org.apache.royale.html.beads.ListView")			
-// IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController")
-// IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.VerticalLayout")
-// IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.DataItemRendererFactoryForArrayData")
-// IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory")
-// IItemRenderer: ClassReference("org.apache.royale.html.supportClasses.StringItemRenderer")
-// IViewport: ClassReference("org.apache.royale.html.supportClasses.Viewport")
-// IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
-// border-style: none
-// background-color: #FFFFFF
-// }
-
-
-
 // DynamicDataGridColumnList {
 // IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel")
 // IBeadView:  ClassReference("org.apache.royale.html.beads.ListView")			


[royale-asjs] 12/42: jewel-buttonbar: starting example in Tour de Jewel

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 46178d841f62e36f96a23f5b860edff1aaf65af5
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Thu Nov 28 18:37:02 2019 +0100

    jewel-buttonbar: starting example in Tour de Jewel
---
 .../src/main/royale/ButtonBarPlayGround.mxml       | 77 ++++++++++++++++++++++
 .../TourDeJewel/src/main/royale/MainContent.mxml   |  1 +
 .../src/main/royale/models/MainNavigationModel.as  |  1 +
 3 files changed, 79 insertions(+)

diff --git a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
new file mode 100644
index 0000000..2a6047a
--- /dev/null
+++ b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
@@ -0,0 +1,77 @@
+<?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.
+
+-->
+<c:ExampleAndSourceCodeTabbedSectionContent xmlns:fx="http://ns.adobe.com/mxml/2009" 
+	xmlns:j="library://ns.apache.org/royale/jewel" 
+	xmlns:html="library://ns.apache.org/royale/html" 
+	xmlns:js="library://ns.apache.org/royale/basic"
+	xmlns:models="models.*" 
+	xmlns:c="components.*" sourceCodeUrl="ButtonBarPlayGround.mxml">
+	
+	<fx:Script>
+		<![CDATA[
+			[Bindable]
+			public var two_options:Array = ["Features", "Support"];
+			
+			[Bindable]
+			public var three_options:Array = ["Features", "Support", "Service & Operations"];
+		]]>
+	</fx:Script>
+
+	<c:beads>
+		<js:ContainerDataBinding/>
+	</c:beads>
+
+	<j:Grid gap="true" itemsVerticalAlign="itemsSameHeight">
+		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
+			<j:Card>
+				<html:H3 text="Jewel ButtonBar"/>
+
+				<j:ButtonBar localId="bb1" change="bb1_label.text = bb1.selectedItem as String"
+					dataProvider="{two_options}">
+					<!-- <j:dataProvider>
+						<fx:Array>
+							<fx:String>Features</fx:String>
+							<fx:String>Support</fx:String>
+						</fx:Array>
+					</j:dataProvider> -->
+				</j:ButtonBar>
+				<j:Label localId="bb1_label"/>
+			</j:Card>
+		</j:GridCell>
+		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
+			<j:Card>
+				<html:H4 text="ButtonBar"/>
+
+				<j:ButtonBar localId="bb2" change="bb2_label.text = bb2.selectedItem as String"
+					dataProvider="{three_options}">
+					<!-- <js:dataProvider>
+						<fx:Array>
+							<fx:String>Features</fx:String>
+							<fx:String>Support</fx:String>
+							<fx:String>Control</fx:String>
+						</fx:Array>
+					</js:dataProvider> -->
+				</j:ButtonBar>
+				<j:Label localId="bb2_label"/>
+			</j:Card>
+		</j:GridCell>
+	</j:Grid>
+	
+</c:ExampleAndSourceCodeTabbedSectionContent>
diff --git a/examples/royale/TourDeJewel/src/main/royale/MainContent.mxml b/examples/royale/TourDeJewel/src/main/royale/MainContent.mxml
index 60c6257..accb213 100644
--- a/examples/royale/TourDeJewel/src/main/royale/MainContent.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/MainContent.mxml
@@ -248,6 +248,7 @@ limitations under the License.
         <local:TextInputPlayGround name="textinput_panel"/>
         <local:GridPlayGround name="grid_panel"/>
         <local:CardPlayGround name="card_panel"/>
+        <local:ButtonBarPlayGround name="buttonbar_panel"/>
         <local:DataGridPlayGround name="datagrid_panel"/>
         <local:TablePlayGround name="tables_panel"/>
         <local:FormsValidationPlayGround name="form_validation_panel"/>
diff --git a/examples/royale/TourDeJewel/src/main/royale/models/MainNavigationModel.as b/examples/royale/TourDeJewel/src/main/royale/models/MainNavigationModel.as
index 17a681f..ac2caa2 100644
--- a/examples/royale/TourDeJewel/src/main/royale/models/MainNavigationModel.as
+++ b/examples/royale/TourDeJewel/src/main/royale/models/MainNavigationModel.as
@@ -56,6 +56,7 @@ package models
             new NavigationLinkVO("Card", "card_panel", MaterialIconType.WEB_ASSET),
             new NavigationLinkVO("Layouts", "layouts_panel", MaterialIconType.VIEW_QUILT),
             new NavigationLinkVO("Grid", "grid_panel", MaterialIconType.GRID_ON),
+            new NavigationLinkVO("ButtonBar", "buttonbar_panel", MaterialIconType.VIEW_CAROUSEL),
             new NavigationLinkVO("DataGrid", "datagrid_panel", MaterialIconType.VIEW_LIST),
             new NavigationLinkVO("Tables", "tables_panel", MaterialIconType.VIEW_COMFY),
             new NavigationLinkVO("TabBar", "tabbar_panel", MaterialIconType.TAB),


[royale-asjs] 08/42: jewel-buttonbar: Initial implementation of Jewel ButtonBar

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 3475c601f04703aa2609d69f5c1827de54bec813
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Nov 27 18:19:17 2019 +0100

    jewel-buttonbar: Initial implementation of Jewel ButtonBar
---
 .../projects/Jewel/src/main/resources/defaults.css |  15 ++
 .../Jewel/src/main/resources/jewel-manifest.xml    |   2 +
 .../projects/Jewel/src/main/royale/JewelClasses.as |   1 +
 .../royale/org/apache/royale/jewel/ButtonBar.as    | 115 ++++++++
 .../royale/jewel/beads/views/ButtonBarView.as      |  61 +++++
 .../jewel/itemRenderers/ButtonBarItemRenderer.as   | 291 +++++++++++++++++++++
 .../Jewel/src/main/sass/components/_buttonbar.sass |  37 +++
 .../projects/Jewel/src/main/sass/defaults.sass     |   1 +
 8 files changed, 523 insertions(+)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 4fbf413..192f5ea 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -260,6 +260,21 @@ j|Alert {
     IBeadView: ClassReference("org.apache.royale.jewel.beads.views.ButtonView");
   }
 }
+j|ButtonBar {
+  IBeadModel: ClassReference("org.apache.royale.html.beads.models.ButtonBarModel");
+  IBeadView: ClassReference("org.apache.royale.jewel.beads.views.ButtonBarView");
+  IBeadController: ClassReference("org.apache.royale.jewel.beads.controllers.ListSingleSelectionMouseController");
+  IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout");
+  IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.TextItemRendererFactoryForArrayData");
+  IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory");
+  IItemRenderer: ClassReference("org.apache.royale.jewel.itemRenderers.ButtonBarItemRenderer");
+}
+
+@media -royale-swf {
+  j|ButtonBar {
+    IContentView: ClassReference("org.apache.royale.jewel.supportClasses.list.DataGroup");
+  }
+}
 .jewel.card {
   min-width: 240px;
   min-height: 52px;
diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index 4ccb8df..aecc645 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -46,6 +46,7 @@
     <component id="DataGrid" class="org.apache.royale.jewel.DataGrid"/>
     <component id="DataGridColumn" class="org.apache.royale.jewel.supportClasses.datagrid.DataGridColumn"/>
     <component id="DataGridListArea" class="org.apache.royale.jewel.supportClasses.datagrid.DataGridListArea"/>
+    <component id="ButtonBarItemRenderer" class="org.apache.royale.jewel.itemRenderers.ButtonBarItemRenderer"/>
 
     <component id="SimpleButton" class="org.apache.royale.jewel.supportClasses.button.SimpleButton"/>
     <component id="Button" class="org.apache.royale.jewel.Button"/>
@@ -97,6 +98,7 @@
     
     <component id="HorizontalListScroll" class="org.apache.royale.jewel.beads.controls.list.HorizontalListScroll"/>
 
+    <component id="ButtonBar" class="org.apache.royale.jewel.ButtonBar"/>
     <component id="TabBar" class="org.apache.royale.jewel.TabBar"/>
     <component id="TabBarButtonItemRenderer" class="org.apache.royale.jewel.itemRenderers.TabBarButtonItemRenderer"/>
     <component id="TabBarButtonInidicatorRestrictedToContentItemRenderer" class="org.apache.royale.jewel.itemRenderers.TabBarButtonInidicatorRestrictedToContentItemRenderer"/>
diff --git a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
index e27ee9b..97d0a07 100644
--- a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
+++ b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
@@ -79,6 +79,7 @@ package
         import org.apache.royale.jewel.beads.views.FormItemView; FormItemView;
         import org.apache.royale.jewel.beads.views.FormHeadingView; FormHeadingView;
         import org.apache.royale.jewel.beads.views.WizardView; WizardView;
+        import org.apache.royale.jewel.beads.views.ButtonBarView; ButtonBarView;
 
         COMPILE::SWF
 	    {
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as
new file mode 100644
index 0000000..20bdbb7
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as
@@ -0,0 +1,115 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel
+{
+	import org.apache.royale.html.beads.models.ButtonBarModel;
+	
+    COMPILE::JS
+    {
+    import org.apache.royale.core.WrappedHTMLElement;
+    import org.apache.royale.html.util.addElementToWrapper;
+    }
+
+	/**
+	 *  The ButtonBar class is a component that displays a set of Buttons. The ButtonBar
+	 *  is actually a List with a default horizontal layout and an itemRenderer that
+	 *  produces Buttons. The ButtonBar uses the following beads:
+	 *
+	 *  org.apache.royale.core.IBeadModel: the data model for the ButtonBar, including the dataProvider.
+	 *  org.apache.royale.core.IBeadView: constructs the parts of the component.
+	 *  org.apache.royale.core.IBeadController: handles input events.
+	 *  org.apache.royale.core.IBeadLayout: sizes and positions the component parts.
+	 *  org.apache.royale.core.IDataProviderItemRendererMapper: produces itemRenderers.
+	 *  org.apache.royale.core.IItemRenderer: the class or class factory to use.
+	 *
+     *  @toplevel
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9.7
+	 */
+	public class ButtonBar extends List
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function ButtonBar()
+		{
+			super();
+
+            typeNames = "jewel buttonbar";
+		}
+		
+		/**
+		 *  @see org.apache.royale.html.beads.models.ButtonBarModel#buttonWidths
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 *  @royaleignorecoercion org.apache.royale.html.beads.models.ButtonBarModel
+		 */
+		public function get buttonWidths():Array
+		{
+			return ButtonBarModel(model).buttonWidths;
+		}
+		/**
+		 * @royaleignorecoercion org.apache.royale.html.beads.models.ButtonBarModel
+		 */
+		public function set buttonWidths(value:Array):void
+		{
+			ButtonBarModel(model).buttonWidths = value;
+		}
+		
+		/**
+		 *  @see org.apache.royale.html.beads.models.ButtonBarModel#widthType
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 *  @royaleignorecoercion org.apache.royale.html.beads.models.ButtonBarModel
+		 */
+		public function get widthType():Number
+		{
+			return ButtonBarModel(model).widthType;
+		}
+		/**
+		 * @royaleignorecoercion org.apache.royale.html.beads.models.ButtonBarModel
+		 */
+		public function set widthType(value:Number):void
+		{
+			ButtonBarModel(model).widthType = value;
+		}
+
+        /**
+         * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
+         */
+        COMPILE::JS
+        override protected function createElement():WrappedHTMLElement
+        {
+			return addElementToWrapper(this,'div');
+        }
+	}
+}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ButtonBarView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ButtonBarView.as
new file mode 100644
index 0000000..1414f76
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ButtonBarView.as
@@ -0,0 +1,61 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.beads.views
+{
+	import org.apache.royale.core.IStrand;
+
+	/**
+	 *  The ButtonBarView class creates the visual elements of the org.apache.royale.html.ButtonBar 
+	 *  component. A ButtonBar is a type of List and ButtonBarView extends the ListView bead, adding a border.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9.7
+	 */
+	public class ButtonBarView extends ListView
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function ButtonBarView()
+		{
+			super();
+		}
+				
+		/**
+		 *  @copy org.apache.royale.core.IBead#strand
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		override public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			super.strand = value;
+		}		
+	}
+}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
new file mode 100644
index 0000000..4407527
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
@@ -0,0 +1,291 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.itemRenderers
+{
+	import org.apache.royale.core.SimpleCSSStylesWithFlex;
+	import org.apache.royale.events.ItemClickedEvent;
+	import org.apache.royale.events.MouseEvent;
+	import org.apache.royale.html.beads.ITextItemRenderer;
+	import org.apache.royale.html.util.getLabelFromData;
+	import org.apache.royale.jewel.Button;
+
+	COMPILE::JS
+	{
+	import org.apache.royale.core.WrappedHTMLElement;
+	}
+
+	/**
+	 * The ButtonBarItemRenderer class extends Button and turns it into an itemRenderer
+	 * suitable for use in most DataContainer/List/DataGrid applications.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.9.7
+	 */
+	public class ButtonBarItemRenderer extends Button implements ITextItemRenderer
+	{
+		public function ButtonBarItemRenderer()
+		{
+			super();
+
+			style = new SimpleCSSStylesWithFlex();
+
+			addEventListener('click',handleClickEvent);
+		}
+
+		private var _data:Object;
+
+		/**
+		 *  The data to be displayed as the text value. Use this in conjunction with
+		 *  the labelField property to select an item from the dataProvider record to use
+		 *  as the text value of the button.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function get data():Object
+		{
+			return _data;
+		}
+		public function set data(value:Object):void
+		{
+			_data = value;
+
+			updateButtonLabelFromData();
+		}
+
+		/**
+		 * @royaleignorecoercion String
+		 */
+		protected function updateButtonLabelFromData():void
+		{
+			var valueAsString:String;
+
+			if (data == null) return;
+			valueAsString = getLabelFromData(this,data);
+			if (!valueAsString && data.hasOwnProperty("title")) {
+				valueAsString = "" + data["title"];
+			}
+
+			if (valueAsString) text = valueAsString;
+		}
+
+		/**
+		 * @private
+		 */
+		protected function handleClickEvent(event:MouseEvent):void
+		{
+			var newEvent:ItemClickedEvent = new ItemClickedEvent("itemClicked");
+			newEvent.index = index;
+			newEvent.data = data;
+			dispatchEvent(newEvent);
+		}
+
+		/*
+		 * IItemRenderer, ISelectableItemRenderer
+		 */
+
+		private var _itemRendererParent:Object;
+
+		/**
+		 * The parent container for the itemRenderer instance.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function get itemRendererParent():Object
+		{
+			return _itemRendererParent;
+		}
+		public function set itemRendererParent(value:Object):void
+		{
+			_itemRendererParent = value;
+		}
+
+		private var _labelField:String = null;
+
+		/**
+		 * The name of the field within the data to use as a label. Some itemRenderers use this field to
+		 * identify the value they should show while other itemRenderers ignore this if they are showing
+		 * complex information.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function get labelField():String
+		{
+			return _labelField;
+		}
+		public function set labelField(value:String):void
+		{
+			_labelField = value;
+			updateButtonLabelFromData();
+		}
+
+		private var _listData:Object;
+
+		[Bindable("__NoChangeEvent__")]
+		/**
+		 *  Additional data about the list structure the itemRenderer may
+		 *  find useful.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function get listData():Object
+		{
+			return _listData;
+		}
+		public function set listData(value:Object):void
+		{
+			_listData = value;
+		}
+
+		private var _index:int;
+
+		/**
+		 *  The position with the dataProvider being shown by the itemRenderer instance.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function get index():int
+		{
+			return _index;
+		}
+		public function set index(value:int):void
+		{
+			_index = value;
+		}
+
+		private var _selectable:Boolean = true;
+		/**
+         *  <code>true</code> if the item renderer is can be selected
+         *  false otherwise. Use to configure a renderer to be non 
+         *  selectable.
+         *  
+         *  Defaults to true
+         * 
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.3
+         */
+		public function get selectable():Boolean
+		{
+			return _selectable;
+		}
+
+		public function set selectable(value:Boolean):void
+		{
+			_selectable = value;	
+		}
+
+		private var _hoverable:Boolean = true;
+		/**
+         *  <code>true</code> if the item renderer is can be hovered
+         *  false otherwise. Use to configure a renderer to be non 
+         *  hoverable.
+         *  
+         *  Defaults to true
+         * 
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.3
+         */
+		public function get hoverable():Boolean
+		{
+			return _hoverable;
+		}
+
+		public function set hoverable(value:Boolean):void
+		{
+			_hoverable = value;	
+		}
+		
+		private var _hovered:Boolean;
+
+		/**
+		 *  Whether or not the itemRenderer is in a hovered state.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function get hovered():Boolean
+		{
+			return _hovered;
+		}
+		public function set hovered(value:Boolean):void
+		{
+			_hovered = value;
+		}
+
+		private var _selected:Boolean;
+
+		/**
+		 *  Whether or not the itemRenderer is in a selected state.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function get selected():Boolean
+		{
+			return _selected;
+		}
+		public function set selected(value:Boolean):void
+		{
+			_selected = value;
+		}
+
+		private var _down:Boolean;
+
+		/**
+		 *  Whether or not the itemRenderer is in a down (or pre-selected) state.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9.7
+		 */
+		public function get down():Boolean
+		{
+			return _down;
+		}
+		public function set down(value:Boolean):void
+		{
+			_down = value;
+		}
+	}
+}
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
new file mode 100644
index 0000000..9d67b50
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
@@ -0,0 +1,37 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+// Jewel ButtonBar
+
+// ButtonVar variables
+jewel.buttonbar
+
+j|ButtonBar
+    IBeadModel: ClassReference("org.apache.royale.html.beads.models.ButtonBarModel")
+    IBeadView:  ClassReference("org.apache.royale.jewel.beads.views.ButtonBarView")			
+    IBeadController: ClassReference("org.apache.royale.jewel.beads.controllers.ListSingleSelectionMouseController")
+    IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout")
+    IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.TextItemRendererFactoryForArrayData")
+    IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory")
+    IItemRenderer: ClassReference("org.apache.royale.jewel.itemRenderers.ButtonBarItemRenderer")
+    // border-style: none
+
+@media -royale-swf
+    j|ButtonBar
+        IContentView: ClassReference("org.apache.royale.jewel.supportClasses.list.DataGroup")
\ No newline at end of file
diff --git a/frameworks/projects/Jewel/src/main/sass/defaults.sass b/frameworks/projects/Jewel/src/main/sass/defaults.sass
index f848b27..70022ea 100644
--- a/frameworks/projects/Jewel/src/main/sass/defaults.sass
+++ b/frameworks/projects/Jewel/src/main/sass/defaults.sass
@@ -26,6 +26,7 @@
 @import "components/alert"    
 @import "components/badge"    
 @import "components/button"
+@import "components/buttonbar"
 @import "components/card"
 @import "components/checkbox"
 @import "components/controlbar"


[royale-asjs] 04/42: jewel-datagrid: bead configuration for DataGrid

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 8c4e03832cf6604245c9ec337b06d9d557557f4c
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Tue Nov 26 18:16:18 2019 +0100

    jewel-datagrid: bead configuration for DataGrid
---
 examples/royale/DataGridExample/pom.xml            |  2 +
 .../projects/Jewel/src/main/resources/defaults.css | 26 +++++---
 .../Jewel/src/main/resources/jewel-manifest.xml    |  1 +
 .../Jewel/src/main/sass/components/_datagrid.sass  | 72 ++++++++++++++--------
 4 files changed, 69 insertions(+), 32 deletions(-)

diff --git a/examples/royale/DataGridExample/pom.xml b/examples/royale/DataGridExample/pom.xml
index e0f3cc5..25ebff8 100644
--- a/examples/royale/DataGridExample/pom.xml
+++ b/examples/royale/DataGridExample/pom.xml
@@ -45,6 +45,8 @@
         <configuration>
           <mainClass>DataGridExample.mxml</mainClass>
           <targets>${royale.targets}</targets>
+          <debug>false</debug>
+          <additionalCompilerOptions>-source-map=true;</additionalCompilerOptions>
         </configuration>
       </plugin>
     </plugins>
diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 75b0cf4..8014d04 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -457,16 +457,28 @@ j|ComboBoxPopUp {
   IBeadView: ClassReference("org.apache.royale.jewel.beads.views.ComboBoxPopUpView");
 }
 
+.jewel.datagrid {
+  width: 200px;
+  height: 290px;
+}
+
 j|DataGrid {
-  IChangePropagator: ClassReference("org.apache.royale.html.beads.DataGridColumnChangePropagator");
-  IDataGridPresentationModel: ClassReference("org.apache.royale.html.beads.models.DataGridPresentationModel");
-  IBeadView: ClassReference("org.apache.royale.html.beads.DataGridView");
-  IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridModel");
-  IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.DataGridLayout");
-  columnClass: ClassReference("org.apache.royale.html.supportClasses.DataGridColumnList");
+  IChangePropagator: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator");
+  IDataGridPresentationModel: ClassReference("org.apache.royale.jewel.beads.models.DataGridPresentationModel");
+  IBeadView: ClassReference("org.apache.royale.jewel.beads.views.DataGridView");
+  IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel");
+  IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.DataGridLayout");
+  columnClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList");
   columnContainerClass: ClassReference("org.apache.royale.html.DataGridButtonBar");
   columnLayoutClass: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout");
-  listAreaClass: ClassReference("org.apache.royale.html.beads.DataGridListArea");
+  listAreaClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridListArea");
+}
+
+j|DataGridListArea {
+  IBeadView: ClassReference("org.apache.royale.html.beads.ContainerView");
+  IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.HorizontalLayout");
+  IViewport: ClassReference("org.apache.royale.jewel.supportClasses.scrollbar.ScrollingViewport");
+  IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel");
 }
 
 .jewel.datechooser .jewel.table {
diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index b38ee40..4ccb8df 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -45,6 +45,7 @@
 
     <component id="DataGrid" class="org.apache.royale.jewel.DataGrid"/>
     <component id="DataGridColumn" class="org.apache.royale.jewel.supportClasses.datagrid.DataGridColumn"/>
+    <component id="DataGridListArea" class="org.apache.royale.jewel.supportClasses.datagrid.DataGridListArea"/>
 
     <component id="SimpleButton" class="org.apache.royale.jewel.supportClasses.button.SimpleButton"/>
     <component id="Button" class="org.apache.royale.jewel.Button"/>
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
index 827b040..50c3853 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
@@ -22,17 +22,57 @@
 // DataGrid variables
 
 .jewel.datagrid
+    width: 200px
+    height: 290px
 
 j|DataGrid
-    IChangePropagator: ClassReference("org.apache.royale.html.beads.DataGridColumnChangePropagator")
-    IDataGridPresentationModel: ClassReference("org.apache.royale.html.beads.models.DataGridPresentationModel")
-    IBeadView: ClassReference("org.apache.royale.html.beads.DataGridView")
-    IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridModel")
-    IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.DataGridLayout")
-    columnClass: ClassReference("org.apache.royale.html.supportClasses.DataGridColumnList")
+    IChangePropagator: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator")
+    IDataGridPresentationModel: ClassReference("org.apache.royale.jewel.beads.models.DataGridPresentationModel")
+    IBeadView: ClassReference("org.apache.royale.jewel.beads.views.DataGridView")
+    IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel")
+    IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.DataGridLayout")
+    columnClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList")
     columnContainerClass: ClassReference("org.apache.royale.html.DataGridButtonBar")
     columnLayoutClass: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout")
-    listAreaClass: ClassReference("org.apache.royale.html.beads.DataGridListArea")
+    listAreaClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridListArea")
+
+j|DataGridListArea
+    IBeadView: ClassReference("org.apache.royale.html.beads.ContainerView")
+    IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.HorizontalLayout")
+    IViewport: ClassReference("org.apache.royale.jewel.supportClasses.scrollbar.ScrollingViewport")
+    IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
+//align-items: flex-start
+// DataGridListArea {
+// background-color: #FFFFFF
+// IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.HorizontalLayout")
+// IViewport: ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport")
+// IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
+// flex-grow: 1
+// }
+
+// j|DataGridColumnList
+//     IBeadView:  ClassReference("org.apache.royale.html.beads.ListView")			
+//     IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController")
+//     IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.VerticalLayout")
+//     IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory")
+//     IItemRenderer: ClassReference("org.apache.royale.html.supportClasses.StringItemRenderer")
+//     IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridModel")
+//     IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.DataItemRendererFactoryForArrayData")
+//     IViewport: ClassReference("org.apache.royale.html.supportClasses.Viewport")
+//     IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
+
+
+// DynamicDataGrid {
+// IChangePropagator: ClassReference("org.apache.royale.html.beads.DataGridColumnChangePropagator")
+// IDataGridPresentationModel: ClassReference("org.apache.royale.html.beads.models.DataGridPresentationModel")
+// IBeadView: ClassReference("org.apache.royale.html.beads.DataGridView")
+// IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel")
+// IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.DataGridLayout")
+// ColumnClass: ClassReference("org.apache.royale.html.supportClasses.DynamicDataGridColumnList")
+
+// background-color: #FFFFFF
+// border: 1px solid #222222
+// }
 
 // DataGridButtonBar
 // {
@@ -64,25 +104,7 @@ j|DataGrid
 // background-color: #FFFFFF
 // }
 
-// DataGridListArea {
-// background-color: #FFFFFF
-// IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.HorizontalLayout")
-// IViewport: ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport")
-// IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
-// flex-grow: 1
-// }
-
-// DynamicDataGrid {
-// IChangePropagator: ClassReference("org.apache.royale.html.beads.DataGridColumnChangePropagator")
-// IDataGridPresentationModel: ClassReference("org.apache.royale.html.beads.models.DataGridPresentationModel")
-// IBeadView: ClassReference("org.apache.royale.html.beads.DataGridView")
-// IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel")
-// IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.DataGridLayout")
-// ColumnClass: ClassReference("org.apache.royale.html.supportClasses.DynamicDataGridColumnList")
 
-// background-color: #FFFFFF
-// border: 1px solid #222222
-// }
 
 // DynamicDataGridColumnList {
 // IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel")


[royale-asjs] 41/42: jewel-layouts: add support in layouts for new buttonbar widthTypes (only 2 are implemented, next will come soon)

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 667f17700944648f37ed86bf31b13e47a1b09eb5
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Dec 13 00:28:51 2019 +0100

    jewel-layouts: add support in layouts for new buttonbar widthTypes (only 2 are implemented, next will come soon)
---
 .../projects/Jewel/src/main/resources/defaults.css  | 21 ++++++++++++++++++---
 .../Jewel/src/main/sass/components/_layout.sass     | 10 +++++++++-
 2 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 9cd6e14..2b8383e 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -488,12 +488,18 @@ j|ComboBoxPopUp {
   width: 200px;
   height: 290px;
 }
+.jewel.datagrid .jewel.buttonbar.header {
+  width: 100%;
+}
 .jewel.datagrid .jewel.buttonbar.header .jewel.button.first {
   border-bottom-left-radius: 0;
 }
 .jewel.datagrid .jewel.buttonbar.header .jewel.button.last {
   border-bottom-right-radius: 0;
 }
+.jewel.datagrid .listarea {
+  width: 100%;
+}
 .jewel.datagrid .jewel.list.column {
   border-radius: 0px;
   border-top-width: 0px;
@@ -516,10 +522,10 @@ j|DataGrid {
   IBeadView: ClassReference("org.apache.royale.jewel.beads.views.DataGridView");
   IBeadModel: ClassReference("org.apache.royale.html.beads.models.DataGridCollectionViewModel");
   IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.DataGridLayout");
-  columnClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList");
-  columnContainerClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridButtonBar");
-  columnLayoutClass: ClassReference("org.apache.royale.html.beads.layouts.ButtonBarLayout");
+  headerClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridButtonBar");
+  headerLayoutClass: ClassReference("org.apache.royale.jewel.beads.layouts.ButtonBarLayout");
   listAreaClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridListArea");
+  columnClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList");
 }
 
 j|DataGridListArea {
@@ -1077,9 +1083,18 @@ j|Label {
 .layout.horizontal.sameWidths > * {
   flex: 1 0;
 }
+.layout.horizontal.pixelWidths > * {
+  flex: none;
+}
 .layout.horizontal.proportinalWidths > * {
+  flex: 1 0;
+}
+.layout.horizontal.percentWidths > * {
   flex: 1 0 auto;
 }
+.layout.horizontal.naturalWidths > * {
+  flex: none;
+}
 .layout.vertical {
   flex-direction: column;
   flex-wrap: nowrap;
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_layout.sass b/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
index 5d5bfcd..52e47ef 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
@@ -80,13 +80,21 @@ $gap-size: 10px !default
 					margin: 0px
 				> *
 					margin: 0px 0px 0px ($gap + $i * $gap-step)
-
 		&.sameWidths
 			> *
 				flex: 1 0
+		&.pixelWidths
+			> *
+				flex: none
 		&.proportinalWidths
 			> *
+				flex: 1 0
+		&.percentWidths
+			> *
 				flex: 1 0 auto
+		&.naturalWidths
+			> *
+				flex: none
 
 	// Vertical
 	&.vertical


[royale-asjs] 18/42: jewel-datagrid: global styling for header and list columns

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 00066216e2180a3125940dbefb056f9e08960719
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sat Nov 30 13:23:28 2019 +0100

    jewel-datagrid: global styling for header and list columns
---
 .../projects/Jewel/src/main/resources/defaults.css | 15 ++++++++++----
 .../jewel/itemRenderers/ButtonBarItemRenderer.as   |  1 -
 .../Jewel/src/main/sass/components/_datagrid.sass  | 24 +++++++++++++++-------
 3 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 512d3a4..e95ab07 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -488,15 +488,22 @@ j|ComboBoxPopUp {
   width: 200px;
   height: 290px;
 }
-
-.jewel.list.column {
+.jewel.datagrid .jewel.buttonbar.header .jewel.button.first {
+  border-bottom-left-radius: 0;
+}
+.jewel.datagrid .jewel.buttonbar.header .jewel.button.last {
+  border-bottom-right-radius: 0;
+}
+.jewel.datagrid .jewel.list.column {
   border-radius: 0px;
 }
-.jewel.list.column.first {
+.jewel.datagrid .jewel.list.column.first {
   border-right: 0px;
+  border-bottom-left-radius: 0.25rem;
 }
-.jewel.list.column.last {
+.jewel.datagrid .jewel.list.column.last {
   border-left: 0px;
+  border-bottom-right-radius: 0.25rem;
 }
 
 j|DataGrid {
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
index d852528..aa210be 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/itemRenderers/ButtonBarItemRenderer.as
@@ -176,7 +176,6 @@ package org.apache.royale.jewel.itemRenderers
 		}
 
 		private var _index:int;
-
 		/**
 		 *  The position with the dataProvider being shown by the itemRenderer instance.
 		 *
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
index 7523558..4679d9d 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
@@ -18,19 +18,29 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 // Jewel DataGrid
+$border-radius: .25rem
 
 // DataGrid variables
-
 .jewel.datagrid
     width: 200px
     height: 290px
 
-.jewel.list.column
-    border-radius: 0px
-    &.first
-        border-right: 0px
-    &.last
-        border-left: 0px
+    .jewel.buttonbar.header
+        .jewel.button
+            &.first
+                border-bottom-left-radius: 0
+
+            &.last
+                border-bottom-right-radius: 0
+
+    .jewel.list.column
+        border-radius: 0px
+        &.first
+            border-right: 0px
+            border-bottom-left-radius: $border-radius
+        &.last
+            border-left: 0px
+            border-bottom-right-radius: $border-radius
 
 j|DataGrid
     IChangePropagator: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnChangePropagator")


[royale-asjs] 39/42: jewel-buttonbar: make widthType internal to the component (will need to provide its own jewel buttonbarmodel)

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 9949c8b18dbd1c2b06aa42f3e2a92c5226447eef
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Dec 13 00:27:03 2019 +0100

    jewel-buttonbar: make widthType internal to the component (will need to provide its own jewel buttonbarmodel)
---
 .../royale/org/apache/royale/jewel/ButtonBar.as    |  24 ++--
 .../royale/jewel/beads/layouts/ButtonBarLayout.as  | 157 ++++++++-------------
 .../Jewel/src/main/sass/components/_buttonbar.sass |   2 -
 3 files changed, 73 insertions(+), 110 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as
index 26c6eef..cc0119f 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ButtonBar.as
@@ -26,9 +26,13 @@ package org.apache.royale.jewel
 	import org.apache.royale.html.beads.models.ButtonBarModel;
 
 	/**
-	 *  The ButtonBar class is a component that displays a set of Buttons. The ButtonBar
+	 *  The Jewel ButtonBar class is a component that displays a set of Buttons. The ButtonBar
 	 *  is actually a List with a default horizontal layout and an itemRenderer that
-	 *  produces Buttons. The ButtonBar uses the following beads:
+	 *  produces Jewel Buttons.
+	 *  
+	 *  By default buttons are equally sized, by setting `widthType` to NaN.
+	 *  
+	 *  The ButtonBar uses the following beads:
 	 *
 	 *  org.apache.royale.core.IBeadModel: the data model for the ButtonBar, including the dataProvider.
 	 *  org.apache.royale.core.IBeadView: constructs the parts of the component.
@@ -94,17 +98,17 @@ package org.apache.royale.jewel
 		 *  @productversion Royale 0.9.7
 		 *  @royaleignorecoercion org.apache.royale.html.beads.models.ButtonBarModel
 		 */
-		public function get widthType():Number
-		{
-			return ButtonBarModel(model).widthType;
-		}
+		// public function get widthType():Number
+		// {
+		// 	return ButtonBarModel(model).widthType;
+		// }
 		/**
 		 * @royaleignorecoercion org.apache.royale.html.beads.models.ButtonBarModel
 		 */
-		public function set widthType(value:Number):void
-		{
-			ButtonBarModel(model).widthType = value;
-		}
+		// public function set widthType(value:Number):void
+		// {
+		// 	ButtonBarModel(model).widthType = value;
+		// }
 
 		private var _emphasis:String;
         /**
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as
index 68b5e61..b1aadc8 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ButtonBarLayout.as
@@ -26,11 +26,11 @@ package org.apache.royale.jewel.beads.layouts
 	import org.apache.royale.html.beads.models.ButtonBarModel;
 
 	/**
-	 *  The ButtonBarLayout class bead sizes and positions the button
+	 *  The Jewel ButtonBarLayout class bead sizes and positions the button
 	 *  elements that make up a org.apache.royale.jewel.ButtonBar.
 	 *  
 	 *  This bead arranges the Buttons horizontally and makes them all the same width 
-	 *  unless the buttonWidths property has been set in which case
+	 *  (widthType = NaN) unless the buttonWidths property has been set in which case
 	 *  the values stored in that array are used.
 	 *
 	 *  @langversion 3.0
@@ -58,6 +58,7 @@ package org.apache.royale.jewel.beads.layouts
 		 */
 		public static const LAYOUT_TYPE_NAMES:String = "layout horizontal";
 
+		private var model:ButtonBarModel;
 		/**
 		 *  Add class selectors when the component is addedToParent
 		 *  Otherwise component will not get the class selectors when 
@@ -72,80 +73,70 @@ package org.apache.royale.jewel.beads.layouts
 		{
 			super.beadsAddedHandler();
 
-			COMPILE::JS
-			{
-				if(proportionalWidths)
-				{
-					hostClassList.add("proportinalWidths");
-				} else 
-				{
-					hostClassList.add("sameWidths");
-				}
+			model = (host as IStrand).getBeadByType(ButtonBarModel) as ButtonBarModel;
+			if (model) {
+				widthType = model.buttonWidths != null ? model.widthType : NaN;
 			}
 		}
 
-		private var _proportionalWidths:Boolean;
 		/**
-		 *  Switch between "proportionalWidth" and "sameWidths".
-		 *  Default is false (sameWidths) and all buttons are has the same width.
-		 *  True to make all buttons fill all size available proportionally.
+		 *  Switch between four different types of width
 		 *
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
 		 *  @productversion Royale 0.9.7
 		 */
-        public function get proportionalWidths():Boolean
+		public function get widthType():Number
         {
-            return _proportionalWidths;
+            return model.widthType;
         }
-
-        public function set proportionalWidths(value:Boolean):void
+		public function set widthType(value:Number):void
         {
-			if (_proportionalWidths != value)
+			if (model.widthType != value)
             {
+				model.widthType = value;
                 COMPILE::JS
                 {
 				if(hostComponent)
 				{
-					if(value)
+					if (hostClassList.contains("pixelWidths"))
+						hostClassList.remove("pixelWidths");
+					if (hostClassList.contains("proportinalWidths"))
+						hostClassList.remove("proportinalWidths");
+					if (hostClassList.contains("percentWidths"))
+						hostClassList.remove("percentWidths");
+					if (hostClassList.contains("naturalWidths"))
+						hostClassList.remove("naturalWidths");
+					if (hostClassList.contains("sameWidths"))
+						hostClassList.remove("sameWidths");
+					if(isNaN(model.widthType))
 					{
-						if (hostClassList.contains("sameWidths"))
-							hostClassList.remove("sameWidths");
-						hostClassList.add("proportinalWidths");
-					} else 
-					{
-						if (hostClassList.contains("proportinalWidths"))
-							hostClassList.remove("proportinalWidths");
 						hostClassList.add("sameWidths");
 					}
+					else
+					{
+						switch(model.widthType)
+						{
+							case ButtonBarModel.PIXEL_WIDTHS:
+								hostClassList.add("pixelWidths");
+								break;
+							case ButtonBarModel.PROPORTIONAL_WIDTHS:
+								hostClassList.add("proportinalWidths");
+								break;
+							case ButtonBarModel.PERCENT_WIDTHS:
+								hostClassList.add("percentWidths");
+								break;
+							case ButtonBarModel.NATURAL_WIDTHS:
+								hostClassList.add("naturalWidths");
+								break;
+						}
+					}
 				}
 				}
-				_proportionalWidths = value;
 			}
 		}
 
-		private var _widthType:Number = ButtonBarModel.PIXEL_WIDTHS;
-		private var _buttonWidths:Array = null;
-
-		/**
-		 *  An array of widths (Number), one per button. These values supersede the
-		 *  default of equally-sized buttons.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.7
-		 */
-		public function get buttonWidths():Array
-		{
-			return _buttonWidths;
-		}
-		public function set buttonWidths(value:Array):void
-		{
-			_buttonWidths = value;
-		}
-
 		/**
 		 * @copy org.apache.royale.core.IBeadLayout#layout
 		 * @royaleignorecoercion org.apache.royale.core.ILayoutChild
@@ -155,13 +146,6 @@ package org.apache.royale.jewel.beads.layouts
 		override public function layout():Boolean
 		{
 			var contentView:ILayoutView = layoutView;
-
-			var model:ButtonBarModel = (host as IStrand).getBeadByType(ButtonBarModel) as ButtonBarModel;
-			if (model) {
-				buttonWidths = model.buttonWidths;
-				_widthType = model.widthType;
-			}
-
 			var n:int = contentView.numElements;
 			if (n <= 0) return false;
 
@@ -171,49 +155,26 @@ package org.apache.royale.jewel.beads.layouts
 				if (ilc == null || !ilc.visible) continue;
 				if (!(ilc is IStyleableObject)) continue;
 				
-				// COMPILE::SWF {
-				// if (buttonWidths) {
-				// 	var widthValue:* = buttonWidths[i];
-
-				// 	if (_widthType == ButtonBarModel.PIXEL_WIDTHS) {
-				// 		if (widthValue != null) ilc.width = Number(widthValue);
-				// 		IStyleableObject(ilc).style.flexGrow = 0;
-				// 	}
-				// 	else if (_widthType == ButtonBarModel.PROPORTIONAL_WIDTHS) {
-				// 		if (widthValue != null) {
-				// 			IStyleableObject(ilc).style.flexGrow = Number(widthValue);
-				// 		}
-				// 	}
-				// 	else if (_widthType == ButtonBarModel.PERCENT_WIDTHS) {
-				// 		if (widthValue != null) ilc.percentWidth = Number(widthValue);
-				// 		IStyleableObject(ilc).style.flexGrow = 0;
-				// 	}
-				// } else if (!_widthType == ButtonBarModel.NATURAL_WIDTHS) {
-				// 	IStyleableObject(ilc).style.flexGrow = 1;
-				// }
-				// }
-
-				// COMPILE::JS {
-				// // otherwise let the flexbox layout handle matters on its own.
-				// if (buttonWidths) {
-				// 	var widthValue:* = buttonWidths[i];
-
-				// 	if (_widthType == ButtonBarModel.PIXEL_WIDTHS) {
-				// 		if (widthValue != null) ilc.width = Number(widthValue);
-				// 	}
-				// 	else if (_widthType == ButtonBarModel.PROPORTIONAL_WIDTHS) {
-				// 		if (widthValue != null) ilc.element.style["flex-grow"] = String(widthValue);
-				// 	}
-				// 	else if (_widthType == ButtonBarModel.PERCENT_WIDTHS) {
-				// 		if (widthValue != null) ilc.percentWidth = Number(widthValue);
-				// 	}
-				// } else if (!_widthType == ButtonBarModel.NATURAL_WIDTHS) {
+				COMPILE::JS
+				{
+				// otherwise let the flexbox layout handle matters on its own.
+				if (model.buttonWidths) {
+					var widthValue:* = model.buttonWidths[i];
+					
+					if (model.widthType == ButtonBarModel.PIXEL_WIDTHS) {
+						if (widthValue != null) ilc.width = Number(widthValue);
+					}
+					// else if (_widthType == ButtonBarModel.PROPORTIONAL_WIDTHS) {
+					// 	if (widthValue != null) ilc.element.style["flex-grow"] = String(widthValue);
+					// }
+					// else if (_widthType == ButtonBarModel.PERCENT_WIDTHS) {
+					// 	if (widthValue != null) ilc.percentWidth = Number(widthValue);
+					// }
+				} 
+				// else if (!_widthType == ButtonBarModel.NATURAL_WIDTHS) {
 				// 	ilc.element.style["flex-grow"] = "1";
 				// }
-
-				// if (!host.isHeightSizedToContent())
-				// 	ilc.height = contentView.height;
-				// }
+				}
 			}
 
 			// now let the horizontal layout take care of things.
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
index b0d020c..64452ae 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_buttonbar.sass
@@ -40,11 +40,9 @@ j|ButtonBar
     IBeadView:  ClassReference("org.apache.royale.jewel.beads.views.ButtonBarView")			
     IBeadController: ClassReference("org.apache.royale.jewel.beads.controllers.ListSingleSelectionMouseController")
     IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.ButtonBarLayout")
-    // IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.TextItemRendererFactoryForArrayData")
     IDataProviderItemRendererMapper: ClassReference("org.apache.royale.jewel.beads.itemRenderers.DataItemRendererFactoryForCollectionView")
     IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory")
     IItemRenderer: ClassReference("org.apache.royale.jewel.itemRenderers.ButtonBarItemRenderer")
-    // border-style: none
 
 @media -royale-swf
     j|ButtonBar