OSDN Git Service

Version 0.6.23, remove AbstractBox(AbstractDisplayContainer), working ie-filter-fix.
authoritozyun <itozyun@user.sourceforge.jp>
Thu, 27 Feb 2014 22:47:37 +0000 (07:47 +0900)
committeritozyun <itozyun@user.sourceforge.jp>
Thu, 27 Feb 2014 22:47:37 +0000 (07:47 +0900)
18 files changed:
0.6.x/index.html
0.6.x/js/dom/10_XDom.js
0.6.x/js/dom/11_XDomNode.js
0.6.x/js/dom/12_XDomEvent.js
0.6.x/js/dom/13_XDomBoxModel.js
0.6.x/js/dom/15_XDomStyle.js
0.6.x/js/dom/18_XDomQuery.js
0.6.x/js/ui/06_AbstractUINode.js
0.6.x/js/ui/07_LayoutManagerBase.js [moved from 0.6.x/js/ui/09_LayoutManagerBase.js with 100% similarity]
0.6.x/js/ui/08_Box.js [moved from 0.6.x/js/ui/07_AbstractBox.js with 80% similarity]
0.6.x/js/ui/09_UINodeStyle.js [moved from 0.6.x/js/ui/08_UINodeStyle.js with 100% similarity]
0.6.x/js/ui/10_Box.js [deleted file]
0.6.x/js/ui/11_VBox.js
0.6.x/js/ui/12_HBox.js
0.6.x/js/ui/13_TileBox.js
0.6.x/js/ui/14_ChromeBox.js
0.6.x/js/ui/16_PageRoot.js
0.6.x/js/ui/17_Text.js

index e0b0832..7334e49 100644 (file)
 \r
 <script type="text/javascript" src="js/ui/05_XUI_Gesture.js"></script>\r
 <script type="text/javascript" src="js/ui/06_AbstractUINode.js"></script>\r
-<script type="text/javascript" src="js/ui/07_AbstractBox.js"></script>\r
-<script type="text/javascript" src="js/ui/08_UINodeStyle.js"></script>\r
-<script type="text/javascript" src="js/ui/09_LayoutManagerBase.js"></script>\r
-<script type="text/javascript" src="js/ui/10_Box.js"></script>\r
+<script type="text/javascript" src="js/ui/07_LayoutManagerBase.js"></script>\r
+<script type="text/javascript" src="js/ui/08_Box.js"></script>\r
+<script type="text/javascript" src="js/ui/09_UINodeStyle.js"></script>\r
 <script type="text/javascript" src="js/ui/11_VBox.js"></script>\r
 <script type="text/javascript" src="js/ui/12_HBox.js"></script>\r
 <script type="text/javascript" src="js/ui/13_TileBox.js"></script>\r
 <script type="text/javascript" src="js/ui/14_ChromeBox.js"></script>\r
-<script type="text/javascript" src="js/ui/15_ScrollBox.js"></script>\r
+<!--<script type="text/javascript" src="js/ui/15_ScrollBox.js"></script>-->\r
 <script type="text/javascript" src="js/ui/16_PageRoot.js"></script>\r
 <script type="text/javascript" src="js/ui/17_Text.js"></script>\r
 \r
index 9ecf64f..2e6cbfa 100644 (file)
@@ -56,7 +56,7 @@
                                \r
                        },\r
                        _init : function(){\r
-                               var s, size, b, x;\r
+                               var s, size;\r
                                if( X.Dom.Event.DOM_PRE_INIT <= X.Dom.readyState ) return X.Callback.UN_LISTEN;\r
                                if( s = X.Dom._script ){\r
                                        s.parentNode.removeChild( s );\r
index 37e3a18..775796d 100644 (file)
@@ -6,7 +6,8 @@ X.Dom.Dirty = {
        CLASSNAME        :  4, // _getCharSize, width, height, x, y\r
        CSS              :  8, // _getCharSize, width, height, x, y\r
        ATTR             : 16,  // _getCharSize, width, height, x, y\r
-       IE4_TEXTNODE_FIX : 32\r
+       IE_FILTER        : X.UA.IE && X.UA.IE < 9 ? 32 : 0,\r
+       IE4_TEXTNODE_FIX : 64\r
 };\r
 \r
 /*\r
@@ -104,7 +105,6 @@ X.Dom.Node = X.EventDispatcher.inherits(
                                                this._className = v.className;\r
                                                this.cssText( v.style.cssText );\r
                                                // X.Dom.Dirty.CSS を落とす\r
-                                               this._dirty    &= ~X.Dom.Dirty.CSS;\r
                                                this._dirty = 0;\r
                                                // attr の回収は不可能、、、\r
                                                if( X.UA.IE && X.UA.IE < 5 ){\r
@@ -890,7 +890,7 @@ Node.prototype._commitUpdate =
 Node.prototype._updateRawNode =\r
        document.getElementById ?\r
                ( function( elm ){\r
-                       var attrs, k, v;\r
+                       var attrs, rename, k, v;\r
 \r
                        // textNode\r
                        if( this._dirty & X.Dom.Dirty.CONTENT ){\r
@@ -911,12 +911,18 @@ Node.prototype._updateRawNode =
                                        delete this._cssText;\r
                                };\r
                        };\r
+                       \r
+                       if( this._dirty & X.Dom.Dirty.IE_FILTER ){\r
+                               this._rawNode.style.filter = X.Dom.Style.SPECIAL_FIX( this._css );\r
+                       };\r
+                       \r
                        // attr\r
                        if( this._dirty & X.Dom.Dirty.ATTR && ( attrs = this._newAttrs || this._attrs ) ){\r
+                               rename = X.Dom.Attr.renameForDOM;\r
                                for( k in attrs ){\r
                                        ( v = attrs[ k ] ) === undefined ?\r
-                                               elm.removeAttribute( k ) :\r
-                                               ( elm[ k ] = v );\r
+                                               elm.removeAttribute( rename[ k ] || k ) :\r
+                                               ( elm[ rename[ k ] || k ] = v );\r
                                };\r
                                delete this._newAttrs;\r
                        };\r
@@ -925,7 +931,7 @@ Node.prototype._updateRawNode =
                }) :\r
        document.all ? \r
                ( function( elm ){\r
-                       var attrs, k, v;\r
+                       var attrs, rename, k, v;\r
 \r
                        // fake textNode\r
                        if( this._dirty & X.Dom.Dirty.CONTENT ){\r
@@ -939,7 +945,8 @@ Node.prototype._updateRawNode =
                 * title、className、id、lang、language には setAttribute でなく、element.id で直接読み書きできる\r
                 */     \r
                        // id\r
-                       if( this._dirty & X.Dom.Dirty.CONTENT ) elm.id = this._id || ( 'ie4uid' + this._uid );\r
+                       if( this._dirty & X.Dom.Dirty.CONTENT ) elm.setAttribute( 'id', this._id || ( 'ie4uid' + xnode._uid ) );\r
+\r
                        // className\r
                        if( this._dirty & X.Dom.Dirty.CLASSNAME ) elm.className = this._className;\r
                        // style\r
@@ -951,13 +958,18 @@ Node.prototype._updateRawNode =
                                        delete this._cssText;\r
                                };\r
                        };\r
