X.Class.ABSTRACT | X.Class.PRIVATE_DATA,\r
{\r
phase : 0,\r
+ dirty : X.UI.Dirty.CLEAN,\r
+ \r
root : null,\r
rootData : null,\r
hoverList : null,\r
if( numerical ) return v;\r
if( list && list[ v ] ) return list[ v ];\r
if( color ){\r
+ if( v < 0x100000 ){\r
+ v = '00000' + v.toString( 16 );\r
+ return '#' + v.substr( v.length - 6 );\r
+ };\r
return '#' + v.toString( 16 );\r
};\r
};\r
case 3:\r
\r
case 2:\r
- this.xnode.destroy();\r
+ \r
case 1:\r
+ this.xnode.destroy();\r
+ \r
delete this.root;\r
delete this.rootData;\r
delete this.parent;\r
},\r
//killed\r
\r
- calculate : function( isNeedsDetection, x, y, allowW, allowH ){\r
- this.preMesure( allowW, allowH );\r
+ calculate : function( isNeedsDetection, x, y, allowedW, allowedH ){\r
+ this.preMesure( allowedW, allowedH );\r
\r
if( this.boxWidth === X.UI.Attr.AUTO || this.boxHeight === X.UI.Attr.AUTO ){\r
this.mesure();\r
/*\r
* 親の サイズを元に自身のサイズを計算していく\r
*/\r
- preMesure : function( allowW, allowH ){\r
+ preMesure : function( allowedW, allowedH ){\r
var attrs = this.attrObject || this.attrClass.prototype || X.UI.AttrClass,\r
calc = _AbstractUINode.calcValue,\r
box = attrs[ X.UI.Attr.Support.sizing.No ],\r
// 自身が constraintW の場合 親が AUTO ではない\r
// 自身が constraintW でない場合自身が AUTO はなくかつ親 が AUTO の場合 or 自身は % でない\r
\r
- paddingR = calc( attrs[ X.UI.Attr.Support.padding.No + 1 ], allowW );\r
- paddingL = calc( attrs[ X.UI.Attr.Support.padding.No + 3 ], allowW );\r
- borderR = calc( attrs[ X.UI.Attr.Support.borderWidth.No + 1 ], allowW );\r
- borderL = calc( attrs[ X.UI.Attr.Support.borderWidth.No + 3 ], allowW );\r
+ paddingR = calc( attrs[ X.UI.Attr.Support.padding.No + 1 ], allowedW );\r
+ paddingL = calc( attrs[ X.UI.Attr.Support.padding.No + 3 ], allowedW );\r
+ borderR = calc( attrs[ X.UI.Attr.Support.borderWidth.No + 1 ], allowedW );\r
+ borderL = calc( attrs[ X.UI.Attr.Support.borderWidth.No + 3 ], allowedW );\r
boxMinus = 0;\r
switch( box ){\r
case 3 : // border-box\r
this.contentL = borderL + paddingL;\r
this.contentR = borderR + paddingR;\r
\r
- if( this.constraintW ? allowW !== X.UI.Attr.AUTO : !this.autoWidth && ( allowW !== X.UI.Attr.AUTO || !this.percentWidth ) ){\r
+ if( this.constraintW ? allowedW !== X.UI.Attr.AUTO : !this.autoWidth && ( allowedW !== X.UI.Attr.AUTO || !this.percentWidth ) ){\r
if( this.constraintW ){ // 制約レイアウト\r
- contentW = allowW - ( boxL = calc( attrs[ X.UI.Attr.Support.left.No ], allowW ) ) - ( boxR = calc( attrs[ X.UI.Attr.Support.right.No ], allowW ) );\r
+ contentW = allowedW - ( boxL = calc( attrs[ X.UI.Attr.Support.left.No ], allowedW ) ) - ( boxR = calc( attrs[ X.UI.Attr.Support.right.No ], allowedW ) );\r
} else {\r
- contentW = _AbstractUINode.finalValue( attrs[ X.UI.Attr.Support.width.No ], attrs[ X.UI.Attr.Support.minWidth.No ], attrs[ X.UI.Attr.Support.maxWidth.No ], allowW ); \r
+ contentW = _AbstractUINode.finalValue( attrs[ X.UI.Attr.Support.width.No ], attrs[ X.UI.Attr.Support.minWidth.No ], attrs[ X.UI.Attr.Support.maxWidth.No ], allowedW ); \r
};\r
this.contentWidth = contentW + boxMinus;\r
this.scrollWidth = this.contentWidth + this.contentL + this.contentR;\r
delete this.minBoxWidth;\r
delete this.maxBoxWidth;\r
} else { \r
- this.minContentWidth = calc( attrs[ X.UI.Attr.Support.minWidth.No ], allowW ) + boxMinus;\r
- this.maxContentWidth = calc( attrs[ X.UI.Attr.Support.maxWidth.No ], allowW ) + boxMinus;\r
+ this.minContentWidth = calc( attrs[ X.UI.Attr.Support.minWidth.No ], allowedW ) + boxMinus;\r
+ this.maxContentWidth = calc( attrs[ X.UI.Attr.Support.maxWidth.No ], allowedW ) + boxMinus;\r
this.scrollWidth = this.contentWidth + this.contentL + this.contentR;\r
this.minBoxWidth = this.minContentWidth - boxMinus + this.contentL + this.contentR;\r
this.maxBoxWidth = this.maxContentWidth - boxMinus + this.contentL + this.contentR;\r
- delete this.contentWidth;\r
- delete this.scrollWidth;\r
- delete this.boxWidth;\r
- delete this.boxSizingOffsetLR;\r
+ //delete this.contentWidth;\r
+ //delete this.scrollWidth;\r
+ //delete this.boxWidth;\r
+ //delete this.boxSizingOffsetLR;\r
};\r
\r
- paddingT = calc( attrs[ X.UI.Attr.Support.padding.No + 0 ], allowH );// paddingTRBL の % 指定は 最大幅に対して TB でも幅に対して\r
- paddingB = calc( attrs[ X.UI.Attr.Support.padding.No + 2 ], allowH );\r
- borderT = calc( attrs[ X.UI.Attr.Support.borderWidth.No + 0 ], allowH );\r
- borderB = calc( attrs[ X.UI.Attr.Support.borderWidth.No + 2 ], allowH );\r
+ paddingT = calc( attrs[ X.UI.Attr.Support.padding.No + 0 ], allowedH );// paddingTRBL の % 指定は 最大幅に対して TB でも幅に対して\r
+ paddingB = calc( attrs[ X.UI.Attr.Support.padding.No + 2 ], allowedH );\r
+ borderT = calc( attrs[ X.UI.Attr.Support.borderWidth.No + 0 ], allowedH );\r
+ borderB = calc( attrs[ X.UI.Attr.Support.borderWidth.No + 2 ], allowedH );\r
boxMinus = 0;\r
switch( box ){\r
case 3 : // border-box\r
// case 1 : // content-box\r
};\r
this.contentT = borderT + paddingT;\r
- this.conetntB = borderB + paddingB;\r
+ this.contentB = borderB + paddingB;\r
\r
// Height\r
- if( this.constraintH ? allowH !== X.UI.Attr.AUTO : !this.autoHeight && ( allowH !== X.UI.Attr.AUTO || !this.percentHeight ) ){\r
+ if( this.constraintH ? allowedH !== X.UI.Attr.AUTO : !this.autoHeight && ( allowedH !== X.UI.Attr.AUTO || !this.percentHeight ) ){\r
if( this.constraintH ){ // 制約レイアウト\r
- contentH = allowH - ( boxT = calc( attrs[ X.UI.Attr.Support.top.No ], allowH ) ) - ( boxB = calc( attrs[ X.UI.Attr.Support.bottom.No ], allowH ) );\r
+ contentH = allowedH - ( boxT = calc( attrs[ X.UI.Attr.Support.top.No ], allowedH ) ) - ( boxB = calc( attrs[ X.UI.Attr.Support.bottom.No ], allowedH ) );\r
} else {\r
- contentH = _AbstractUINode.finalValue( attrs[ X.UI.Attr.Support.height.No ], attrs[ X.UI.Attr.Support.minHeight.No ], attrs[ X.UI.Attr.Support.maxHeight.No ], allowH );\r
+ contentH = _AbstractUINode.finalValue( attrs[ X.UI.Attr.Support.height.No ], attrs[ X.UI.Attr.Support.minHeight.No ], attrs[ X.UI.Attr.Support.maxHeight.No ], allowedH );\r
}; \r
this.contentHeight = contentH + boxMinus;\r
this.scrollHeight = this.contentHeight + this.contentT + this.contentB;\r
- this.boxHeight = contentH - boxMinus + this.contentT + this.conetntB; // padding-box の場合 border だけ足される\r
+ this.boxHeight = contentH - boxMinus + this.contentT + this.contentB; // padding-box の場合 border だけ足される\r
this.boxSizingOffsetTB = boxMinus;\r
delete this.minContentHeight;\r
delete this.maxContentHeight;\r
delete this.minBoxHeight;\r
delete this.maxBoxHeight;\r
} else {\r
- this.minContentHeight = calc( attrs[ X.UI.Attr.Support.minHeight.No ], allowH ) + boxMinus;\r
- this.maxContentHeight = calc( attrs[ X.UI.Attr.Support.maxHeight.No ], allowH ) + boxMinus; \r
- this.minBoxHeight = this.minContentHeight - boxMinus + this.contentT + this.conetntB;\r
- this.maxBoxHeight = this.maxContentHeight - boxMinus + this.contentT + this.conetntB;\r
+ this.minContentHeight = calc( attrs[ X.UI.Attr.Support.minHeight.No ], allowedH ) + boxMinus;\r
+ this.maxContentHeight = calc( attrs[ X.UI.Attr.Support.maxHeight.No ], allowedH ) + boxMinus; \r
+ this.minBoxHeight = this.minContentHeight - boxMinus + this.contentT + this.contentB;\r
+ this.maxBoxHeight = this.maxContentHeight - boxMinus + this.contentT + this.contentB;\r
\r
- delete this.contentHeight;\r
- delete this.scrollHeight;\r
- delete this.boxHeight;\r
- delete this.boxSizingOffsetTB;\r
+ //delete this.contentHeight;\r
+ //delete this.scrollHeight;\r
+ //delete this.boxHeight;\r
+ //delete this.boxSizingOffsetTB;\r
};\r
\r
if( this.parentData && this.parentData.layout.overrideAttrsForChild.left ){\r
if( this.constraintW ){\r
- this.boxX = ( boxL || boxL === 0 ) ? boxL : calc( attrs[ X.UI.Attr.Support.left.No ], allowW );\r
+ this.boxX = ( boxL || boxL === 0 ) ? boxL : calc( attrs[ X.UI.Attr.Support.left.No ], allowedW );\r
} else\r
if( attrs[ X.UI.Attr.Support.right.No ] === null ){\r
- this.boxX = ( boxL || boxL === 0 ) ? boxL : calc( attrs[ X.UI.Attr.Support.left.No ], allowW );\r
+ this.boxX = ( boxL || boxL === 0 ) ? boxL : calc( attrs[ X.UI.Attr.Support.left.No ], allowedW );\r
} else {\r
- this.boxX = alllowW - this.boxWidth - ( ( boxR || boxR === 0 ) ? boxR : calc( attrs[ X.UI.Attr.Support.right.No ], allowW ) );\r
+ this.boxX = alllowW - this.boxWidth - ( ( boxR || boxR === 0 ) ? boxR : calc( attrs[ X.UI.Attr.Support.right.No ], allowedW ) );\r
};\r
} else {\r
delete this.boxX;\r
\r
if( this.parentData && this.parentData.layout.overrideAttrsForChild.top ){\r
if( this.constraintH ){\r
- this.boxY = ( boxT || boxT === 0 ) ? boxT : calc( attrs[ X.UI.Attr.Support.top.No ], allowH );\r
+ this.boxY = ( boxT || boxT === 0 ) ? boxT : calc( attrs[ X.UI.Attr.Support.top.No ], allowedH );\r
} else\r
if( attrs[ X.UI.Attr.Support.bottom.No ] === null ){\r
- this.boxY = ( boxT || boxT === 0 ) ? boxT : calc( attrs[ X.UI.Attr.Support.top.No ], allowH );\r
+ this.boxY = ( boxT || boxT === 0 ) ? boxT : calc( attrs[ X.UI.Attr.Support.top.No ], allowedH );\r
} else {\r
- this.boxY = allowH - this.boxHeight - ( ( boxB || boxB === 0 ) ? boxB : calc( attrs[ X.UI.Attr.Support.bottom.No ], allowH ) );\r
+ this.boxY = allowedH - this.boxHeight - ( ( boxB || boxB === 0 ) ? boxB : calc( attrs[ X.UI.Attr.Support.bottom.No ], allowedH ) );\r
};\r
} else {\r
delete this.boxY;\r
case X.UI.Dirty.FONT : // フォントサイズが変更された\r
delete this.lastContentWidth;\r
case X.UI.Dirty.LAYOUT : // レイアウトの再計算が必要\r
+ \r
+ default : // TODO レイアウト崩れに対処 パフォーマンス悪い!\r
+ \r
w = this.contentWidth;\r
h = this.contentHeight;\r
xnode = this.xnode;\r
if( xnode._xnodes && xnode._xnodes.length ){\r
if( w === X.UI.Attr.AUTO ){\r
w = this.contentWidth = xnode.width() / xnode._getCharSize();\r
+ \r
this.scrollWidth = w + this.contentL + this.contentR;\r
if( this.maxContentWidth < w - this.boxSizingOffsetLR ) this.contentWidth = this.maxContentWidth + this.boxSizingOffsetLR;\r
if( w - this.boxSizingOffsetLR < this.minContentWidth ) this.contentWidth = this.minContentWidth + this.boxSizingOffsetLR;\r
w !== this.contentWidth && xnode.css( 'width', this.contentWidth + 'em' );\r
\r
if( h === X.UI.Attr.AUTO ){\r
- this.conetntHeight = h = xnode.height() / xnode._getCharSize();\r
+ this.contentHeight = h = xnode.height() / xnode._getCharSize();\r
this.scrollHeight = h + this.contentT + this.contentB;\r
if( this.maxContentHeight < h - this.boxSizingOffsetTB ) this.contentHeight = this.maxContentHeight + this.boxSizingOffsetTB;\r
if( h - this.boxSizingOffsetTB < this.minContentHeight ) this.contentHeight = this.minContentHeight + this.boxSizingOffsetTB;\r
if( h === X.UI.Attr.AUTO ){\r
if( w !== this.lastContentWidth ){\r
xnode.css( 'width', w + 'em' );\r
+ \r
this.lastContentWidth = w;\r
- this.conetntHeight = h = xnode.height() / xnode._getCharSize();\r
+ this.contentHeight = h = xnode.height() / xnode._getCharSize();\r
this.scrollWidth = w + this.contentL + this.contentR;\r
this.scrollHeight = h + this.contentT + this.contentB;\r
if( this.maxContentHeight < h - this.boxSizingOffsetTB ) this.contentHeight = this.maxContentHeight + this.boxSizingOffsetTB;\r
this.scrollWidth = w + this.contentL + this.contentR;\r
this.scrollHeight = h + this.contentT + this.contentB;\r
};\r
+ \r
+ delete this.dirty;\r
break; \r
//case X.UI.Dirty.PAINT : // 再描画のみ必要\r
// break;\r