From commits-return-14701-archive-asf-public=cust-asf.ponee.io@royale.apache.org Sun Nov 15 20:03:25 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id EA8B4180626 for ; Sun, 15 Nov 2020 21:03:24 +0100 (CET) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 1247864FA0 for ; Sun, 15 Nov 2020 20:03:23 +0000 (UTC) Received: (qmail 85829 invoked by uid 500); 15 Nov 2020 20:03:23 -0000 Mailing-List: contact commits-help@royale.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@royale.apache.org Delivered-To: mailing list commits@royale.apache.org Received: (qmail 85820 invoked by uid 99); 15 Nov 2020 20:03:23 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Nov 2020 20:03:23 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 1301D8087C; Sun, 15 Nov 2020 20:03:23 +0000 (UTC) Date: Sun, 15 Nov 2020 20:03:23 +0000 To: "commits@royale.apache.org" Subject: [royale-asjs] branch develop updated: jewel-virtualdatagrid: fix issues with column heights MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <160547060299.18599.368799470781880757@gitbox.apache.org> From: carlosrovira@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: royale-asjs X-Git-Refname: refs/heads/develop X-Git-Reftype: branch X-Git-Oldrev: 2472d8a5b2137b41f1a9416fd9adeaf86c48ddb0 X-Git-Newrev: 28dd1a042432f0ed99f9a62c1b2d2cba72e72538 X-Git-Rev: 28dd1a042432f0ed99f9a62c1b2d2cba72e72538 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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 The following commit(s) were added to refs/heads/develop by this push: new 28dd1a0 jewel-virtualdatagrid: fix issues with column heights 28dd1a0 is described below commit 28dd1a042432f0ed99f9a62c1b2d2cba72e72538 Author: Carlos Rovira AuthorDate: Sun Nov 15 21:03:08 2020 +0100 jewel-virtualdatagrid: fix issues with column heights --- .../src/main/royale/VirtualListsPlayGround.mxml | 6 +-- .../src/main/royale/models/ProductModel.as | 34 +++++++++++++++ .../projects/Jewel/src/main/resources/defaults.css | 1 + .../projects/Jewel/src/main/royale/JewelClasses.as | 2 + .../royale/jewel/beads/views/DataGridView.as | 11 ++++- .../jewel/beads/views/VirtualDataGridView.as | 51 ++++++++++++++++++++++ .../Jewel/src/main/sass/components/_datagrid.sass | 1 + 7 files changed, 102 insertions(+), 4 deletions(-) diff --git a/examples/jewel/TourDeJewel/src/main/royale/VirtualListsPlayGround.mxml b/examples/jewel/TourDeJewel/src/main/royale/VirtualListsPlayGround.mxml index 05a3bc2..7479475 100644 --- a/examples/jewel/TourDeJewel/src/main/royale/VirtualListsPlayGround.mxml +++ b/examples/jewel/TourDeJewel/src/main/royale/VirtualListsPlayGround.mxml @@ -23,7 +23,7 @@ limitations under the License. xmlns:js="library://ns.apache.org/royale/basic" xmlns:c="components.*" xmlns:models="models.*" sourceCodeUrl="VirtualListsPlayGround.mxml" - initComplete="listModel.createBigIconListVOData()"> + initComplete="listModel.createBigIconListVOData(); productModel.createBigProductVOData()"> - + diff --git a/examples/jewel/TourDeJewel/src/main/royale/models/ProductModel.as b/examples/jewel/TourDeJewel/src/main/royale/models/ProductModel.as index a31a750..a805273 100644 --- a/examples/jewel/TourDeJewel/src/main/royale/models/ProductModel.as +++ b/examples/jewel/TourDeJewel/src/main/royale/models/ProductModel.as @@ -54,5 +54,39 @@ package models { return _productList; } + + + /** + * Used in the Virtual List example example. + */ + public var _bigProductVOData:ArrayList; + + public function get bigProductVOData():ArrayList + { + return _bigProductVOData; + } + public function set bigProductVOData(value:ArrayList):void + { + _bigProductVOData = value; + } + + public function createBigProductVOData():void + { + var item:Product; + var dp:Array = []; + + for (var i:int = 0; i < 2000; i++) + { + item = new Product( + "pr"+Math.floor(Math.random()*1000), + "Product - " + i, Math.floor(Math.random()*1000), + Math.floor(Math.random()*1000), + "assets/smallbluerect.jpg" + ); + dp.push(item); + } + + bigProductVOData = new ArrayList(dp); + } } } diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css index a87cf91..ecbc6a4 100644 --- a/frameworks/projects/Jewel/src/main/resources/defaults.css +++ b/frameworks/projects/Jewel/src/main/resources/defaults.css @@ -554,6 +554,7 @@ j|DataGridButtonBar { } j|VirtualDataGrid { + IBeadView: ClassReference("org.apache.royale.jewel.beads.views.VirtualDataGridView"); columnClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.VirtualDataGridColumnList"); } diff --git a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as index 79d474b..d4c1f0a 100644 --- a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as +++ b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as @@ -118,6 +118,8 @@ import org.apache.royale.utils.observeElementSize; import org.apache.royale.jewel.beads.views.DataGridView; DataGridView; import org.apache.royale.jewel.beads.layouts.DataGridLayout; DataGridLayout; + import org.apache.royale.jewel.beads.views.VirtualDataGridView; VirtualDataGridView; + import org.apache.royale.jewel.supportClasses.LayoutProxy; LayoutProxy; import org.apache.royale.jewel.supportClasses.util.positionInsideBoundingClientRect; positionInsideBoundingClientRect; 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 fe1fbd1..1dee93e 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 @@ -78,7 +78,7 @@ package org.apache.royale.jewel.beads.views super(); } - private var _dg:IDataGrid = _strand as IDataGrid; + protected var _dg:IDataGrid = _strand as IDataGrid; private var _header:IDataGridHeader; private var _listArea:IUIBase; private var _lists:Array = []; @@ -239,6 +239,8 @@ package org.apache.royale.jewel.beads.views list.addEventListener('selectionChanged', handleColumnListSelectionChange); list.addEventListener('beadsAdded', configureColumnListPresentationModel); (list as StyledUIBase).tabIndex = -1; + setColumnHeight(list as StyledUIBase); + (_listArea as IParent).addElement(list as IChild); @@ -247,6 +249,13 @@ package org.apache.royale.jewel.beads.views } /** + * set the height of the column if necessary + */ + protected function setColumnHeight(column:StyledUIBase):void { + // override in subclasses if necessary - VirtualDataGrid needs to use this since it can't left height unset + } + + /** * @private */ protected function configureColumnListPresentationModel(event:Event):void diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/VirtualDataGridView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/VirtualDataGridView.as new file mode 100644 index 0000000..3cca9b3 --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/VirtualDataGridView.as @@ -0,0 +1,51 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.StyledUIBase; + + /** + * The VirtualDataGridView class is the visual bead for Jewel VirtualDataGrid. + * + * @viewbead + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.8 + */ + public class VirtualDataGridView extends DataGridView + { + /** + * constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.8 + */ + public function VirtualDataGridView() + { + super(); + } + + override protected function setColumnHeight(column:StyledUIBase):void { + column.height = _dg.height - header.height; + } + } +} \ 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 74baf38..30bb170 100644 --- a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass +++ b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass @@ -86,6 +86,7 @@ j|DataGridButtonBar j|VirtualDataGrid + IBeadView: ClassReference("org.apache.royale.jewel.beads.views.VirtualDataGridView") columnClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.VirtualDataGridColumnList") j|VirtualDataGridColumnList