+                       \r
+                       if( this._dirty & X.Dom.Dirty.IE_FILTER ){\r
+                               this._rawNode.style.filter = X.Dom.Style.SPECIAL_FIX( this._css );\r
+                       };\r
+                       \r
                        // attr\r
                        if( this._dirty & X.Dom.Dirty.ATTR && ( attrs = this._newAttrs || this._attrs ) ){\r
+                               rename = X.Dom.Attr.renameForDOM;\r
                                for( k in attrs ){\r
                                        ( v = attrs[ k ] ) === undefined ?\r
-                                               elm.removeAttribute( k ) :\r
-                                               elm.setAttribute( k, v );\r
-                                       delete attrs[ k ];\r
+                                               elm.removeAttribute( rename[ k ] || k ) :\r
+                                               elm.setAttribute( rename[ k ] || k, v );\r
                                };\r
                                delete this._newAttrs;\r
                        };\r
@@ -1067,7 +1079,6 @@ Node.prototype._actualCreate =
                        \r
                        delete this._newAttrs;\r
                };\r
-               delete this._dirty;\r
                \r
                return html.join( '' );\r
        }) :\r
@@ -1096,8 +1107,12 @@ Node.prototype._afterActualCreate =
                        if( !X.UA.IE || 8 < X.UA.IE ){\r
                                elm.UID = this._uid;\r
                                this._newAttrs = this._attrs;\r
-                               this._dirty = X.Dom.Dirty.ID | X.Dom.Dirty.CLASSNAME | X.Dom.Dirty.CSS | X.Dom.Dirty.ATTR;\r
+                               this._dirty = X.Dom.Dirty.ID | X.Dom.Dirty.CLASSNAME | X.Dom.Dirty.CSS | X.Dom.Dirty.ATTR | X.Dom.Dirty.IE_FILTER;\r
                                this._updateRawNode( elm );\r
+                       } else\r
+                       if( this._dirty & X.Dom.Dirty.IE_FILTER ){\r
+                               elm.style.filter = X.Dom.Style.SPECIAL_FIX( this._css );\r
+                               delete this._dirty;\r
                        };\r
                        this._restoreEvent();// イベントの復帰\r
                        delete this._isNew;\r
@@ -1110,6 +1125,7 @@ Node.prototype._afterActualCreate =
                                xnodes[ i ]._afterActualCreate();\r
                        };\r
                };\r
+               \r
                return this;\r
        }) :\r
        document.all ? (function(){\r
@@ -1123,6 +1139,10 @@ Node.prototype._afterActualCreate =
                                xnodes[ --i ]._afterActualCreate();\r
                        };\r
                };\r
+               if( this._dirty & X.Dom.Dirty.IE_FILTER ){\r
+                       this._ie4getRawNode().style.filter = X.Dom.Style.SPECIAL_FIX( this._css );\r
+               };\r
+               delete this._dirty;\r
                return this._restoreEvent();// イベントの復帰\r
        }) :\r
        (function(){});\r
index 5e6b24f..222d6fc 100644 (file)
@@ -54,6 +54,7 @@ if( window.addEventListener ){
                        this.changedTouches = e.changedTouches;
                        this.targetTouches  = e.targetTouches;
                        this.metaKey        = e.metaKey;
+                       this.force          = e.force || e.webkitForce;
                } else
                if( e.constructor === window.PointerEvent ){
                        // PointerEvent;
@@ -103,10 +104,11 @@ if( window.addEventListener ){
                if( X.UA.IE && 5 <= X.UA.IE ){
                        this.offsetX       = e.offsetX; // イベントターゲット左上からの座標
                        this.offsetY       = e.offsetY;                 
-               } else {
-                       //this.offsetX       = e.x - e.srcElement.offsetLeft; // e.x はイベント発生要素の親要素を基準にした座標。
-                       //this.offsetY       = e.y - e.srcElement.offsetTop;    
-               };
+               }// else
+               //if( e.srcElement ){
+               //      this.offsetX       = e.x - e.srcElement.offsetLeft; // e.x はイベント発生要素の親要素を基準にした座標。
+               //      this.offsetY       = e.y - e.srcElement.offsetTop;      
+               //};
                
                this.keyCode       = e.keyCode;
                this.altKey        = e.altKey;
@@ -158,15 +160,15 @@ X.Dom.Event.ANIME_STOP          = 14;
 X.Dom.Event._LAST_EVENT         = 14; // ここに書いてあるイベントの最後の値 X.Dom.Event.ANIME_STOP と同じ値
 
 
-X.Dom.Node.prototype.listen = function( type, arg2, arg3, arg4 /* [ listener || ( context + function ) || function ][ arguments ] */ ){
+X.Dom.Node.prototype.listen = function( type, arg1, arg2, arg3 /* [ listener || ( context + function ) || function ][ arguments ] */ ){
        var elm;
        
-       if( this._xnodeType === 0 || this._xnodeType === 3 || !arg2 ) return this;
+       if( this._xnodeType === 0 || this._xnodeType === 3 || !arg1 ) return this;
        
        ( !this._listeners || !this._listeners[ type ] ) && this._addEvent( type );
        
-       return typeof arg2 === 'function' ?
-               X.EventDispatcher.prototype.listen.call( this, type, this, arg2, arg3 ) :
+       return typeof arg1 === 'function' ?
+               X.EventDispatcher.prototype.listen.call( this, type, this, arg1, arg2 ) :
                X.EventDispatcher.prototype.listen.apply( this, arguments );
 };
 
@@ -188,7 +190,7 @@ X.Dom.Node.prototype._addEvent =
                });
 
 
