MVC 模型設(shè)計(jì)
控件的關(guān)鍵圖
contrl -> 'model'
skin -> 'view'
skin -> 'controler'
![control class hierarchy](https://wiki.openjdk.java.net/download/thumbnails/8257553/dep.png?version=1&modificationDate=1355336444000&api=v2)
control class hierarchy
控件的生命周期
- 構(gòu)造函數(shù)的執(zhí)行
- 在構(gòu)造函數(shù)中設(shè)置樣式表
- 當(dāng)構(gòu)造函數(shù)執(zhí)行后标锄≈值控件并沒(méi)有生成skin,并不會(huì)在布局中考慮到它逊移。此時(shí)它的高和寬都會(huì)表現(xiàn)為0.
- 將控件加入scene graph 中
- 只有當(dāng)加入scece graph中以后激挪,當(dāng)下一個(gè)脈沖周期中究飞,該控件才會(huì)被渲染出來(lái)并且被布局箱亿。
- 脈沖周期中逛犹,首先會(huì)運(yùn)行控件的impl_processCSS() 方法 應(yīng)用級(jí)聯(lián)樣式表(css) .