flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/4] git commit: [flex-asjs] [refs/heads/develop] - next incarnation of layout. Padding is now the responsibility of the layouts (layouts still need upgrading to handle padding correctly). ViewportModel is only used by ContainerViews and not layouts.
Date Thu, 03 Sep 2015 13:02:42 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 6f12327c1 -> 3a9e1cc2e


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cf3994fe/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/Viewport.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/Viewport.js
b/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/Viewport.js
index d200b8e..47d5ad7 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/Viewport.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/Viewport.js
@@ -15,12 +15,17 @@
 goog.provide('org.apache.flex.html.supportClasses.Viewport');
 
 goog.require('org.apache.flex.core.IBead');
+goog.require('org.apache.flex.core.IContentView');
 goog.require('org.apache.flex.core.IViewport');
+goog.require('org.apache.flex.geom.Rectangle');
+goog.require('org.apache.flex.geom.Size');
 
 
 
 /**
  * @constructor
+ * @implements {org.apache.flex.core.IBead}
+ * @implements {org.apache.flex.core.IViewport}
  */
 org.apache.flex.html.supportClasses.Viewport =
 function() {
@@ -40,29 +45,67 @@ org.apache.flex.html.supportClasses.Viewport.prototype.FLEXJS_CLASS_INFO
=
 
 
 /**
- *
+ * @protected
+ * @type {Object}
+ */
+org.apache.flex.html.supportClasses.Viewport.prototype._strand = null;
+
+
+/**
+ * @type {org.apache.flex.html.supportClasses.ContainerContentArea}
+ */
+org.apache.flex.html.supportClasses.Viewport.prototype.contentView = null;
+
+
+/**
+ * @param {number} x The x position of the viewport.
+ * @param {number} y The y position of the viewport.
  */
-org.apache.flex.html.supportClasses.Viewport.prototype.updateSize = function() {
+org.apache.flex.html.supportClasses.Viewport.prototype.setPosition =
+   function(x, y) {
+  this.contentView.x = x;
+  this.contentView.y = y;
 };
 
 
 /**
- *
+ * @param {number} width The width or NaN if sized to content.
+ * @param {number} height The height or NaN if sized to content.
+ */
+org.apache.flex.html.supportClasses.Viewport.prototype.layoutViewportBeforeContentLayout
=
+   function(width, height) {
+  if (!isNaN(width))
+    this.contentView.width = width;
+  if (!isNaN(height))
+    this.contentView.height = height;
+};
+
+
+/**
+ * @return {org.apache.flex.geom.Size}
  */
-org.apache.flex.html.supportClasses.Viewport.prototype.updateContentAreaSize = function()
{
+org.apache.flex.html.supportClasses.Viewport.prototype.layoutViewportAfterContentLayout =
+   function() {
+  // nothing to do here?  In theory, the layout and browser will have stretched or shrunk
+  // the contentView to the right size
+  return new org.apache.flex.geom.Size(this.contentView.width, this.contentView.height);
 };
 
 
 Object.defineProperties(org.apache.flex.html.supportClasses.Viewport.prototype, {
     /** @export */
-    model: {
-        /** @this {org.apache.flex.html.supportClasses.Viewport} */
-        get: function() {
-            return this.model_;
-        },
+    strand: {
         /** @this {org.apache.flex.html.supportClasses.Viewport} */
         set: function(value) {
-            this.model_ = value;
-        }
+            this._strand = value;
+            this.contentView = this._strand.getBeadByType(org.apache.flex.core.IContentView);
+            if (this.contentView == null) {
+              var c = org.apache.flex.core.ValuesManager.valuesImpl.getValue(
+                       this._strand, 'iContentView');
+              if (c)
+                this.contentView = new c();
+            }
+            this.contentView.element.style.overflow = 'visible';
+         }
     }
 });

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cf3994fe/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/StackedViewManagerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/StackedViewManagerView.as
b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/StackedViewManagerView.as
index a38d2aa..fd1a58b 100644
--- a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/StackedViewManagerView.as
+++ b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/StackedViewManagerView.as
@@ -22,7 +22,6 @@ package org.apache.flex.mobile.beads
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.IViewportModel;
 	import org.apache.flex.core.UIBase;
-	import org.apache.flex.core.UIMetrics;
 	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.html.beads.ContainerView;
@@ -30,7 +29,6 @@ package org.apache.flex.mobile.beads
 	import org.apache.flex.mobile.chrome.NavigationBar;
 	import org.apache.flex.mobile.chrome.ToolBar;
 	import org.apache.flex.mobile.models.ViewManagerModel;
-	import org.apache.flex.utils.BeadMetrics;
 
 	/**
 	 * The StackedViewManagerView creates the visual elements of the StackedViewManager. This

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cf3994fe/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/TabbedViewManagerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/TabbedViewManagerView.as
b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/TabbedViewManagerView.as
index de5fc92..be20d2c 100644
--- a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/TabbedViewManagerView.as
+++ b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/TabbedViewManagerView.as
@@ -22,7 +22,6 @@ package org.apache.flex.mobile.beads
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.IViewportModel;
 	import org.apache.flex.core.UIBase;
-	import org.apache.flex.core.UIMetrics;
 	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.html.beads.ContainerView;
@@ -30,7 +29,6 @@ package org.apache.flex.mobile.beads
 	import org.apache.flex.mobile.chrome.NavigationBar;
 	import org.apache.flex.mobile.chrome.TabBar;
 	import org.apache.flex.mobile.models.ViewManagerModel;
-	import org.apache.flex.utils.BeadMetrics;
 	
 	/**
 	 * The TabbedViewManagerView constructs the visual elements of the TabbedViewManager. The

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cf3994fe/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/ViewManagerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/ViewManagerView.as
b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/ViewManagerView.as
index 9e56ca3..59baf94 100644
--- a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/ViewManagerView.as
+++ b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/ViewManagerView.as
@@ -24,7 +24,6 @@ package org.apache.flex.mobile.beads
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.IViewportModel;
 	import org.apache.flex.core.UIBase;
-	import org.apache.flex.core.UIMetrics;
 	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.html.Container;
@@ -32,7 +31,6 @@ package org.apache.flex.mobile.beads
 	import org.apache.flex.mobile.IView;
 	import org.apache.flex.mobile.chrome.NavigationBar;
 	import org.apache.flex.mobile.models.ViewManagerModel;
-	import org.apache.flex.utils.BeadMetrics;
 	
 	/**
 	 * The ViewManagerView creates the visual elements of the StackedViewManager. This


Mime
View raw message