-X.Dom.Node.prototype.unlisten = function( type /* , arg2, arg3, arg4 */ ){
+X.Dom.Node.prototype.unlisten = function( type /* , arg1, arg2, arg3 */ ){
        var list = this._listeners,
                l    = !this._dispatching && list && type !== undefined && list[ type ] && list[ type ].length;
        
@@ -386,7 +388,7 @@ X.Dom.listenOnce( X.Dom.Event.DOM_INIT, function(){
                        (function( xnode, childNodes, skipCleanup ){
                                var i = 0,
                                        j = 0,
-                                       child, _xnode, f, tag, text, _xtext;
+                                       child, _xnode, f, tag, text, _xtext, doc;
                                childNodes = X.copyArray( childNodes );
 
                                for( ; i < childNodes.length; ++i ){
@@ -417,6 +419,9 @@ X.Dom.listenOnce( X.Dom.Event.DOM_INIT, function(){
                                                                continue;
                                                        } else {
                                                                _xnode._rawNode = child;
+                                                               //if( ( doc = child.ownerDocument || child.document ) && ( doc.createElement( 'p' ).tagName === doc.createElement( 'P' ).tagName ) ){
+                                                                       _xnode._tag     = tag; // .toUpperCase()
+                                                               //};
                                                                _xnode._root    = xnode._root;
                                                                child.UID = _xnode._uid;
                                                                if( 0 <= X.Dom.cleanupTagNames.indexOf( tag.toLowerCase() ) || tag === 'SCRIPT' ){ // ie で body 内の script が2度よばれるのに対処
@@ -559,7 +564,7 @@ X.Dom.listenOnce( X.Dom.Event.DOM_INIT, function(){
                                                        } else {
                                                                xnode._xnodes && xnode._xnodes.length && createTree( xnode, elm.children, skipCleanup || 0 <= X.Dom.skipCleanupTagNames.indexOf( tag.toLowerCase() ) );
                                                                
-                                                               !xnode._id && ( elm.id = 'ie4uid' + xnode._uid );
+                                                               !xnode._id && elm.setAttribute( 'id', 'ie4uid' + xnode._uid );//( elm.id = 'ie4uid' + xnode._uid );
                                                                elm.setAttribute( 'UID', xnode._uid );
                                                                
                                                                tag === 'INPUT' && (
index b3652bf..0d1a054 100644 (file)
@@ -9,7 +9,7 @@ X.Dom.BoxModel = {
 };
 
 X.Dom.listenOnce( X.Dom.Event.DOM_INIT, function(){
-/*
+
        var elm = Node._systemNode._rawNode || Node._systemNode._ie4getRawNode();
        elm.style.cssText = 'width:10px;padding:1px;border:2px solid #0;margin:4px;';
        
@@ -21,7 +21,7 @@ X.Dom.listenOnce( X.Dom.Event.DOM_INIT, function(){
                elm.style.cssText += 'box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing: border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;';
                
                X.Dom.BoxModel.boxSizingEnabled = elm.offsetWidth === 10;
-       }; */
+       };
        
 
        // padding
index 45c2d45..9901d91 100644 (file)
@@ -132,19 +132,30 @@ _GRNERAL
                        VENDER_PREFIX = me.VENDER_PREFIX,
                        FIX_PROP      = me.SPECIAL_FIX_PROP,
                        SPECIAL_FIX   = me.SPECIAL_FIX,
+                       n             = -1,
                        p, name, sp;
                for( p in obj ){
                        name = uncamelize( p );
                        if( FIX_PROP[ name ] ){
                                sp = 1;
                        } else {
-                               css[ css.length ] = [ VENDER_PREFIX[ name ] || name, obj[ p ] ].join( ':' );
+                               css[ ++n ] = [ VENDER_PREFIX[ name ] || name, obj[ p ] ].join( ':' );
                        };
                };
-               sp && ( css[ css.length ] = SPECIAL_FIX( obj ) );
+               sp && ( css[ ++n ] = SPECIAL_FIX( obj ) );
                return css.join( ';' );
        },
        
+       IE_FILTER_FIX :
+               X.UA.IE && X.UA.IE < 8 ?
+                       {
+                               opacity : 1,
+                               textShadow : 1
+                       } :
+               X.UA.IE === 9 ?
+                       {} :
+                       {},
+       
        _UNIT_RATIO      : null,
        _FONT_SIZE_RATIO : null,
 
@@ -843,35 +854,40 @@ X.Dom.Style.SPECIAL_FIX =
        X.UA.IE && X.UA.IE < 9 ?
                (function( obj ){
                        var test    = X.Dom.Style.SPECIAL_FIX_PROP,
-                               filters = [], p, id, v;
+                               filters = [],
+                               n       = -1,
+                               p, id, v, dir;
                        for( p in obj ){
                                if( !( id = test[ p ] ) ) continue;
                                v = obj[ p ];
                                switch( id ){
                                        case 1 : //'filter' :
-                                               filters[ filters.length ] = v;
+                                               filters[ ++n ] = v;
                                                break;
                                        case 2 : //'opacity' :
-                                               filters[ filters.length ] = 'aplha(opacity=' + v +')';
+                                               filters[ ++n ] = 'alpha(opacity=' + v * 100 +')';
                                                break;
                                        case 3 : //'boxShadow' :
                                                // box-shadow: 10px 10px 10px 10px rgba(0,0,0,0.4) inset;
                                                // スペース区切りで、水平方向の距離 垂直方向の距離 ぼかし距離 広がり距離 影の色 insetキーワードを指定する。 ぼかし距離 広がり距離 影の色 insetキーワードは省略可
                                                // shadow(color=#cccccc, strength=10, direction=135);
-                                               parseValue( 'boxShadow', v, 'px' );
-                                               dir = Math.atan2( ary[1], ary[0] ) * 180 / Math.PI + 90;
+                                               v = X.Dom.Style._getProperty( this, css, 'px', 'boxShadow' );
+                                               dir = Math.atan2( v[ 1 ], v[ 0 ] ) * 180 / Math.PI + 90;
                                                dir += dir < 0 ? 360 : 0;
+                                               filters[ ++n ] = 'shadow(color=' + v[ 4 ] + ',strength=' + v[ 3 ] + ',direction=' + dir + ')';
                                                break;
                                        case 4 : //'textShadow' :
                                                //text-shadow: 5px 5px 2px blue; 水平方向の距離 垂直方向の距離 影のぼかし半径 影の色 none
                                                //glow(Color=yellow,Strength=10);
                                                //どうやらCSSのbackgroundプロパティと同時に使えないようです。 
+                                               
+                                               
                                                break;
                                        case 5 : //'backgroundImage' :
                                                //
                                };
                        };
-                       if( filters ) return filters.join( ' ' );
+                       return filters.join( ' ' );
                }) :
        // IE9 textShadow に filter を使用
        X.UA.IE && 9 <= X.UA.IE && X.UA.IE < 10 ?
@@ -936,13 +952,17 @@ X.Dom.Node.prototype.css = function( nameOrObj /* orUnitID, valuOrUnitOrName */
        var XDomStyle = X.Dom.Style,
                args = arguments,
                css  = this._css,
-               p, valOrUnit, name, v, camelize, unit;
+               p, name, v, camelize, unit, ieFix;
        if( this._xnodeType !== 1 ) return this;
 // setter:object
        if( X.Type.isObject( nameOrObj ) ){
                if( !css ) css = this._css = {};
                camelize = XDomStyle.camelize;
+               ieFix    = X.Dom.Style.IE_FILTER_FIX;
                for( p in nameOrObj ){
+                       if( ieFix[ p ] ){
+                               this._dirty |= X.Dom.Dirty.IE_FILTER;
+                       };
                        css[ camelize( p ) ] = nameOrObj[ p ];
                };
                this._dirty |= X.Dom.Dirty.CSS;
@@ -957,6 +977,9 @@ X.Dom.Node.prototype.css = function( nameOrObj /* orUnitID, valuOrUnitOrName */
                        name = XDomStyle.camelize( nameOrObj );
                        v    = args[ 1 ];
                        if( css[ name ] === v ) return this;
+                       if( X.Dom.Style.IE_FILTER_FIX[ name ] ){
+                               this._dirty |= X.Dom.Dirty.IE_FILTER;
+                       };                      
                        if( !v && v !== 0 ){
                                delete css[ name ];
                        } else {
@@ -1092,7 +1115,7 @@ X.Dom.listenOnce( X.Dom.Event.DOM_PRE_INIT, function(){
                };
                return ret;
        })();
-               
+       
        X.Dom.Style.SPECIAL_FIX_PROP =
                // ~IE8
                X.UA.IE && X.UA.IE < 9 ?
index a16d089..3d9cdb2 100644 (file)
@@ -206,19 +206,21 @@ X.Dom.Query._parse = function( query, last ){
 \r
        // セレクター\r
        X.Dom.find = X._shortcut = Node.prototype.find = function( queryString ){\r
-               var scope   = this.cnstructor === X.Dom.NodeList && this.length ? this : [ this.cnstructor === Node ? this : Node.root ],\r
+               var scope     = this.cnstructor === X.Dom.NodeList && this.length ? this : [ this.cnstructor === Node ? this : Node.root ],\r
+                       parents   = scope, // 探索元の親要素\r
                        noLower   = 'title id name class for href src',\r
                        ARY_PUSH  = Array.prototype.push,\r
                        ret       = [], // 結果要素\r
                        root      = X.Dom.Node.getRoot( scope[ 0 ] ),\r
                        isXML     = !!X.Dom.Node.isXmlDocument( root ),\r
-                       isMulti   = 1 < scope.length,// 要素をマージする必要がある\r
-                       parents   = scope, // 探索元の親要素\r
+                       isMulti   = 1 < scope.length,\r
+                       isStart   = true,// 要素をマージする必要がある\r
+                       _         = ' ',\r
+                       isAll, isNot,\r
                        l, i, n, parsed,\r
                        xnodes, // 一時保存用\r
                        merge, // 要素がコメントノードで汚染されている場合使う\r
-                       combinator, selector, name, tagName, \r
-                       isAll, isStart = true, isNot,\r
+                       combinator, selector, name, tagName,\r
                        uid, tmp, xnode, filter, key, op, val, toLower, useName,\r
             links, className, attr, flag;\r
 \r
@@ -231,7 +233,7 @@ X.Dom.Query._parse = function( query, last ){
                \r
                // 以下、パースと探索\r
                for( ; queryString.length; ){\r
-                       console.log( 'queryString[' + queryString + ']' + queryString.length );\r
+                       console.log( 'queryString[' + queryString + ']' );\r
                        \r
                        // 初期化処理\r
                        if( !parsed ){\r
@@ -258,8 +260,6 @@ X.Dom.Query._parse = function( query, last ){
                                };\r
                        };\r
                        \r
-\r
-                       \r
                        combinator  = parsed[ 0 ];\r
                        selector    = parsed[ 1 ];\r
                        name        = parsed[ 2 ];\r
@@ -324,7 +324,7 @@ X.Dom.Query._parse = function( query, last ){
                                        break;\r
                                        \r
                                default :\r
-                                       if( combinator === 1 || isStart ){\r
+                                       if( combinator === 1 || ( isStart && selector < 7 ) ){\r
                                                console.log( l + ' > ' + xnodes.length + ' tag:' + tagName );\r
                                                for( ; i < l; ++i ){\r
                                                        xnode = parents[ i ];\r
@@ -367,11 +367,13 @@ X.Dom.Query._parse = function( query, last ){
                                        xnodes = [ Node._html ]; break;\r
                                // link\r
                                case 9 :\r
-                                       if( links = root._rawNode.links ){\r
+                                       if( links = document.links ){\r
                                                for( xnodes = [], i = links.length; i; ){\r
                                                        xnodes[ --i ] = new Node( links[ i ] );\r
                                                };\r
-                                       };\r
+                                       } else {\r
+                                               // area[href],a[href]\r
+                                       }\r
                        };\r
                        \r
                        if( filter && xnodes.length ){\r
@@ -398,13 +400,16 @@ X.Dom.Query._parse = function( query, last ){
                                        tmp = [];\r
                                        key = filter[ 0 ];\r
                                        op  = filter[ 1 ];\r
-                                       val = filter[ 2 ]; \r
+                                       val = filter[ 2 ];\r
+                                       \r
+                                       key = X.Dom.Attr.renameForTag[ key ] || key;\r
+                                       \r
                                        // [class~='val']\r
                                        if( !isXML && key === 'class' && op === 3 ){\r
-                                               val = ' ' + val + ' ';\r
+                                               val = _ + val + _;\r
                                                for( i = 0, n = -1; xnode = xnodes[ i ]; ++i ){\r
                                                        className = xnode._className;\r
-                                                       if( !!( className && ( ' ' + className + ' ' ).indexOf( val ) > -1 ) ^ isNot ) tmp[ ++n ] = xnode;\r
+                                                       if( !!( className && ( _ + className + _ ).indexOf( val ) > -1 ) ^ isNot ) tmp[ ++n ] = xnode;\r
                                                };\r
                                        } else {\r
                                        // 通常\r
@@ -414,7 +419,7 @@ X.Dom.Query._parse = function( query, last ){
                                                useName = X.UA.IE && key !== 'href' && key !== 'src';\r
                                                toLower = !!val && !isXML && noLower.indexOf( key ) === -1; //!noLower.test(key);\r
                                                if( toLower ) val = val.toLowerCase();\r
-                                               if( op === 3 ) val = ' ' + val + ' ';\r
+                                               if( op === 3 ) val = _ + val + _;\r
 \r
                                                for( i = 0, n = -1, l = xnodes.length; i < l; ++i ){\r
                                                        xnode = xnodes[ i ];\r
@@ -427,7 +432,7 @@ X.Dom.Query._parse = function( query, last ){
                                                                //useName ?\r
                                                                //      elem[ X.Dom.Attr.renameForDOM[ key ] || key ] :\r
                                                                //      elem.getAttribute( key, 2 );\r
-                                                       flag = attr != null && ( !useName || attr !== '' );\r
+                                                       flag = attr != null;// && ( !useName || attr !== '' );\r
                                                        if( flag && op ){\r
                                                                if( toLower ) attr = attr.toLowerCase();\r
                                                                \r
@@ -439,7 +444,7 @@ X.Dom.Query._parse = function( query, last ){
                                                                                flag = attr !== val;\r
                                                                                break;\r
                                                                        case 3: // ~=\r
-                                                                               flag = ( ' ' + attr + ' ' ).indexOf( val ) !== -1;\r
+                                                                               flag = ( _ + attr + _ ).indexOf( val ) !== -1;\r
                                                                                break;\r
                                                                        case 4: // ^=\r
                                                                                flag = attr.indexOf( val ) === 0;\r
index 1c0fc49..f0731f1 100644 (file)
@@ -1,5 +1,5 @@
-var _AbstractDisplayNode = X.Class.create(\r
-       '_AbstractDisplayNode',\r
+var _AbstractUINode = X.EventDispatcher.inherits(\r
+       '_AbstractUINode',\r
        X.Class.ABSTRACT | X.Class.PRIVATE_DATA,\r
        {\r
                phase         : 0,\r
@@ -75,13 +75,12 @@ var _AbstractDisplayNode = X.Class.create(
                        this.rootData   = rootData;\r
                        this.parent     = parent;\r
                        this.parentData = parentData;\r
-                       this.rawElement = X.Dom.Node.create( 'div' ); //document.createElement( 'div' );\r
-                       //this.rawStyle   = this.rawElement.style;\r
+                       this.rawElement = X.Dom.Node.create( 'div' );\r
                        \r
                        this.styleData.initialize();\r
                        \r
                        this.phase = 1;\r
-                       this.User.dispatch( { type : X.UI.Event.INIT } );\r
+                       this.dispatch( { type : X.UI.Event.INIT } );\r
                },\r
                \r
                addToParent : function( parentElement ){\r
@@ -89,7 +88,7 @@ var _AbstractDisplayNode = X.Class.create(
                        parentElement && parentElement.append( this.rawElement );\r
                        \r
                        this.phase = 2;\r
-                       this.User.dispatch( { type : X.UI.Event.ADDED } );\r
+                       this.dispatch( { type : X.UI.Event.ADDED } );\r
                },\r
 \r
        /* Rellay\r
@@ -97,13 +96,14 @@ var _AbstractDisplayNode = X.Class.create(
                        this.styleData.afterAddition();\r
                        \r
                        this.phase = 3;\r
-                       this.User.dispatch( { type : X.UI.Event.CREATION_COMPLETE } );\r
+                       this.dispatch( { type : X.UI.Event.CREATION_COMPLETE } );\r
                }, */\r
                \r
                creationComplete : function(){\r
                        if( this.phase < 3 ) return;\r
                        \r
-                       var nodes = this.nodes,\r
+                       var nodes  = this.nodes,\r
+                               events = this.reserveEvents,\r
                                l, i;\r
                        if( nodes ){\r
                                for( i = 0, l = nodes.length; i < l; ++i ){\r
@@ -115,13 +115,13 @@ var _AbstractDisplayNode = X.Class.create(
                        // this.scroll === true && ScrollBarManager.register( this );\r
                        \r
                        // html 要素が親に追加されるまで控えていたイベントの登録\r
-                       var events = this.reserveEvents,\r
-                               i;\r
-                       if( !events ) return;\r
-                       for( ; events.length; ){\r
-                               this.User.listen.apply( this.User, events.shift() );\r
+                       if( events && ( l = events.length ) ){\r
+                               for( i = 0; i < l; ++i ){\r
+                                       this.listen.apply( this, events[ i ] );\r
+                               };\r
+                               events.length = 0;\r
+                               delete this.reserveEvents;\r
                        };\r
-                       delete this.reserveEvents;\r
                },\r
                \r
                mesure : function(){\r
@@ -205,19 +205,6 @@ var _AbstractDisplayNode = X.Class.create(
                        return hit || !!this.hitChildData;\r
                },\r
                \r
-               dispatch : function( e ){\r
-                       var xve  = X.UI.Event,\r
-                               ret  = X.EventDispatcher.prototype.dispatch.call( this.User, e ),\r
-                               type = e.type;\r
-                       if( ret & X.Callback.MONOPOLY && !this.hitChildData && ( xve._POINTER_MOVE === type || xve.type._MOUSE_MOVE === type || xve.FILE_DRAG === type ) ){\r
-                               this.rootData.monopolyNodeData = this;\r
-                               return ret;\r
-                       };\r
-                       this.rootData.monopolyNodeData = null;\r
-                       if( xve._START_BUBLEUP < type && this.parentData && ret & X.Callback.STOP_PROPAGATION === 0 && ret & X.Callback.STOP_NOW === 0 ) return this.parentData.dispatch( e );\r
-                       return ret;\r
-               },\r
-               \r
                _remove : function(){\r
                        switch( this.phase ){\r
                                case 4:\r
@@ -233,7 +220,6 @@ var _AbstractDisplayNode = X.Class.create(
                                        delete this.parent;\r
                                        delete this.parentData;\r
                                        delete this.rawElement;\r
-                                       delete this.rawStyle;\r
                        };\r
                        delete this.phase;\r
                },\r
@@ -316,7 +302,7 @@ var _AbstractDisplayNode = X.Class.create(
 \r
                        if( style ){\r
                                styles   = style.data;\r
-                               calc     = _AbstractDisplayNode.calcValue;\r
+                               calc     = _AbstractUINode.calcValue;\r
                                box      = styles[ X.Css.AttrNo.sizing ];\r
                                \r
                                // Width が確定するパターン\r
@@ -326,7 +312,7 @@ var _AbstractDisplayNode = X.Class.create(
                                        if( style.constraintW ){ // 制約レイアウト\r
                                                contentW = allowW - calc( styles[ X.Css.AttrNo.left ], allowW ) - calc( styles[ X.Css.AttrNo.right ], allowW );\r
                                        } else {\r
-                                               contentW = _AbstractDisplayNode.finalValue( styles[ X.Css.AttrNo.width ], styles[ X.Css.AttrNo.minWidth ], styles[ X.Css.AttrNo.maxWidth ], allowW );                                   \r
+                                               contentW = _AbstractUINode.finalValue( styles[ X.Css.AttrNo.width ], styles[ X.Css.AttrNo.minWidth ], styles[ X.Css.AttrNo.maxWidth ], allowW );                                        \r
                                        };\r
                                        paddingR = calc( styles[ X.Css.AttrNo.padding + 1 ], allowW );\r
                                        paddingL = calc( styles[ X.Css.AttrNo.padding + 3 ], allowW );\r
@@ -363,7 +349,7 @@ var _AbstractDisplayNode = X.Class.create(
                                        if( style.constraintH ){ // 制約レイアウト\r
                                                contentH = allowH - calc( styles[ X.Css.AttrNo.top ], allowH ) - calc( styles[ X.Css.AttrNo.bottom ], allowH );\r
                                        } else {\r
-                                               contentH = _AbstractDisplayNode.finalValue( styles[ X.Css.AttrNo.height ], styles[ X.Css.AttrNo.minHeight ], styles[ X.Css.AttrNo.maxHeight ], allowH );\r
+                                               contentH = _AbstractUINode.finalValue( styles[ X.Css.AttrNo.height ], styles[ X.Css.AttrNo.minHeight ], styles[ X.Css.AttrNo.maxHeight ], allowH );\r
                                        };\r
                                        allowSize = styles[ X.Css.AttrNo.pageBox ] === true ? allowH : allowW;\r
                                        paddingT  = calc( styles[ X.Css.AttrNo.padding + 0 ], allowSize );// paddingTRBL の % 指定は 最大幅に対して TB でも幅に対して\r
@@ -524,7 +510,7 @@ var _AbstractDisplayNode = X.Class.create(
                                min, max;\r
                        if( style ){\r
                                styles   = style.data;\r
-                               calc     = _AbstractDisplayNode.advancedCalcValue;\r
+                               calc     = _AbstractUINode.advancedCalcValue;\r
                                contentW = this.contentWidth;\r
                                box      = styles[ X.Css.AttrNo.sizing ];\r
                                \r
@@ -606,12 +592,90 @@ var _AbstractDisplayNode = X.Class.create(
                                delete this.contentR;\r
                                delete this.contentB;\r
                        };\r
+               },\r
+               \r
+               listen : function( type, arg1, arg2, arg3 ){\r
+                       var root, events, counter;\r
+                       if( X.UI.Event._START_POINTER <= type && type <= X.UI.Event._END_POINTER ){\r
+                               if( this.phase < 3 ){\r
+                                       if( !( events = this.reserveEvents ) ) this.reserveEvents = events = [];\r
+                                       events[ events.length ] = [ type, arg1, arg2, arg3 ];\r
+                                       return this;\r
+                               };\r
+                               if( X.UI.Event._START_XUI_EVENT < type && type < X.UI.Event._END_XUI_EVENT ){\r
+                                       if( !this.gesture ){\r
+                                               this.gesture = new X.UI.Gesture( this.root, this, type );\r
+                                       } else {\r
+                                               this.gesture.listen( type );\r
+                                       };\r
+                               } else {\r
+                                       root    = this.rootData;\r
+                                       counter = root.eventCounter;\r
+                                       if( counter[ type ] ){\r
+                                               ++counter[ type ];\r
+                                       } else {\r
+                                               counter[ type ] = 1;                            \r
+                                               root.elmMouseCatch.listen( X.UI.Event.IdToName[ type ], eventRellay );\r
+                                       };\r
+                               };\r
+                       };\r
+                       if( typeof arg1 === 'function' ){\r
+                               return X.EventDispatcher.prototype.listen.apply( this, [ type, this.User, arg1, arg2 ] );\r
+                       };\r
+                       return X.EventDispatcher.prototype.listen.apply( this, [ type, arg1 || this.User, arg2 || arg1, arg3 || arg2 ] );\r
+               },\r
+               unlisten : function( type, arg1, arg2, arg3 ){\r
+                       var root, events, i, ev, counter;\r
+                       if( X.UI.Event._START_POINTER <= type && type <= X.UI.Event._END_POINTER ){\r
+                               if( this.phase < 3 ){\r
+                                       if( !( events = this.reserveEvents ) ) return this;\r
+                                       for( i = events.length; i; ){\r
+                                               ev = events[ --i ];\r
+                                               if( ev[ 0 ] === type && ev[ 1 ] === arg1 && ev[ 2 ] === arg2 ){\r
+                                                       events.split( i, 1 );\r
+                                                       return this;\r
+                                               };\r
+                                       }; \r
+                                       return this;\r
+                               };\r
+\r
+                               if( X.UI.Event._START_XUI_EVENT < type && type < X.UI.Event._END_XUI_EVENT ){\r
+                                       this.gesture && this.gesture.unlisten( type );\r
+                               } else {\r
+                                       root    = this.rootData;\r
+                                       counter = root.eventCounter;\r
+                                       if( !counter[ type ] ) return this;\r
+                                       --counter[ type ];\r
+                                       if( counter[ type ] === 0 ){\r
+                                               X.Dom.Event.remove( root.elmMouseCatch, X.UI.Event.IdToName[ type ], eventRellay );\r
+                                               delete counter[ type ];\r
+                                       };\r
+                               };\r
+                       };\r
+                       if( typeof arg1 === 'function' ){\r
+                               return X.EventDispatcher.prototype.unlisten.apply( this, [ type, this.User, arg1, arg2 ] );\r
+                       };\r
+                       return X.EventDispatcher.prototype.unlisten.apply( this, [ type, arg1 || this.User, arg2 || arg1, arg3 || arg2 ] );\r
+               },\r
+               \r
+               dispatch : function( e ){\r
+                       var xve  = X.UI.Event,\r
+                               ret  = X.EventDispatcher.prototype.dispatch.call( this, e ),\r
+                               type = e.type;\r
+                       if( ret & X.Callback.MONOPOLY && !this.hitChildData && ( xve._POINTER_MOVE === type || xve._MOUSE_MOVE === type || xve.FILE_DRAG === type ) ){\r
+                               this.rootData.monopolyNodeData = this;\r
+                               return ret;\r
+                       };\r
+                       this.rootData.monopolyNodeData = null;\r
+                       if( xve._START_BUBLEUP < type && this.parentData && ret & X.Callback.STOP_PROPAGATION === 0 && ret & X.Callback.STOP_NOW === 0 ) return this.parentData.dispatch( e );\r
+                       return ret;\r
                }\r
+               \r
        }\r
 );\r
 \r
-_AbstractDisplayNode.finalValue = function( styleValue, styleMin, styleMax, srcValue ){\r
-       var calc = _AbstractDisplayNode.calcValue,\r
+_AbstractUINode.finalValue = function( styleValue, styleMin, styleMax, srcValue ){\r
+       var calc = _AbstractUINode.calcValue,\r
                v    = calc( styleValue, srcValue ),\r
                min  = calc( styleMin,   srcValue ),\r
                max  = calc( styleMax,   srcValue );\r
@@ -619,7 +683,7 @@ _AbstractDisplayNode.finalValue = function( styleValue, styleMin, styleMax, srcV
        if( max < v ) return max;\r
        return v;\r
 };\r
-_AbstractDisplayNode.calcValue = function( styleValue, srcValue ){\r
+_AbstractUINode.calcValue = function( styleValue, srcValue ){\r
        switch( styleValue ){\r
                case 0 :\r
                        return 0;\r
@@ -632,7 +696,7 @@ _AbstractDisplayNode.calcValue = function( styleValue, srcValue ){
        if( -1 < styleValue ) return FLOOR( srcValue * styleValue ); // %       \r
        return styleValue; // - length\r
 };\r
-_AbstractDisplayNode.advancedCalcValue = function( styleValue, srcValue ){\r
+_AbstractUINode.advancedCalcValue = function( styleValue, srcValue ){\r
        switch( styleValue ){\r
                case 0 :\r
                        return 0;\r
@@ -648,8 +712,8 @@ _AbstractDisplayNode.advancedCalcValue = function( styleValue, srcValue ){
 };\r
 \r
 \r
-var AbstractDisplayNode = X.EventDispatcher.inherits(\r
-       'AbstractDisplayNode',\r
+var AbstractUINode = X.Class.create(\r
+       'AbstractUINode',\r
        X.Class.ABSTRACT | X.Class.SUPER_ACCESS,\r
        {\r
                style : null,\r
@@ -659,64 +723,17 @@ var AbstractDisplayNode = X.EventDispatcher.inherits(
                root : function(){\r
                        return X.Class._getPrivate( this ).root;\r
                },\r
-               listen : function( type, arg1, arg2 ){\r
-                       var root, data, events, counter;\r
-                       if( X.UI.Event._START_POINTER <= type && type <= X.UI.Event._END_POINTER ){\r
-                               data = X.Class._getPrivate( this );\r
-                               if( data.phase < 3 ){\r
-                                       if( !( events = data.reserveEvents ) ) data.reserveEvents = events = [];\r
-                                       events[ events.length ] = [ type, arg1, arg2 ];\r
-                                       return this;\r
-                               };\r
-                               if( X.UI.Event._START_XUI_EVENT < type && type < X.UI.Event._END_XUI_EVENT ){\r
-                                       if( !this.gesture ){\r
-                                               this.gesture = new X.UI.Gesture( data.root, this, type );\r
-                                       } else {\r
-                                               this.gesture.listen( type );\r
-                                       };\r
-                               } else {\r
-                                       root    = data.rootData;\r
-                                       counter = root.eventCounter;\r
-                                       if( counter[ type ] ){\r
-                                               ++counter[ type ];\r
-                                       } else {\r
-                                               counter[ type ] = 1;                            \r
-                                               root.elmMouseCatch.listen( X.UI.Event.IdToName[ type ], eventRellay );\r
-                                       };\r
-                               };\r
-                       };\r
-                       return X.EventDispatcher.prototype.listen.apply( this, arguments );\r
+               listen : function( type, arg1, arg2, arg3 ){\r
+                       X.Class._getPrivate( this ).listen( type, arg1, arg2, arg3 );\r
+                       return this;\r
                },\r
-               unlisten : function( type, arg1, arg2 ){\r
-                       var root, data, events, i, ev, counter;\r
-                       if( X.UI.Event._START_POINTER <= type && type <= X.UI.Event._END_POINTER ){\r
-                               data = X.Class._getPrivate( this );\r
-                               if( data.phase < 3 ){\r
-                                       if( !( events = data.reserveEvents ) ) return this;\r
-                                       for( i = events.length; i; ){\r
-                                               ev = events[ --i ];\r
-                                               if( ev[ 0 ] === type && ev[ 1 ] === arg1 && ev[ 2 ] === arg2 ){\r
-                                                       events.split( i, 1 );\r
-                                                       return this;\r
-                                               };\r
-                                       }; \r
-                                       return this;\r
-                               };\r
-\r
-                               if( X.UI.Event._START_XUI_EVENT < type && type < X.UI.Event._END_XUI_EVENT ){\r
-                                       this.gesture && this.gesture.unlisten( type );\r
-                               } else {\r
-                                       root    = data.rootData;\r
-                                       counter = root.eventCounter;\r
-                                       if( !counter[ type ] ) return this;\r
-                                       --counter[ type ];\r
-                                       if( counter[ type ] === 0 ){\r
-                                               X.Dom.Event.remove( root.elmMouseCatch, X.UI.Event.IdToName[ type ], eventRellay );\r
-                                               delete counter[ type ];\r
-                                       };\r
-                               };\r
-                       };\r
-                       return X.EventDispatcher.prototype.unlisten.apply( this, arguments );\r
+               listenOnce : function( type, arg1, arg2, arg3 ){\r
+                       X.Class._getPrivate( this ).listenOnce( type, arg1, arg2, arg3 );\r
+                       return this;\r
+               },\r
+               unlisten : function( type, arg1, arg2, arg3 ){\r
+                       X.Class._getPrivate( this ).unlisten( type, arg1, arg2, arg3 );\r
+                       return this;\r
                },\r
                getNextNode : function(){\r
                        \r
similarity index 80%
rename from 0.6.x/js/ui/07_AbstractBox.js
rename to 0.6.x/js/ui/08_Box.js
index 4eccccc..791afee 100644 (file)
@@ -1,10 +1,6 @@
 \r
-\r
-\r
-\r
-\r
-var _AbstractDisplayContainer = _AbstractDisplayNode.inherits(\r
-       '_AbstractDisplayContainer',\r
+var _Box = _AbstractUINode.inherits(\r
+       '_Box',\r
        X.Class.PRIVATE_DATA,\r
        {\r
                layout        : null,\r
@@ -12,8 +8,8 @@ var _AbstractDisplayContainer = _AbstractDisplayNode.inherits(
                forContainer  : false,\r
                tmpCss        : null,\r
                Constructor : function( layout, args ){\r
-                       if( !this.User.instanceOf( AbstractDisplayContainer ) ){\r
-                               //throw new Error( 'AbstractDisplayContainer を継承したインスタンスだけが _AbstractDisplayContainer のオーナーになれます' );\r
+                       if( !this.User.instanceOf( Box ) ){\r
+                               //throw new Error( 'Box を継承したインスタンスだけが _Box のオーナーになれます' );\r
                        };\r
                        var i     = 0,\r
                                l     = args.length,\r
@@ -21,7 +17,7 @@ var _AbstractDisplayContainer = _AbstractDisplayNode.inherits(
                                arg, _data;\r
                        for( ; i < l; ++i ){\r
                                arg = args[ i ];\r
-                               if( arg.instanceOf && arg.instanceOf( AbstractDisplayNode ) ){\r
+                               if( arg.instanceOf && arg.instanceOf( AbstractUINode ) ){\r
                                        _data = X.Class._getPrivate( arg );\r
                                        nodes[ nodes.length ] = _data;\r
                                        if( _data.parent ){\r
@@ -34,7 +30,7 @@ var _AbstractDisplayContainer = _AbstractDisplayNode.inherits(
                                if( X.Type.isObject( arg ) === true ){\r
                                        this.tmpCss = arg;\r
                                } else {\r
-                                       //throw new Error( 'AbstractDisplayNode を継承したインスタンスを渡してください ' + arg );\r
+                                       //throw new Error( 'AbstractUINode を継承したインスタンスを渡してください ' + arg );\r
                                };\r
                        };\r
                        this.layout = layout;\r
@@ -48,8 +44,6 @@ var _AbstractDisplayContainer = _AbstractDisplayNode.inherits(
                        this.rootData   = rootData;\r
                        this.parent     = parent;\r
                        this.parentData = parentData;\r
-                       //this.rawElement = document.createElement( 'div' );\r
-                       //this.rawStyle   = this.rawElement.style;\r
                        this.rawElement = X.Dom.Node.create( 'div' );\r
                        \r
                        for( ; i; ){\r
@@ -66,7 +60,7 @@ var _AbstractDisplayContainer = _AbstractDisplayNode.inherits(
                        var nodes = this.nodes,\r
                                l     = nodes.length,\r
                                i     = 0;\r
-                       //parentElement && parentElement.appendChild( this.rawElement );\r
+\r
                        parentElement && parentElement.append( this.rawElement );\r
                        \r
                        for( ; i < l; ++i ){\r
@@ -173,7 +167,6 @@ var _AbstractDisplayContainer = _AbstractDisplayNode.inherits(
                                        //this.styleData.afterAddition();\r
                                case 2:\r
                                        //this.styleData.initialize();\r
-                                       //this.rawElement.parentNode.removeChild( this.rawElement );\r
                                        this.rawElement.remove();\r
                                case 1:\r
                                        delete this.root;\r
@@ -181,18 +174,51 @@ var _AbstractDisplayContainer = _AbstractDisplayNode.inherits(
                                        delete this.parent;\r
                                        delete this.parentData;\r
                                        delete this.rawElement;\r
-                                       delete this.rawStyle;\r
                        };\r
                        delete this.phase;\r
                }\r
        }\r
 );\r
 \r
-var AbstractDisplayContainer = AbstractDisplayNode.inherits(\r
-       'AbstractDisplayContainer',\r
-       X.Class.ABSTRACT | X.Class.SUPER_ACCESS,\r
-       _AbstractDisplayContainer,\r
+var BasicLayoutManager = ( new LayoutManagerBase() ).define( {\r
+       allowForSelf : {\r
+               childW  : false,\r
+               childH  : false,\r
+               gapX    : false,\r
+               gapY    : false,\r
+               padding : false\r
+       },\r
+       allowForChild : {\r
+               x  : true,\r
+               y  : true,\r
+               w  : true,\r
+               h  : true\r
+       },\r
+       calculate : function( data, x, y, w, h ){\r
+               var nodes = data.nodes,\r
+                       i = 0, l = nodes.length, node;\r
+               for( ; i < l; ++i ){\r
+                       node = nodes[ i ];\r
+                       if( node.instanceOf( _Box ) ){\r
+                               node.calculate( x, y, w, h );\r
+                       } else {\r
+                               //node.styleData.layout( x, y, w, h );\r
+                       };\r
+               };\r
+               data.styleData.layout( x, y, w, h );\r
+       }\r
+});\r
+\r
+var Box = AbstractUINode.inherits(\r
+       'Box',\r
+       X.Class.SUPER_ACCESS,\r
+       _Box,\r
        {\r
+               Constructor : function(){\r
+                       this.style = DisplayNodeStyle( this, X.Class._newPrivate( this, BasicLayoutManager, arguments ) );\r
+                       this.style.addName( 'Box' );\r
+               },\r
+               \r
                add : function( node /* , node, node ... */ ){\r
                        X.Class._getPrivate( this ).addAt( this.numNodes() + 1, Array.prototype.slice.call( arguments ) );\r
                        return this;\r
diff --git a/0.6.x/js/ui/10_Box.js b/0.6.x/js/ui/10_Box.js
deleted file mode 100644 (file)
index e7dc4ac..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-var BasicLayoutManager = ( new LayoutManagerBase() ).define( {\r
-       allowForSelf : {\r
-               childW  : false,\r
-               childH  : false,\r
-               gapX    : false,\r
-               gapY    : false,\r
-               padding : false\r
-       },\r
-       allowForChild : {\r
-               x  : true,\r
-               y  : true,\r
-               w  : true,\r
-               h  : true\r
-       },\r
-       calculate : function( data, x, y, w, h ){\r
-               var nodes = data.nodes,\r
-                       i = 0, l = nodes.length, node;\r
-               for( ; i < l; ++i ){\r
-                       node = nodes[ i ];\r
-                       if( node.instanceOf( _AbstractDisplayContainer ) ){\r
-                               node.calculate( x, y, w, h );\r
-                       } else {\r
-                               //node.styleData.layout( x, y, w, h );\r
-                       };\r
-               };\r
-               data.styleData.layout( x, y, w, h );\r
-       }\r
-});\r
-\r
-var Box = AbstractDisplayContainer.inherits(\r
-       'Box',\r
-       X.Class.SUPER_ACCESS,\r
-       {\r
-               Constructor : function(){\r
-                       this.style = DisplayNodeStyle( this, X.Class._newPrivate( this, BasicLayoutManager, arguments ) );\r
-                       this.style.addName( 'Box' );\r
-               }\r
-       }\r
-);
\ No newline at end of file
index 24cd67d..a9fafa9 100644 (file)
@@ -31,7 +31,7 @@ var VerticalLayoutManager = ( new LayoutManagerBase() ).define( {
                if( childH || childH === 0 ){\r
                        for( ; i < l; ++i ){\r
                                node = nodes[ i ];\r
-                               if( node.instanceOf( _AbstractDisplayContainer ) ){\r
+                               if( node.instanceOf( _Box ) ){\r
                                        node.calculate( 0, _y, w - x, childH );\r
                                } else {\r
                                        node.styleData.layout( 0, _y, w - x, childH );\r
@@ -41,7 +41,7 @@ var VerticalLayoutManager = ( new LayoutManagerBase() ).define( {
                } else {\r
                        for( ; i < l; ++i ){\r
                                node = nodes[ i ];\r
-                               if( node.instanceOf( _AbstractDisplayContainer ) ){\r
+                               if( node.instanceOf( _Box ) ){\r
                                        node.calculate( 0, _y, w - x );\r
                                } else {\r
                                        node.styleData.layout( 0, _y, w - x );\r
@@ -63,7 +63,7 @@ var VBox = function(){
 }; */\r
 \r
 \r
-var VBox = AbstractDisplayContainer.inherits(\r
+var VBox = Box.inherits(\r
        'VBox',\r
        X.Class.SUPER_ACCESS,\r
        {\r
index 07056ee..70e5e11 100644 (file)
@@ -30,7 +30,7 @@ var HorizontalLayoutManager = ( new LayoutManagerBase() ).define( {
                if( childW || childW === 0 ){\r
                        for( ; i < l; ++i ){\r
                                node = nodes[ i ];\r
-                               if( node.instanceOf( _AbstractDisplayContainer ) ){\r
+                               if( node.instanceOf( _Box ) ){\r
                                        node.calculate( _x, NaN, childW, childH );\r
                                } else {\r
                                        node.styleData.layout( _x, NaN, childW, childH );\r
@@ -40,7 +40,7 @@ var HorizontalLayoutManager = ( new LayoutManagerBase() ).define( {
                } else {\r
                        for( ; i < l; ++i ){\r
                                node = nodes[ i ];\r
-                               if( node.instanceOf( _AbstractDisplayContainer ) ){\r
+                               if( node.instanceOf( _Box ) ){\r
                                        node.calculate( _x, NaN, NaN, childH );\r
                                } else {\r
                                        node.styleData.layout( _x, NaN, NaN, childH );\r
@@ -62,7 +62,7 @@ var HBox = function(){
 }; */\r
 \r
 \r
-var HBox = AbstractDisplayContainer.inherits(\r
+var HBox = Box.inherits(\r
        'HBox',\r
        X.Class.SUPER_ACCESS,\r
        {\r
index 0454404..9887b26 100644 (file)
@@ -30,7 +30,7 @@ var TileLayoutManager = ( new LayoutManagerBase() ).define( {
                };\r
                for( ; i < l; ++i ){\r
                        node = nodes[ i ];\r
-                       if( node.instanceOf( _AbstractDisplayContainer ) ){\r
+                       if( node.instanceOf( _Box ) ){\r
                                node.calculate( _x, _y, childW, childH );\r
                        } else {\r
                                node.styleData.layout( _x, _y, childW, childH );\r
@@ -44,7 +44,7 @@ var TileLayoutManager = ( new LayoutManagerBase() ).define( {
        }\r
 });\r
 \r
-var TileBox = AbstractDisplayContainer.inherits(\r
+var TileBox = Box.inherits(\r
        'TileBox',\r
        X.Class.SUPER_ACCESS,\r
        {\r
index 3aed981..c0f824d 100644 (file)
@@ -1,4 +1,4 @@
-var _ChromeBox = _AbstractDisplayContainer.inherits(\r
+var _ChromeBox = _Box.inherits(\r
        '_ChromeBox',\r
        X.Class.PRIVATE_DATA | X.Class.SUPER_ACCESS,\r
        {\r
@@ -31,7 +31,7 @@ var _ChromeBox = _AbstractDisplayContainer.inherits(
        }\r
 );\r
 \r
-var ChromeBox = AbstractDisplayContainer.inherits(\r
+var ChromeBox = Box.inherits(\r
        'ChromeBox',\r
        X.Class.SUPER_ACCESS,\r
        _ChromeBox,\r
index e26918b..21aa91e 100644 (file)
@@ -37,7 +37,7 @@ function eventRellay( e ){
                if( parent !== currentRootData ){
                        data.isHover === true && data.styleData.removeName( data.hoverStyleName );
                        delete data.isHover;
-                       data.User._listeners && data.User._listeners[ X.UI.Event.POINTER_OUT ] && data.dispatch( e, X.UI.Event.POINTER_OUT, false ); // new Event
+                       data._listeners && data._listeners[ X.UI.Event.POINTER_OUT ] && data.dispatch( e, X.UI.Event.POINTER_OUT, false ); // new Event
                        delete data.hitSelf;
                        list.splice( i, 1 );
                        continue;
@@ -47,7 +47,7 @@ function eventRellay( e ){
                        data.isHover = true;
                };
                if( data.hitSelf === false ){
-                       data.User._listeners && data.User._listeners[ X.UI.Event.POINTER_IN ] && data.dispatch( e, X.UI.Event.POINTER_IN, true ); // new Event
+                       data._listeners && data._listeners[ X.UI.Event.POINTER_IN ] && data.dispatch( e, X.UI.Event.POINTER_IN, true ); // new Event
                        data.hitSelf = true;
                };
        };
@@ -59,7 +59,7 @@ function eventRellay( e ){
  * 背景画像を読み終える onload で活動開始
  */
 
-var _PageRoot = _AbstractDisplayContainer.inherits(
+var _PageRoot = _Box.inherits(
        '_PageRoot',
        X.Class.FINAL | X.Class.PRIVATE_DATA | X.Class.SUPER_ACCESS,
        {
@@ -92,24 +92,17 @@ var _PageRoot = _AbstractDisplayContainer.inherits(
                        X.Timer.once( 0, this, this.addToView );
                },
                addToView : function(){
-                       var     counter = this.eventCounter, flg, elm;
+                       var     counter = this.eventCounter, flg;
                        
-                       // document.body.insertBefore( this.rawElement, elmInteractive );
                        // this.elmMouseCatch の前に追加する!
 
                        this.addToParent( X.Dom.Node.root );
-                       //document.body.appendChild( elm = document.createElement( 'div' ) );
                        
-                       elm = X.Dom.Node.root.create( 'div', {
+                       this.elmMouseCatch = X.Dom.Node.root.create( 'div', {
                                'class'      : 'mouse-operation-catcher',
                                unselectable : 'on'
                        } );
                        
-                       // elm.style.cssText = 'position:absolute;top:0;left:0;height:100%;';
-                       //elm.className      = 'mouse-operation-catcher';
-                       //elm.unselectable   = 'on';
-                       this.elmMouseCatch = elm;
-                       
                        // hover や rollover rollout のための move イベントの追加
                        // X.Dom.Event.activate, X.Dom.Event.deactivate ?
                        // mouseout, mouseover
index a3759f8..9348182 100644 (file)
@@ -1,4 +1,4 @@
-var _Text = _AbstractDisplayNode.inherits(\r
+var _Text = _AbstractUINode.inherits(\r
        '_Text',\r
        X.Class.PRIVATE_DATA,\r
        {\r
@@ -19,7 +19,7 @@ var _Text = _AbstractDisplayNode.inherits(
        }\r
 );\r
 \r
-var Text = AbstractDisplayNode.inherits(\r
+var Text = AbstractUINode.inherits(\r
        'Text',\r
        X.Class.SUPER_ACCESS,\r
        _Text,\r