Repository: flex-asjs Updated Branches: refs/heads/develop 8432afc9c -> d311cf99c
Added DataGrid to the Express project; includes all drag and drop beads by default. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d311cf99 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d311cf99 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d311cf99 Branch: refs/heads/develop Commit: d311cf99c7aa5e0e4c1b3fcee291e284e41a7d96 Parents: 8432afc Author: Peter Ent <[email protected]> Authored: Wed Sep 20 16:34:50 2017 -0400 Committer: Peter Ent <[email protected]> Committed: Wed Sep 20 16:34:50 2017 -0400 ---------------------------------------------------------------------- .../beads/DataGridWithDrawingLayerLayout.as | 38 +++++++-------- .../Express/src/main/flex/ExpressClasses.as | 1 + .../flex/org/apache/flex/express/DataGrid.as | 49 ++++++++++++++++++++ .../Express/src/main/resources/defaults.css | 4 ++ .../src/main/resources/express-manifest.xml | 6 ++- 5 files changed, 78 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d311cf99/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridWithDrawingLayerLayout.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridWithDrawingLayerLayout.as b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridWithDrawingLayerLayout.as index 31c7c30..e29c1d9 100644 --- a/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridWithDrawingLayerLayout.as +++ b/frameworks/projects/DragDrop/src/main/flex/org/apache/flex/html/beads/DataGridWithDrawingLayerLayout.as @@ -17,22 +17,22 @@ // //////////////////////////////////////////////////////////////////////////////// package org.apache.flex.html.beads -{ +{ import org.apache.flex.core.IStrand; import org.apache.flex.core.IUIBase; import org.apache.flex.core.UIBase; import org.apache.flex.html.beads.IDataGridView; import org.apache.flex.html.beads.layouts.VerticalFlexLayout; - + COMPILE::SWF { import org.apache.flex.html.supportClasses.ScrollingViewport; import org.apache.flex.html.supportClasses.ScrollBar; } - + /** * DataGridWithDrawingLayerLayout is a class that extends VerticalFlexLayout * and positions the drawing layer created by a DataGridDrawingLayerBead. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -42,7 +42,7 @@ package org.apache.flex.html.beads { /** * constructor - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -52,12 +52,12 @@ package org.apache.flex.html.beads { super(); } - + private var _strand:IStrand; - + /** * @copy org.apache.flex.core.IBead#strand - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -68,7 +68,7 @@ package org.apache.flex.html.beads super.strand = value; _strand = value; } - + /** * @private */ @@ -77,25 +77,25 @@ package org.apache.flex.html.beads // If there is a drawing layer, remove it so the super.layout function // will not include it. var layerBead:IDrawingLayerBead = _strand.getBeadByType(IDrawingLayerBead) as IDrawingLayerBead; - if (layerBead) { + if (layerBead != null && layerBead.layer != null) { UIBase(_strand).removeElement(layerBead.layer); } - + // Run the actual layout var result:Boolean = super.layout(); - + // Put the drawing layer back, sizing it to fit over the listArea. - if (layerBead) { + if (layerBead != null && layerBead.layer != null) { UIBase(_strand).addElement(layerBead.layer); - + var layerX:Number = 0; var layerY:Number = 0; var useWidth:Number = UIBase(_strand).width; var useHeight:Number = UIBase(_strand).height; - + var view:IDataGridView = UIBase(_strand).view as IDataGridView; var listArea:UIBase = view.listArea; - + COMPILE::SWF { var scrollViewport:ScrollingViewport = listArea.getBeadByType(ScrollingViewport) as ScrollingViewport; if (scrollViewport) { @@ -105,11 +105,11 @@ package org.apache.flex.html.beads if (hbar != null && hbar.visible) useHeight -= hbar.height; } } - - layerBead.layer.x = layerX; + + layerBead.layer.x = layerX; layerBead.layer.y = layerY; layerBead.layer.setWidthAndHeight(useWidth, useHeight, true); - + } return result; } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d311cf99/frameworks/projects/Express/src/main/flex/ExpressClasses.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Express/src/main/flex/ExpressClasses.as b/frameworks/projects/Express/src/main/flex/ExpressClasses.as index 5f185ee..cf2cc62 100644 --- a/frameworks/projects/Express/src/main/flex/ExpressClasses.as +++ b/frameworks/projects/Express/src/main/flex/ExpressClasses.as @@ -30,6 +30,7 @@ internal class ExpressClasses import org.apache.flex.express.Application; Application; import org.apache.flex.express.Container; Container; + import org.apache.flex.express.DataGrid; DataGrid; import org.apache.flex.express.HContainer; HContainer; import org.apache.flex.express.HView; HView; import org.apache.flex.express.ImageAndTextButton; ImageAndTextButton; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d311cf99/frameworks/projects/Express/src/main/flex/org/apache/flex/express/DataGrid.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Express/src/main/flex/org/apache/flex/express/DataGrid.as b/frameworks/projects/Express/src/main/flex/org/apache/flex/express/DataGrid.as new file mode 100644 index 0000000..641db14 --- /dev/null +++ b/frameworks/projects/Express/src/main/flex/org/apache/flex/express/DataGrid.as @@ -0,0 +1,49 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.express +{ + import org.apache.flex.html.DataGrid; + import org.apache.flex.html.beads.DataGridColumnReorderView; + import org.apache.flex.html.beads.SingleSelectionDragSourceBead; + import org.apache.flex.html.beads.SingleSelectionDragImageBead; + import org.apache.flex.html.beads.SingleSelectionDropTargetBead; + import org.apache.flex.html.beads.SingleSelectionDropIndicatorBead; + import org.apache.flex.html.beads.DataGridWithDrawingLayerLayout; + import org.apache.flex.html.beads.DataGridDrawingLayerBead; + + /** + * This class extends DataGrid and adds beads for drag and drop and + * column reordering. + */ + public class DataGrid extends org.apache.flex.html.DataGrid + { + public function DataGrid() + { + super(); + + addBead(new SingleSelectionDragSourceBead()); + addBead(new SingleSelectionDragImageBead()); + addBead(new SingleSelectionDropTargetBead()); + addBead(new SingleSelectionDropIndicatorBead()); + addBead(new DataGridWithDrawingLayerLayout()); + addBead(new DataGridDrawingLayerBead()); + addBead(new DataGridColumnReorderView()); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d311cf99/frameworks/projects/Express/src/main/resources/defaults.css ---------------------------------------------------------------------- diff --git a/frameworks/projects/Express/src/main/resources/defaults.css b/frameworks/projects/Express/src/main/resources/defaults.css index 4949005..2c20f84 100644 --- a/frameworks/projects/Express/src/main/resources/defaults.css +++ b/frameworks/projects/Express/src/main/resources/defaults.css @@ -44,6 +44,10 @@ Application margin: 0px; } +DataGridButtonBar { + IBeadView: ClassReference("org.apache.flex.html.beads.DataGridButtonBarViewForMovableColumns"); +} + Container { IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView"); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d311cf99/frameworks/projects/Express/src/main/resources/express-manifest.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/Express/src/main/resources/express-manifest.xml b/frameworks/projects/Express/src/main/resources/express-manifest.xml index 63551e2..9f6124d 100644 --- a/frameworks/projects/Express/src/main/resources/express-manifest.xml +++ b/frameworks/projects/Express/src/main/resources/express-manifest.xml @@ -25,6 +25,7 @@ <component id="Application" class="org.apache.flex.express.Application"/> <component id="Container" class="org.apache.flex.express.Container"/> <component id="HContainer" class="org.apache.flex.express.HContainer"/> + <component id="DataGrid" class="org.apache.flex.express.DataGrid" /> <component id="HView" class="org.apache.flex.express.HView"/> <component id="ImageAndTextButton" class="org.apache.flex.express.ImageAndTextButton"/> <component id="ImageButton" class="org.apache.flex.express.ImageButton" /> @@ -38,6 +39,9 @@ <component id="VView" class="org.apache.flex.express.VView"/> <!-- Basic Components --> + + <component id="SimpleCSSValuesImpl" class="org.apache.flex.core.SimpleCSSValuesImpl" lookupOnly="true"/> + <component id="ConstantBinding" class="org.apache.flex.binding.ConstantBinding" lookupOnly="true" /> <component id="Button" class="org.apache.flex.html.Button" lookupOnly="true" /> <component id="ButtonBar" class="org.apache.flex.html.ButtonBar" lookupOnly="true" /> <component id="CloseButton" class="org.apache.flex.html.CloseButton" lookupOnly="true" /> @@ -86,7 +90,7 @@ <component id="ImageAndTextButtonView" class="org.apache.flex.html.beads.ImageAndTextButtonView" lookupOnly="true" /> <component id="ScrollingViewport" class="org.apache.flex.html.supportClasses.ScrollingViewport" lookupOnly="true" /> - <component id="DataGrid" class="org.apache.flex.html.DataGrid" lookupOnly="true" /> + <component id="DataGridButtonBar" class="org.apache.flex.html.DataGridButtonBar" lookupOnly="true" /> <component id="DataGridColumn" class="org.apache.flex.html.supportClasses.DataGridColumn" lookupOnly="true" /> <component id="DateChooser" class="org.apache.flex.html.DateChooser" lookupOnly="true" />
