This is an automated email from the ASF dual-hosted git repository.
pent pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/feature/MXRoyale by this push:
new ed5b6ed mx.containers.Canvas compiles.
ed5b6ed is described below
commit ed5b6edf03da01d6edbcafa198d85230575e1cf1
Author: Peter Ent <[email protected]>
AuthorDate: Wed Mar 28 16:45:31 2018 -0400
mx.containers.Canvas compiles.
---
.../src/main/resources/mx-royale-manifest.xml | 1 +
.../src/main/royale/mx/containers/Canvas.as | 394 ++++++++++++++++
.../containers/utilityClasses/ConstraintColumn.as | 463 +++++++++++++++++++
.../mx/containers/utilityClasses/ConstraintRow.as | 513 +++++++++++++++++++++
.../containers/utilityClasses/IConstraintLayout.as | 99 ++++
5 files changed, 1470 insertions(+)
diff --git
a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
index 8f61fad..8170f60 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
+++ b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
@@ -35,6 +35,7 @@
<component id="TextInput" class="mx.controls.TextInput" />
<component id="Box" class="mx.containers.Box" />
+ <component id="Canvas" class="mx.containers.Canvas" />
<component id="Container" class="mx.core.Container" />
<component id="HBox" class="mx.containers.HBox" />
<component id="VBox" class="mx.containers.VBox" />
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Canvas.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Canvas.as
new file mode 100644
index 0000000..1d3e638
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Canvas.as
@@ -0,0 +1,394 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 mx.containers
+{
+ import org.apache.royale.events.Event;
+ import org.apache.royale.events.EventDispatcher;
+
+/*
+import flash.display.DisplayObject;
+import flash.geom.Rectangle;
+*/
+import mx.containers.utilityClasses.ConstraintColumn;
+import mx.containers.utilityClasses.ConstraintRow;
+/*
+import mx.containers.utilityClasses.CanvasLayout;
+*/
+import mx.containers.utilityClasses.IConstraintLayout;
+import mx.core.Container;
+import mx.core.EdgeMetrics;
+import mx.core.IUIComponent;
+/*
+import mx.core.mx_internal;
+import mx.styles.IStyleClient;
+
+use namespace mx_internal;
+*/
+
+/**
+ * A Halo Canvas layout container defines a rectangular region
+ * in which you place child containers and controls.
+ * It is the only container that lets you explicitly specify the location
+ * of its children within the container by using the <code>x</code> and
+ * <code>y</code> properties of each child.
+ *
+ * <p><b>Note:</b> Adobe recommends that, when possible, you use the Spark
containers
+ * with BasicLayout instead of the Halo Canvas container.</p>
+ *
+ * <p>Flex sets the children of a Canvas layout container to their
+ * preferred width and preferred height.
+ * You may override the value for a child's
+ * preferred width by setting its <code>width</code> property to either
+ * a fixed pixel value or a percentage of the container size.
+ * You can set the preferred height in a similar manner.</p>
+ *
+ * <p>If you use percentage sizing inside a Canvas container,
+ * some of your components may overlap.
+ * If this is not the effect you want, plan your component positions
+ * and sizes carefully.</p>
+ *
+ * <p>The Canvas container has the following default sizing
characteristics:</p>
+ * <table class="innertable">
+ * <tr>
+ * <th>Characteristic</th>
+ * <th>Description</th>
+ * </tr>
+ * <tr>
+ * <td>Default size</td>
+ * <td>Large enough to hold all its children at the default sizes of
the children</td>
+ * </tr>
+ * <tr>
+ * <td>Default padding</td>
+ * <td>0 pixels for the top, bottom, left, and right values</td>
+ * </tr>
+ * </table>
+ *
+ * @mxml
+ *
+ * <p>The <code><mx:Canvas></code> tag inherits all the tag attributes
+ * of its superclass. Use the following syntax:</p>
+ *
+ * <p>
+ * <pre>
+ * <mx:Canvas>
+ * ...
+ * <i>child tags</i>
+ * ...
+ * </mx:Canvas>
+ * </pre>
+ * </p>
+ *
+ * @includeExample examples/SimpleCanvasExample.mxml
+ *
+ * @see mx.core.Container
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class Canvas extends Container implements IConstraintLayout
+{
+
//--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function Canvas()
+ {
+ super();
+
+ //layoutObject.target = this;
+ }
+
+
//--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ //private var layoutObject:CanvasLayout = new CanvasLayout();
+
+
//--------------------------------------------------------------------------
+ //
+ // Overridden properties
+ //
+
//--------------------------------------------------------------------------
+
+ //----------------------------------
+ // usePadding
+ //----------------------------------
+
+ /**
+ * @private
+ */
+// override mx_internal function get usePadding():Boolean
+// {
+// // We never use padding.
+// return false;
+// }
+
+
//--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+
//--------------------------------------------------------------------------
+
+ //----------------------------------
+ // constraintColumns
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the constraintColumns property.
+ */
+ private var _constraintColumns:Array = [];
+
+ [ArrayElementType("mx.containers.utilityClasses.ConstraintColumn")]
+ [Inspectable(arrayType="mx.containers.utilityClasses.ConstraintColumn")]
+
+ /**
+ * @copy mx.containers.utilityClasses.IConstraintLayout#constraintColumns
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get constraintColumns():Array
+ {
+ return _constraintColumns;
+ }
+
+ /**
+ * @private
+ */
+ public function set constraintColumns(value:Array):void
+ {
+ if (value != _constraintColumns)
+ {
+ var n:int = value.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ ConstraintColumn(value[i]).container = this;
+ }
+ _constraintColumns = value;
+
+ //invalidateSize();
+ //invalidateDisplayList();
+ dispatchEvent(new Event("layoutNeeded"));
+ }
+ }
+
+ //----------------------------------
+ // constraintRows
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the constraintRows property.
+ */
+ private var _constraintRows:Array = [];
+
+ [ArrayElementType("mx.containers.utilityClasses.ConstraintRow")]
+ [Inspectable(arrayType="mx.containers.utilityClasses.ConstraintRow")]
+
+ /**
+ * @copy mx.containers.utilityClasses.IConstraintLayout#constraintRows
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get constraintRows():Array
+ {
+ return _constraintRows;
+ }
+
+ /**
+ * @private
+ */
+ public function set constraintRows(value:Array):void
+ {
+ if (value != _constraintRows)
+ {
+ var n:int = value.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ ConstraintRow(value[i]).container = this;
+ }
+ _constraintRows = value;
+
+ //invalidateSize();
+ //invalidateDisplayList();;
+ dispatchEvent(new Event("layoutNeeded"));
+ }
+ }
+
+
//--------------------------------------------------------------------------
+ //
+ // Overridden methods
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * Calculates the preferred minimum and preferred maximum sizes
+ * of the Canvas.
+ *
+ * <p>The <code>measuredWidth</code> of the Canvas is just large enough
+ * to display all of its children at their preferred widths
+ * without clipping them.
+ * This <code>measure()</code> method calculates the position of the
+ * right-most child, calculates the position of that child's right edge,
+ * and then adds room for the thickness of the Canvas container's border
+ * and the right padding.
+ * The <code>measuredHeight</code> is calculated similarly.</p>
+ *
+ * <p>The Canvas container's <code>minWidth</code> and
+ * <code>minHeight</code> properties are not calculated,
+ * so Flex uses a default value of 0.</p>
+ *
+ * <p>The Canvas container's <code>maxWidth</code> and
+ * <code>maxHeight</code> properties are not calculated.
+ * The container is assumed to have an infinite maximum
+ * width and height.</p>
+ *
+ * <p>All of the values described previously are the <i>measured</i>
widths
+ * and heights of Canvas.
+ * The user can override the measured values by calling the
+ * explicitly supplying a value
+ * for the following properties:</p>
+ *
+ * <ul>
+ * <li><code>width</code></li>
+ * <li><code>height</code></li>
+ * <li><code>minWidth</code></li>
+ * <li><code>minHeight</code></li>
+ * <li><code>maxWidth</code></li>
+ * <li><code>maxHeight</code></li>
+ * </ul>
+ *
+ * <p>You should not call this method directly.
+ * The Flex LayoutManager calls it at the appropriate time.
+ * At application startup, the Flex LayoutManager attempts to measure
+ * all components from the children to the parents before setting them
+ * to their final sizes.</p>
+ *
+ * <p>This is an advanced method for use in subclassing.
+ * If you override this method, your implementation must either
+ * call the <code>super.measure()</code> method or set the
+ * <code>measuredHeight</code> and
+ * <code>measuredWidth</code> properties.
+ * You may also optionally set the following properties:
+ * <ul>
+ * <li><code>measuredMinWidth</code></li>
+ * <li><code>measuredMinHeight</code></li>
+ * </ul>
+ * These properties correspond to the layout properties listed previously
+ * and, therefore, are not documented separately.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// override protected function measure():void
+// {
+// super.measure();
+//
+// layoutObject.measure();
+// }
+
+ /**
+ * Sets the size of each child of the container.
+ *
+ * <p>Canvas does not change the positions of its children.
+ * Each child is positioned according to the values of its
+ * <code>x</code> and <code>y</code> properties.</p>
+ *
+ * <p>Canvas does set each child's width and height to be equal
+ * to that child's <code>measuredWidth</code> and
+ * <code>measuredHeight</code> if no <code>width</code>
+ * and <code>height</code> values are supplied.
+ * The child can also be made resizable by setting
+ * <code>width</code> and/or <code>height</code> to a percent value.
+ * Resizable children are bound by the right and bottom edges
+ * of the Canvas container.
+ * In this case, the child's <code>minWidth</code>,
+ * <code>minHeight</code>, <code>maxWidth</code>, and
+ * <code>maxHeight</code> values are honored.</p>
+ *
+ * <p>You should not call this method directly.
+ * The Flex LayoutManager calls it at the appropriate time.
+ * At application startup, the Flex LayoutManager calls
+ * <code>updateDisplayList()</code> method on every component,
+ * starting with the Application object and working downward.</p>
+ *
+ * <p>This is an advanced method for use in subclassing.
+ * If you override this method, your implementation should call the
+ * <code>super.updateDisplayList()</code> method and call the
+ * <code>move()</code> and <code>setActualSize()</code> methods
+ * on each of the children.
+ * For the purposes of performing layout, you should get the size
+ * of this container from the <code>unscaledWidth</code> and
+ * <code>unscaledHeight</code> properties, not the <code>width</code>
+ * and <code>height</code> properties.
+ * The <code>width</code> and <code>height</code> properties
+ * do not take into account the value of the <code>scaleX</code>
+ * and <code>scaleY</code> properties for this container.</p>
+ *
+ * @param unscaledWidth Specifies the width of the component, in pixels,
+ * in the component's coordinates, regardless of the value of the
+ * <code>scaleX</code> property of the component.
+ *
+ * @param unscaledHeight Specifies the height of the component, in pixels,
+ * in the component's coordinates, regardless of the value of the
+ * <code>scaleY</code> property of the component.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+// override protected function updateDisplayList(unscaledWidth:Number,
+// unscaledHeight:Number):void
+// {
+// super.updateDisplayList(unscaledWidth, unscaledHeight);
+//
+// layoutObject.updateDisplayList(unscaledWidth, unscaledHeight);
+// }
+
+}
+
+}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/utilityClasses/ConstraintColumn.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/utilityClasses/ConstraintColumn.as
new file mode 100644
index 0000000..4e8de23
--- /dev/null
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/utilityClasses/ConstraintColumn.as
@@ -0,0 +1,463 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 mx.containers.utilityClasses
+{
+import org.apache.royale.events.Event;
+import org.apache.royale.events.EventDispatcher;
+
+/*
+import flash.events.Event;
+import flash.events.IEventDispatcher;
+*/
+import mx.core.IInvalidating;
+/*
+import mx.core.mx_internal;
+import mx.core.IMXMLObject;
+import flash.events.EventDispatcher;
+
+use namespace mx_internal;
+*/
+
+/**
+ * The ConstraintColumn class partitions an absolutely
+ * positioned container in the vertical plane.
+ *
+ * ConstraintColumn instances have 3 sizing options: fixed, percentage, and
+ * content. These options dictate the position of the
+ * constraint column, the amount of space the constraint column
+ * takes in the container, and how the constraint column deals with
+ * changes in the size of the container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ConstraintColumn extends EventDispatcher //implements IMXMLObject
+{
+
//--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ConstraintColumn()
+ {
+ super();
+ }
+
+
//--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+
//--------------------------------------------------------------------------
+ protected var contentSize:Boolean = false;
+
+
//--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+
//--------------------------------------------------------------------------
+
+ //----------------------------------
+ // container
+ //----------------------------------
+ /**
+ * @private
+ */
+ private var _container:IInvalidating;
+
+ /**
+ * The container which this ConstraintColumn instance is
+ * partitioning.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get container():IInvalidating
+ {
+ return _container;
+ }
+
+ /**
+ * @private
+ */
+ public function set container(value:IInvalidating):void
+ {
+ _container = value;
+ }
+
+ //----------------------------------
+ // id
+ //----------------------------------
+ /**
+ * @private
+ */
+ private var _id:String;
+
+ /**
+ * ID of the ConstraintColumn instance. This value becomes the instance
name of the
+ * ConstraintColumn instance and should not contain white space or
special characters.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get id():String
+ {
+ return _id;
+ }
+
+ /**
+ * @private
+ */
+ public function set id(value:String):void
+ {
+ _id = value;
+ }
+
+ //----------------------------------
+ // maxWidth
+ //----------------------------------
+ /**
+ * @private
+ * Storage for the maxWidth property.
+ */
+ private var _explicitMaxWidth:Number;
+ [Bindable("maxWidthChanged")]
+ [Inspectable(category="Size", defaultValue="10000")]
+
+ /**
+ * Number that specifies the maximum width of the ConstraintColumn
+ * instance, in pixels, in the ConstraintColumn instance's coordinates.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get maxWidth():Number
+ {
+ // Since ConstraintColumn doesn't have a measuredMaxWidth, we
explictly return
+ // the default value of 10000 when no maxWidth is set.
+ return (!isNaN(_explicitMaxWidth)) ? _explicitMaxWidth : 10000;
+ }
+
+ /**
+ * @private
+ */
+ public function set maxWidth(value:Number):void
+ {
+ if (_explicitMaxWidth != value)
+ {
+ _explicitMaxWidth = value;
+ if (container)
+ {
+ container.invalidateSize();
+ container.invalidateDisplayList();
+ }
+ dispatchEvent(new Event("maxWidthChanged"));
+ }
+ }
+
+ //----------------------------------
+ // minWidth
+ //----------------------------------
+ /**
+ * @private
+ * Storage for the minWidth property.
+ */
+ private var _explicitMinWidth:Number;
+ [Bindable("minWidthChanged")]
+ [Inspectable(category="Size", defaultValue="0")]
+
+ /**
+ * Number that specifies the minimum width of the ConstraintColumn
instance,
+ * in pixels, in the ConstraintColumn instance's coordinates.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get minWidth():Number
+ {
+ // Since ConstraintColumn doesn't have a measuredMinWidth, we
explictly return
+ // the default value of 0 when no minWidth is set.
+ return (!isNaN(_explicitMinWidth)) ? _explicitMinWidth : 0;
+ }
+
+ /**
+ * @private
+ */
+ public function set minWidth(value:Number):void
+ {
+ if (_explicitMinWidth != value)
+ {
+ _explicitMinWidth = value;
+ if (container)
+ {
+ container.invalidateSize();
+ container.invalidateDisplayList();
+ }
+ dispatchEvent(new Event("minWidthChanged"));
+ }
+ }
+
+ //----------------------------------
+ // width
+ //----------------------------------
+ /**
+ * @private
+ * Storage for the width property.
+ */
+ protected var _width:Number;
+ [Bindable("widthChanged")]
+ [Inspectable(category="General")]
+ [PercentProxy("percentWidth")]
+
+ /**
+ * Number that specifies the width of the ConstraintColumn instance, in
pixels,
+ * in the parent container's coordinates.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get width():Number
+ {
+ return _width;
+ }
+
+ /**
+ * @private
+ */
+ public function set width(value:Number):void
+ {
+ if (explicitWidth != value)
+ {
+ explicitWidth = value;
+ if (_width != value)
+ {
+ _width = value;
+ if (!isNaN(_width))
+ contentSize = false;
+ if (container)
+ {
+ container.invalidateSize();
+ container.invalidateDisplayList();
+ }
+ dispatchEvent(new Event("widthChanged"));
+ }
+ }
+ }
+
+ //----------------------------------
+ // explicitWidth
+ //----------------------------------
+ /**
+ * @private
+ * Storage for the explicitWidth property.
+ */
+
+ private var _explicitWidth:Number;
+ [Inspectable(environment="none")]
+ [Bindable("explicitWidthChanged")]
+
+ /**
+ * Number that specifies the explicit width of the ConstraintColumn
instance,
+ * in pixels, in the ConstraintColumn instance's coordinates.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get explicitWidth():Number
+ {
+ return _explicitWidth;
+ }
+
+ /**
+ * @private
+ */
+ public function set explicitWidth(value:Number):void
+ {
+ if (_explicitWidth == value)
+ return;
+
+ // width can be pixel or percent not both
+ if (!isNaN(value))
+ _percentWidth = NaN;
+
+ _explicitWidth = value;
+
+ if (container)
+ {
+ container.invalidateSize();
+ container.invalidateDisplayList();
+ }
+
+ dispatchEvent(new Event("explicitWidthChanged"));
+ }
+
+ //----------------------------------
+ // percentWidth
+ //----------------------------------
+ /**
+ * @private
+ * Storage for the percentWidth property.
+ */
+ private var _percentWidth:Number;
+ [Bindable("percentWidthChanged")]
+ [Inspectable(environment="none")]
+
+ /**
+ * Number that specifies the width of a component as a percentage of its
+ * parent container's size. Allowed values are 0-100. The default value
is NaN.
+ * Setting the <code>width</code> property resets this property to NaN.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get percentWidth():Number
+ {
+ return _percentWidth;
+ }
+
+ /**
+ * @private
+ */
+ public function set percentWidth(value:Number):void
+ {
+ if (_percentWidth == value)
+ return;
+
+ if (!isNaN(value))
+ _explicitWidth = NaN;
+
+ _percentWidth = value;
+ if (!isNaN(_percentWidth))
+ contentSize = false;
+
+ if (container)
+ {
+ container.invalidateSize();
+ container.invalidateDisplayList();
+ }
+
+ dispatchEvent(new Event("percentWidthChanged"));
+ }
+
+ //----------------------------------
+ // x
+ //----------------------------------
+ private var _x:Number;
+ [Bindable("xChanged")]
+
+ /**
+ * @private
+ */
+ public function get x():Number
+ {
+ return _x;
+ }
+
+ /**
+ * @private
+ */
+ public function set x(value:Number):void
+ {
+ if (value != _x)
+ {
+ _x = value;
+ dispatchEvent(new Event("xChanged"));
+ }
+ }
+
+
//--------------------------------------------------------------------------
+ //
+ // Methods: IMXMLObject
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * Called automatically by the MXML compiler when the ConstraintColumn
+ * instance is created using an MXML tag.
+ * If you create the ConstraintColumn instance through ActionScript, you
+ * must call this method passing in the MXML document and
+ * <code>null</code> for the <code>id</code>.
+ *
+ * @param document The MXML document containing this ConstraintColumn.
+ *
+ * @param id Ignored.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function initialized(document:Object, id:String):void
+ {
+ this.id = id;
+ if (!this.width && !this.percentWidth)
+ contentSize = true;
+ }
+
+ /**
+ * Sizes the constraint column.
+ *
+ * @param width Width of constaint column computed during parent
container
+ * processing.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function setActualWidth(w:Number):void
+ {
+ if (_width != w)
+ {
+ _width = w;
+ dispatchEvent(new Event("widthChanged"));
+ }
+ }
+
+}
+
+}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/utilityClasses/ConstraintRow.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/utilityClasses/ConstraintRow.as
new file mode 100644
index 0000000..706a69e
--- /dev/null
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/utilityClasses/ConstraintRow.as
@@ -0,0 +1,513 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 mx.containers.utilityClasses
+{
+import org.apache.royale.events.Event;
+import org.apache.royale.events.EventDispatcher;
+
+/*
+import flash.events.Event;
+import flash.events.IEventDispatcher;
+*/
+import mx.core.IInvalidating;
+/*
+import mx.core.mx_internal;
+import mx.core.IMXMLObject;
+import flash.events.EventDispatcher;
+
+use namespace mx_internal;
+*/
+
+/**
+ * ConstraintRow class partitions an absolutely
+ * positioned container in the horizontal plane.
+ *
+ * ConstraintRow instances have 3 sizing options: fixed, percentage,
+ * and content. These options dictate the position of the constraint row,
+ * the amount of space the constraint row takes in the container, and
+ * how the constraint row deals with a change in the size of the container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ConstraintRow extends EventDispatcher //implements IMXMLObject
+{
+
//--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ConstraintRow()
+ {
+ super();
+ }
+
+
//--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+
//--------------------------------------------------------------------------
+ protected var contentSize:Boolean = false;
+
+
+
//--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+
//--------------------------------------------------------------------------
+
+ //----------------------------------
+ // baseline
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the baseline property.
+ */
+ private var _baseline:Object = "maxAscent:0";
+ [Bindable("baselineChanged")]
+ [Inspectable(category="General")]
+
+ /**
+ * Number that specifies the baseline of the ConstraintRow instance, in
pixels,
+ * either relative to the top edge of the row or to the max ascent of the
+ * elements contained in this row.
+ *
+ * @default "maxAscent:0"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get baseline():Object
+ {
+ return _baseline;
+ }
+
+ /**
+ * @private
+ */
+ public function set baseline(value:Object):void
+ {
+ if (_baseline != value)
+ {
+ _baseline = value;
+
+ if (container)
+ {
+ container.invalidateSize();
+ container.invalidateDisplayList();
+ }
+ dispatchEvent(new Event("baselineChanged"));
+ }
+ }
+
+ //----------------------------------
+ // container
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _container:IInvalidating;
+
+ /**
+ * The container being partitioned by this ConstraintRow instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get container():IInvalidating
+ {
+ return _container;
+ }
+
+ /**
+ * @private
+ */
+ public function set container(value:IInvalidating):void
+ {
+ _container = value;
+ }
+
+ //----------------------------------
+ // height
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the height property.
+ */
+ protected var _height:Number;
+ [Bindable("heightChanged")]
+ [Inspectable(category="General")]
+ [PercentProxy("percentHeight")]
+
+ /**
+ * Number that specifies the height of the ConstraintRow instance, in
pixels,
+ * in the parent's coordinates.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get height():Number
+ {
+ return _height;
+ }
+
+ /**
+ * @private
+ */
+ public function set height(value:Number):void
+ {
+ if (explicitHeight != value)
+ {
+ explicitHeight = value;
+ if (_height != value)
+ {
+ _height = value;
+ if (!isNaN(_height))
+ contentSize = false;
+ if (container)
+ {
+ container.invalidateSize();
+ container.invalidateDisplayList();
+ }
+ dispatchEvent(new Event("heightChanged"));
+ }
+ }
+ }
+
+ //----------------------------------
+ // explicitHeight
+ //----------------------------------
+ /**
+ * @private
+ * Storage for the explicitHeight property.
+ */
+
+ private var _explicitHeight:Number;
+ [Inspectable(environment="none")]
+ [Bindable("explicitHeightChanged")]
+
+ /**
+ * Number that specifies the explicit height of the
+ * ConstraintRow instance, in pixels, in the ConstraintRow
+ * instance's coordinates.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get explicitHeight():Number
+ {
+ return _explicitHeight;
+ }
+
+ /**
+ * @private
+ */
+ public function set explicitHeight(value:Number):void
+ {
+ if (_explicitHeight == value)
+ return;
+
+ // height can be pixel or percent not both
+ if (!isNaN(value))
+ _percentHeight = NaN;
+
+ _explicitHeight = value;
+
+ if (container)
+ {
+ container.invalidateSize();
+ container.invalidateDisplayList();
+ }
+
+ dispatchEvent(new Event("explicitHeightChanged"));
+ }
+
+ //----------------------------------
+ // id
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _id:String;
+
+ /**
+ * ID of the ConstraintRow instance. This value becomes the instance name
+ * of the constraint row and should not contain white space or special
+ * characters.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get id():String
+ {
+ return _id;
+ }
+
+ /**
+ * @private
+ */
+ public function set id(value:String):void
+ {
+ _id = value;
+ }
+
+ //----------------------------------
+ // maxHeight
+ //----------------------------------
+ /**
+ * @private
+ * Storage for the maxHeight property.
+ */
+ private var _explicitMaxHeight:Number;
+ [Bindable("maxHeightChanged")]
+ [Inspectable(category="Size", defaultValue="10000")]
+
+ /**
+ * Number that specifies the maximum height of the ConstraintRow instance,
+ * in pixels, in the ConstraintRow instance's coordinates.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get maxHeight():Number
+ {
+ // Since ConstraintRow doesn't have a measuredMaxHeight, we explictly
return
+ // the default value of 10000 when no maxHeight is set.
+ return (!isNaN(_explicitMaxHeight)) ? _explicitMaxHeight : 10000;
+ }
+
+ /**
+ * @private
+ */
+ public function set maxHeight(value:Number):void
+ {
+ if (_explicitMaxHeight != value)
+ {
+ _explicitMaxHeight = value;
+ if (container)
+ {
+ container.invalidateSize();
+ container.invalidateDisplayList();
+ }
+ dispatchEvent(new Event("maxHeightChanged"));
+ }
+ }
+
+ //----------------------------------
+ // minHeight
+ //----------------------------------
+ /**
+ * @private
+ * Storage for the minHeight property.
+ */
+ private var _explicitMinHeight:Number;
+ [Bindable("minHeightChanged")]
+ [Inspectable(category="Size", defaultValue="0")]
+
+ /**
+ * Number that specifies the minimum height of the ConstraintRow instance,
+ * in pixels, in the ConstraintRow instance's coordinates.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get minHeight():Number
+ {
+ // Since ConstraintRow doesn't have a measuredMinHeight, we explictly
return
+ // the default value of 0 when no minHeight is set.
+ return (!isNaN(_explicitMinHeight)) ? _explicitMinHeight : 0;
+ }
+
+ /**
+ * @private
+ */
+ public function set minHeight(value:Number):void
+ {
+ if (_explicitMinHeight != value)
+ {
+ _explicitMinHeight = value;
+ if (container)
+ {
+ container.invalidateSize();
+ container.invalidateDisplayList();
+ }
+ dispatchEvent(new Event("minHeightChanged"));
+ }
+ }
+
+ //----------------------------------
+ // percentHeight
+ //----------------------------------
+ /**
+ * @private
+ * Storage for the percentHeight property.
+ */
+ private var _percentHeight:Number;
+ [Bindable("percentHeightChanged")]
+ [Inspectable(environment="none")]
+
+ /**
+ * Number that specifies the height of a component as a percentage
+ * of its parent's size. Allowed values are 0-100. The default value is
NaN.
+ * Setting the <code>width</code> property resets this property to NaN.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get percentHeight():Number
+ {
+ return _percentHeight;
+ }
+
+ /**
+ * @private
+ */
+ public function set percentHeight(value:Number):void
+ {
+ if (_percentHeight == value)
+ return;
+
+ if (!isNaN(value))
+ _explicitHeight = NaN;
+
+ _percentHeight = value;
+ if (!isNaN(_percentHeight))
+ contentSize = false;
+
+ if (container)
+ {
+ container.invalidateSize();
+ container.invalidateDisplayList();
+ }
+ }
+
+ //----------------------------------
+ // y
+ //----------------------------------
+ private var _y:Number;
+ [Bindable("yChanged")]
+
+ /**
+ * @private
+ */
+ public function get y():Number
+ {
+ return _y;
+ }
+
+ /**
+ * @private
+ */
+ public function set y(value:Number):void
+ {
+ if (value != _y)
+ {
+ _y = value;
+ dispatchEvent(new Event("yChanged"));
+ }
+ }
+
+
//--------------------------------------------------------------------------
+ //
+ // Methods: IMXMLObject
+ //
+
//--------------------------------------------------------------------------
+
+ /**
+ * Called automatically by the MXML compiler when the ConstraintRow
+ * instance is created using an MXML tag.
+ * If you create the constraint row through ActionScript, you
+ * must call this method passing in the MXML document and
+ * <code>null</code> for the <code>id</code>.
+ *
+ * @param document The MXML document containing this ConstraintRow.
+ *
+ * @param id Ignored.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function initialized(document:Object, id:String):void
+ {
+ this.id = id;
+ if (!this.height && !this.percentHeight)
+ contentSize = true;
+ }
+
+ /**
+ * Sizes the ConstraintRow
+ *
+ * @param height Height of constaint row computed during parent container
+ * processing.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function setActualHeight(h:Number):void
+ {
+ if (_height != h)
+ {
+ _height = h;
+ dispatchEvent(new Event("heightChanged"));
+ }
+ }
+
+}
+
+}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/utilityClasses/IConstraintLayout.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/utilityClasses/IConstraintLayout.as
new file mode 100644
index 0000000..9fcb43b
--- /dev/null
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/utilityClasses/IConstraintLayout.as
@@ -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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.containers.utilityClasses
+{
+
+/**
+ * IConstraintLayout is a marker interface that indicates that a container
+ * supports ConstraintColumn class and ConstraintRow class within its layout.
+ * Application, Canvas, and Panel containers support ConstraintRow and
+ * ConstraintColumn classes.
+ * To utilize this type of constraint in these containers,
+ * set the <code>layout</code> property to <code>"absolute"</code>
+ * and create ConstraintColumn and ConstraintRow instances.
+ *
+ * @see mx.containers.Canvas
+ * @see mx.containers.Panel
+ * @see mx.core.Application
+ * @see mx.containers.utilityClasses.ConstraintColumn
+ * @see mx.containers.utilityClasses.ConstraintRow
+ * @see mx.modules.Module
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IConstraintLayout
+{
+
//--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+
//--------------------------------------------------------------------------
+
+ //----------------------------------
+ // constraintColumns
+ //----------------------------------
+
+ /**
+ * An Array of ConstraintColumn instances that partition this container.
+ * The ConstraintColumn instance at index 0 is the left-most column;
+ * indices increase from left to right.
+ *
+ * @default []
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get constraintColumns():Array /* of ConstraintColumn */;
+
+ /**
+ * @private
+ */
+ function set constraintColumns(value:Array /* of ConstraintColumn */):void;
+
+ //----------------------------------
+ // constraintRows
+ //----------------------------------
+
+ /**
+ * An Array of ConstraintRow instances that partition this container.
+ * The ConstraintRow instance at index 0 is the top-most row;
+ * indices increase from top to bottom.
+ *
+ * @default []
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get constraintRows():Array /* of ConstraintRow */;
+
+ /**
+ * @private
+ */
+ function set constraintRows(value:Array /* of ConstraintRow */):void;
+}
+
+}
--
To stop receiving notification emails like this one, please contact
[email protected].