[Laszlo-checkins] r11268 - openlaszlo/trunk/WEB-INF/lps/lfc/data
bargull@openlaszlo.org
bargull at openlaszlo.org
Mon Sep 29 01:19:37 PDT 2008
Author: bargull
Date: 2008-09-29 01:19:33 -0700 (Mon, 29 Sep 2008)
New Revision: 11268
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataNode.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs
Log:
Change 20080928-bargull-iHa by bargull at dell--p4--2-53 on 2008-09-28 20:04:17
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: resize replication in swf9
New Features:
Bugs Fixed: LPP-7082
Technical Reviewer: hminsky
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
LzResizeReplicationManager tried to add properties to a non-dynamic class (LzDataNodeMixin), which failed obviously.
Therefore I've added "__LZgetSize/setSize" to LzDataNodeMixin to track the view size for the replication manager.
Tests:
attached at bugreport
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataNode.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataNode.lzs 2008-09-29 08:00:06 UTC (rev 11267)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataNode.lzs 2008-09-29 08:19:33 UTC (rev 11268)
@@ -65,8 +65,7 @@
* don't set it here!
*/
-mixin LzDataNodeMixin
-{
+mixin LzDataNodeMixin {
/** @lzxtype event */
var onownerDocument :LzDeclaredEventClass = LzDeclaredEvent;
/** @lzxtype event */
@@ -105,12 +104,17 @@
/** @access private */
var __LZcoDirty :Boolean = true;
+/**
+ * @devnote: used to track view-sizes, see LzResizeReplicationManager
+ * @access private
+ */
+var __LZsize :Object;
/**
* Returns the parent of this node
- * @return LzDataNodeMixin: the parent of this node
+ * @return LzDataElementMixin: the parent of this node
*/
-public function getParent () {
+public function getParent () /*:LzDataElementMixin*/ {
return this.parentNode;
}
@@ -129,7 +133,7 @@
* Returns the sibling before this one this node's parentNodes List of children
* @return LzDataNodeMixin: The node preceeding this one in this node's childNodes
*/
-public function getPreviousSibling (){
+public function getPreviousSibling () /*:LzDataNodeMixin*/ {
if (!this.parentNode) return null;
if ( this.parentNode.__LZcoDirty ) this.parentNode.__LZupdateCO();
return this.parentNode.childNodes[ this.__LZo - 1 ];
@@ -144,7 +148,7 @@
* Returns the sibling after this one this node's parentNodes List of children
* @return LzDataNodeMixin: The node succeeding this one in this node's childNodes
*/
-public function getNextSibling (){
+public function getNextSibling () /*:LzDataNodeMixin*/ {
if (!this.parentNode) return null;
if ( this.parentNode.__LZcoDirty ) this.parentNode.__LZupdateCO();
return this.parentNode.childNodes[ this.__LZo + 1 ];
@@ -186,7 +190,7 @@
* @param LzDataNodeMixin ownerDoc: The LzDataNodeMixin to act as the ownerDocument for
* this node.
*/
-public function setOwnerDocument ( ownerDoc ){
+public function setOwnerDocument ( ownerDoc ) :void {
this.ownerDocument = ownerDoc;
if (this.childNodes) {
for ( var i:int = 0; i < this.childNodes.length; i++ ){
@@ -220,17 +224,32 @@
/**
* @access private
*/
-function __LZlockFromUpdate ( locker:LzDatapath ){
+function __LZlockFromUpdate (locker:LzDatapath) :void {
this.ownerDocument.__LZdoLock( locker );
}
/**
* @access private
*/
-function __LZunlockFromUpdate ( locker:LzDatapath ){
+function __LZunlockFromUpdate (locker:LzDatapath) :void {
this.ownerDocument.__LZdoUnlock( locker );
}
+/**
+ * @access private
+ */
+function __LZgetSize (k:String) :* {
+ return this.__LZsize && this.__LZsize[k];
+}
+
+/**
+ * @access private
+ */
+function __LZsetSize (k:String, v:*) :void {
+ if (! this.__LZsize) this.__LZsize = {};
+ this.__LZsize[k] = v;
+}
+
} // End of LzDataNodeMixin
lz.DataNodeMixin = LzDataNodeMixin; // publish
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs 2008-09-29 08:00:06 UTC (rev 11267)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzResizeReplicationManager.lzs 2008-09-29 08:19:33 UTC (rev 11268)
@@ -122,14 +122,16 @@
* @devnote: This could be a closure over the cloneManager, but we
* believe this is a more efficient implementation
*/
-var __LZHandleCloneResize = function ( s:Number ) {
- if (! this.datapath.p) return;
- var cloneManager:LzResizeReplicationManager = this.cloneManager cast LzResizeReplicationManager;
- var datasizevar:String = cloneManager.datasizevar;
- var osize:Number = this.datapath.p[ datasizevar ] || cloneManager.viewsize;
- if ( s != osize ){
- this.datapath.p[ datasizevar ] = s;
- cloneManager.__LZadjustVisibleClones(null, false);
+var __LZHandleCloneResize = function ( s:Number ) :void {
+ var p /*:LzDataNodeMixin*/ = this.datapath.p;
+ if (p) {
+ var cloneManager:LzResizeReplicationManager = this.cloneManager cast LzResizeReplicationManager;
+ var datasizevar:String = cloneManager.datasizevar;
+ var osize:Number = p.__LZgetSize(datasizevar) || cloneManager.viewsize;
+ if (s != osize) {
+ p.__LZsetSize(datasizevar, s);
+ cloneManager.__LZadjustVisibleClones(null, false);
+ }
}
}
@@ -163,7 +165,7 @@
return pos + this.spacing;
}
- pos += this.spacing + ( cnode[this.datasizevar] || this.viewsize );
+ pos += this.spacing + ( cnode.__LZgetSize(this.datasizevar) || this.viewsize );
}
}
}
@@ -221,7 +223,7 @@
var notfirst:Boolean = true;
for ( var i:int = 0; i < nodelen; i++ ){
var cnode /*:LzDataNodeMixin*/ = this.nodes[ i ];
- var ds:* = cnode[ this.datasizevar ];
+ var ds:* = cnode.__LZgetSize(this.datasizevar);
var csiz:Number = ( ds == null ) ? this.viewsize : ds;
cpos += this.spacing;
@@ -297,7 +299,7 @@
this.clones[ i ] = cl;
cl.setAttribute( this.axis , clpos );
- var ds:* = cnode[ this.datasizevar ];
+ var ds:* = cnode.__LZgetSize(this.datasizevar);
var csiz:Number = ( ds == null ) ? this.viewsize : ds;
if ( cl[ this.sizeAxis ] != csiz ){
cl.setAttribute( this.sizeAxis, csiz, true );
More information about the Laszlo-checkins
mailing list