PageRenderTime 39ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 1ms

/src/org/openPyro/core/MeasurableControl.as

http://github.com/arpit/openpyro
ActionScript | 845 lines | 441 code | 107 blank | 297 comment | 70 complexity | a252021c366d7d032b39db144207fb73 MD5 | raw file
  1. package org.openPyro.core{
  2. import flash.display.DisplayObject;
  3. import flash.display.Sprite;
  4. import flash.events.Event;
  5. import flash.events.MouseEvent;
  6. import org.openPyro.events.PyroEvent;
  7. [Event(name="preInitialize", type="org.openPyro.events.PyroEvent")]
  8. [Event(name="initialize", type="org.openPyro.events.PyroEvent")]
  9. [Event(name="sizeInvalidated", type="org.openPyro.events.PyroEvent")]
  10. [Event(name="sizeValidated", type="org.openPyro.events.PyroEvent")]
  11. [Event(name="sizeChanged", type="org.openPyro.events.PyroEvent")]
  12. [Event(name="updateComplete", type="org.openPyro.events.PyroEvent")]
  13. [Event(name="propertyChange", type="org.openPyro.events.PyroEvent")]
  14. [Event(name="resize", type="flash.events.Event")]
  15. /**
  16. * The Measurable control is the basic class that
  17. * participates in Pyro's measurement strategy. Measurable controls understand
  18. * a variety of properties like explicit height/width which is set if you set the
  19. * width or height property with an actual neumerical value, or percentUnusedWidth
  20. * and percentUnusedHeight which are set if the control's size is based on
  21. * measurement of the parent control. Controls can also be sized using the
  22. * percentWidth or percentHeight which is based on the parent's size without taking
  23. * the other children in the parent under consideration.
  24. *
  25. * Note: As of right now percentWidth and percentHeight may not be respected
  26. * by certain containers like DividedBoxes
  27. */
  28. public class MeasurableControl extends Sprite{
  29. public function MeasurableControl(){
  30. this.addEventListener(Event.ADDED, onAddedToParent);
  31. super.visible = false;
  32. }
  33. /**
  34. * The event listener executed when this component
  35. * has been added to the parent.
  36. */
  37. protected function onAddedToParent(event:Event):void{
  38. if(!this.parent) return;
  39. this.removeEventListener(Event.ADDED, onAddedToParent);
  40. this.addEventListener(Event.REMOVED, onRemovedFromParent,false,0,true);
  41. this._parentContainer = this.parent as UIControl;
  42. if(!_parentContainer)
  43. {
  44. doOnAdded();
  45. }
  46. }
  47. /**
  48. * Property indicates whether a control has been initialized
  49. * or not. Initialization happens the first time the control
  50. * is added to the parent.
  51. */
  52. public var initialized:Boolean = false;
  53. /**
  54. * This happens only once when a child is
  55. * first added to any parent. Subsequent
  56. * removeChild and addChild actions do not
  57. * trigger this function but rather directly call
  58. * validateSize.
  59. */
  60. public function initialize():void
  61. {
  62. dispatchEvent(new PyroEvent(PyroEvent.PREINITIALIZE))
  63. createChildren();
  64. dispatchEvent(new PyroEvent(PyroEvent.INITIALIZE));
  65. initialized = true;
  66. this.validateSize();
  67. }
  68. /**
  69. * This is where the new children should
  70. * be created and then added to the displaylist.
  71. * Similar to Flex's createChildren() method.
  72. */
  73. protected function createChildren():void{}
  74. protected var _explicitWidth:Number = NaN;
  75. protected var _explicitHeight:Number = NaN;
  76. /**
  77. * The width set in terms of actual pixels.
  78. * You do not call this function in your code.
  79. * Setting the width of the control to an actual
  80. * numeric value (rather than percent) calls this
  81. * function
  82. * Call this function only if you want to set
  83. * width without calling the invalidation methods
  84. *
  85. * [TODO] This class should
  86. * have namespace access control (pyro_internal)
  87. */
  88. public function set explicitWidth(w:Number):void{
  89. _explicitWidth = w;
  90. }
  91. /** The height set in terms of actual pixels.
  92. * You do not call this function in your code.
  93. * Setting the width of the control to an actual
  94. * numeric value (rather than percent) calls this
  95. * function
  96. * Call this function only if you want to set
  97. * width without calling the invalidation methods
  98. *
  99. * [TODO] This class should
  100. * have namespace access control (pyro_internal)
  101. */
  102. public function get explicitWidth():Number{
  103. return _explicitWidth;
  104. }
  105. /**
  106. * @private
  107. */
  108. public function set explicitHeight(h:Number):void{
  109. _explicitHeight = h;
  110. }
  111. /**
  112. * @private
  113. */
  114. public function get explicitHeight():Number{
  115. return this._explicitHeight;
  116. }
  117. /**
  118. * Set/get the width of the control. If the width
  119. * is set to a different value from the one the
  120. * control is already at, it triggers the size
  121. * invalidation cycle
  122. */
  123. override public function set width(n:Number):void{
  124. if(n == _explicitWidth) return;
  125. this._explicitWidth = n
  126. dimensionsChanged = true;
  127. displayListInvalidated = true;
  128. if(!initialized) return;
  129. invalidateSize();
  130. }
  131. /**
  132. * @private
  133. */
  134. override public function get width():Number{
  135. return this.getExplicitOrMeasuredWidth()
  136. }
  137. /**
  138. * Set/get the height of the control. If the height
  139. * is set to a different value from the one the
  140. * control is already at, it triggers the size
  141. * invalidation cycle
  142. */
  143. override public function set height(n:Number):void{
  144. if (n == _explicitHeight) return;
  145. this._explicitHeight = n
  146. displayListInvalidated = true;
  147. dimensionsChanged=true;
  148. if(!initialized) return;
  149. invalidateSize();
  150. //invalidateDisplayList();
  151. }
  152. /**
  153. * @private
  154. */
  155. override public function get height():Number{
  156. return this.getExplicitOrMeasuredHeight();
  157. }
  158. protected var _maximumWidth:Number = NaN;
  159. public function set maximumWidth(n:Number):void{
  160. _maximumWidth = n;
  161. invalidateSize();
  162. }
  163. public function get maximumWidth():Number{
  164. return _maximumWidth;
  165. }
  166. /*protected var _minimumHeight:Number = NaN;
  167. public function set minimumHeight(n:Number):void{
  168. _minimumHeight = n;
  169. invalidateSize();
  170. }
  171. public function get minimumHeight():Number{
  172. return _minimumHeight;
  173. }*/
  174. protected var _maximumHeight:Number = NaN;
  175. public function set maximumHeight(n:Number):void{
  176. _maximumHeight = n;
  177. invalidateSize();
  178. }
  179. public function get maximumHeight():Number{
  180. return _maximumHeight;
  181. }
  182. protected var _percentUnusedWidth:Number;
  183. protected var _percentUnusedHeight:Number;
  184. /**
  185. * Only setting percent width/heights changes the
  186. * needsMeasurement flag which makes its parent
  187. * container call measure on it.
  188. * If width and height are set directly, measurement
  189. * is never called (although size invalidation
  190. * still does if size has changed)
  191. */
  192. public var needsMeasurement:Boolean=true;
  193. /**
  194. * Set/get the percent width. If the value is
  195. * different from the earlier, it sets the measurement
  196. * flag and calls invalidateSize
  197. */
  198. public function set percentUnusedWidth(w:Number):void{
  199. if(w == _percentUnusedWidth) return;
  200. _percentUnusedWidth = w;
  201. if(!initialized) return;
  202. invalidateSize()
  203. }
  204. /**
  205. * @private
  206. */
  207. public function get percentUnusedWidth():Number{
  208. return _percentUnusedWidth;
  209. }
  210. /**
  211. * Set/get the percent height. If the value is
  212. * different from the earlier, it sets the measurement
  213. * flag and calls invalidateSize
  214. */
  215. public function set percentUnusedHeight(h:Number):void{
  216. if(h==_percentUnusedHeight) return;
  217. //needsMeasurement = true;
  218. _percentUnusedHeight = h;
  219. if(!initialized) return;
  220. this.invalidateSize()
  221. }
  222. protected var _percentWidth:Number
  223. public function set percentWidth(w:Number):void
  224. {
  225. if(w==_percentWidth) return;
  226. _percentWidth = w;
  227. if(!initialized) return;
  228. this.invalidateSize()
  229. }
  230. public function get percentWidth():Number
  231. {
  232. return _percentWidth
  233. }
  234. protected var _percentHeight:Number
  235. public function set percentHeight(h:Number):void
  236. {
  237. if(h==_percentHeight) return;
  238. _percentHeight = h;
  239. if(!initialized) return;
  240. this.invalidateSize()
  241. }
  242. public function get percentHeight():Number
  243. {
  244. return _percentHeight;
  245. }
  246. /**
  247. * @private
  248. */
  249. public function get percentUnusedHeight():Number{
  250. return _percentUnusedHeight;
  251. }
  252. protected var _parentContainer:UIControl;
  253. public function set parentContainer(c:UIControl):void{
  254. this._parentContainer = c;
  255. }
  256. public function get parentContainer():UIControl
  257. {
  258. return _parentContainer;
  259. }
  260. /**
  261. * The flag to mark that the control's size
  262. * has been invalidated. This means the control
  263. * is now waiting for a validateSize call.
  264. */
  265. public var sizeInvalidated:Boolean=false;
  266. /**
  267. * Marks itself dirty and waits till either the container
  268. * to validateSize or validates itself at the next enterframe
  269. * if it has no parent container.
  270. *
  271. * This method is overridden by UIControl. The code here
  272. * will only be useful for a Spacer type of component.
  273. */
  274. public function invalidateSize(event:PyroEvent=null):void{
  275. if(sizeInvalidated) return;
  276. sizeInvalidated=true;
  277. dispatchEvent(new PyroEvent(PyroEvent.SIZE_INVALIDATED));
  278. if(!this._parentContainer){
  279. /*
  280. * If this is not contained in a OpenPyro control,
  281. * take the responsibility for validating the
  282. * displaylist
  283. */
  284. this.addEventListener(Event.ENTER_FRAME, doQueuedValidateSize);
  285. }
  286. }
  287. /**
  288. * doQueueValidateSize is executed by the top level UIControl.
  289. */
  290. protected function doQueuedValidateSize(event:Event):void
  291. {
  292. this.removeEventListener(Event.ENTER_FRAME, doQueuedValidateSize);
  293. this.validateSize();
  294. }
  295. /**
  296. * This property defines whether measure() will be called during
  297. * validateSize() or not.
  298. */
  299. public function get usesMeasurementStrategy():Boolean{
  300. if(isNaN(this._explicitHeight) || isNaN(this._explicitWidth)){
  301. return true;
  302. }
  303. else{
  304. return false;
  305. }
  306. }
  307. /**
  308. * The validateSize function is called in response to
  309. * a component declaring its size invalid (usually
  310. * by calling invalidateSize()). The job of this
  311. * method is to compute the final width and height
  312. * (whether by calling measure if an explicit w/h
  313. * is not declared or not if an explicit w & h is
  314. * declared)
  315. *
  316. * @see invalidateSize()
  317. * @see measure()
  318. * @see usesMeasurementStrategy
  319. */
  320. public function validateSize():void{
  321. if(usesMeasurementStrategy){
  322. measure();
  323. checkDisplayListValidation()
  324. sizeInvalidated=false;
  325. }
  326. else{
  327. sizeInvalidated=false;
  328. if(displayListInvalidated){
  329. queueValidateDisplayList();
  330. }
  331. }
  332. for(var j:uint=0; j<this.numChildren; j++){
  333. var child:MeasurableControl = this.getChildAt(j) as MeasurableControl;
  334. if(!child) continue;
  335. child.validateSize()
  336. //child.dispatchEvent(new PyroEvent(PyroEvent.SIZE_VALIDATED));
  337. }
  338. dispatchEvent(new PyroEvent(PyroEvent.SIZE_VALIDATED));
  339. }
  340. /**
  341. * [Temp] This function is called automatically
  342. * by a parent UIControl if this is created as a
  343. * child of a UIControl. Else you have to call
  344. * this function for now.
  345. */
  346. public function doOnAdded():void
  347. {
  348. if(!initialized){
  349. this.initialize();
  350. initialized = true;
  351. }
  352. else
  353. {
  354. validateSize();
  355. }
  356. if(!(this.parent is UIControl)) {
  357. if(displayListInvalidated){
  358. queueValidateDisplayList();
  359. }
  360. }
  361. else{
  362. if(this.sizeInvalidated){
  363. _parentContainer.invalidateSize();
  364. }
  365. }
  366. }
  367. protected var _measuredWidth:Number=NaN;
  368. protected var _measuredHeight:Number=NaN;
  369. protected var _dimensionsChanged:Boolean=true;
  370. public function get dimensionsChanged():Boolean{
  371. return _dimensionsChanged;
  372. }
  373. public function set dimensionsChanged(val:Boolean):void{
  374. _dimensionsChanged = val;
  375. }
  376. /**
  377. * Measure is called during the validateSize if
  378. * the needsmeasurement flag is set.
  379. * At this point, new measured width/heights are
  380. * calculated. If these values are different from
  381. * the values previously calculated, the
  382. * resizeHandler is queued for the next enterframe
  383. *
  384. */
  385. public function measure():void{
  386. if(isNaN(this._explicitWidth))
  387. {
  388. calculateMeasuredWidth()
  389. }
  390. if(isNaN(this._explicitHeight))
  391. {
  392. calculateMeasuredHeight();
  393. }
  394. this.needsMeasurement=false;
  395. }
  396. /**
  397. * Calculates the measuredWidth property.
  398. */
  399. protected function calculateMeasuredWidth():void
  400. {
  401. var computedWidth:Number;
  402. if(!isNaN(this._percentUnusedWidth) && this._parentContainer)
  403. {
  404. computedWidth = this._parentContainer.widthForMeasurement()*this._percentUnusedWidth/100;
  405. }
  406. else if(!isNaN(this._percentWidth) && this._parentContainer)
  407. {
  408. computedWidth = this._parentContainer.width*this._percentWidth/100;
  409. }
  410. if(!isNaN(_maximumWidth)){
  411. computedWidth = Math.min(_maximumWidth, computedWidth);
  412. }
  413. measuredWidth = computedWidth;
  414. }
  415. /**
  416. * Calculates the measuredHeight property.
  417. */
  418. protected function calculateMeasuredHeight():void
  419. {
  420. var computedHeight:Number;
  421. if(!isNaN(this._percentUnusedHeight) && this._parentContainer)
  422. {
  423. computedHeight = this._parentContainer.heightForMeasurement()*this._percentUnusedHeight/100;
  424. }
  425. else if(!isNaN(this._percentHeight) && this._parentContainer)
  426. {
  427. computedHeight = this._parentContainer.height*this._percentHeight/100;
  428. }
  429. if(!isNaN(_maximumHeight)){
  430. computedHeight = Math.min(_maximumHeight, computedHeight);
  431. }
  432. this.measuredHeight = computedHeight;
  433. }
  434. /**
  435. * Set the measured height of the control. This is
  436. * usually set by the same control's measure()
  437. * function. If the measuredHeight is changed,
  438. * the displayList is invalidated
  439. */
  440. public function set measuredHeight(h:Number):void{
  441. if(h == _measuredHeight) return;
  442. _measuredHeight = h;
  443. displayListInvalidated = true;
  444. dimensionsChanged = true;
  445. }
  446. /**
  447. * @private
  448. */
  449. public function get measuredHeight():Number
  450. {
  451. return _measuredHeight;
  452. }
  453. /**
  454. * Returns the measured width after the control has been
  455. * measured. Note this value will return NaN if the control
  456. * is explicitly sized by setting the explicitWidth property
  457. */
  458. public function set measuredWidth(w:Number):void{
  459. if(w == _measuredWidth) return;
  460. _measuredWidth = w;
  461. displayListInvalidated = true;
  462. dimensionsChanged = true
  463. }
  464. /**
  465. * @private
  466. */
  467. public function get measuredWidth():Number
  468. {
  469. return _measuredWidth;
  470. }
  471. /**
  472. * Flag to mark a dirty displaylist. It basically means it is
  473. * waiting for a call to updateDisplayList at some point
  474. */
  475. public var displayListInvalidated:Boolean=true;
  476. protected var _forceInvalidateDisplayList:Boolean=false;
  477. protected var forceUpdateDisplayList:Boolean = false;
  478. public function set forceInvalidateDisplayList(val:Boolean):void{
  479. _forceInvalidateDisplayList = val;
  480. forceUpdateDisplayList = val;
  481. }
  482. public function get forceInvalidateDisplayList():Boolean{
  483. return _forceInvalidateDisplayList;
  484. }
  485. protected function invalidateDisplayList():void{
  486. if(!initialized) return;
  487. if((!this.sizeInvalidated && !displayListInvalidated) || _forceInvalidateDisplayList){
  488. _forceInvalidateDisplayList=false;
  489. displayListInvalidated=true;
  490. queueValidateDisplayList();
  491. }
  492. }
  493. /**
  494. * Calls the queueValidateDisplayList if measure causes
  495. * _dimensionsChanged to change to true.
  496. *
  497. * UIControl overrides this with a call to doChildBasedValidation
  498. * which then goes and checks if the size of the children
  499. * affects the size of the control.
  500. */
  501. public function checkDisplayListValidation():void{
  502. if(dimensionsChanged){
  503. queueValidateDisplayList()
  504. }
  505. }
  506. /**
  507. * This function is called if the framework determines that dimensions of the
  508. * control have changed. This determination is made during the validateSize() function.
  509. *
  510. * If this control is the top level OpenPyro control, it will validate the displaylist
  511. * in the next enter frame, otherwise it just dispatches the size changed event
  512. * and waits till the validateDisplaylist is called.
  513. */
  514. public function queueValidateDisplayList(event:PyroEvent=null):void{
  515. if(this._parentContainer && dimensionsChanged){
  516. dispatchEvent(new PyroEvent(PyroEvent.SIZE_CHANGED));
  517. }else{
  518. if(this.stage){
  519. stage.invalidate();
  520. this.stage.addEventListener(Event.RENDER, validateDisplayList);
  521. }
  522. }
  523. }
  524. /**
  525. * validateDisplayList is called as a response to invalidateDisplayList.
  526. */
  527. public function validateDisplayList(event:Event=null):void{
  528. if(isNaN(this.getExplicitOrMeasuredWidth()) || isNaN(this.getExplicitOrMeasuredHeight())){
  529. return;
  530. }
  531. if(event){
  532. this.removeEventListener(Event.RENDER,validateDisplayList)
  533. }
  534. for(var j:uint=0; j<this.numChildren; j++){
  535. var child:MeasurableControl = this.getChildAt(j) as MeasurableControl;
  536. if(!child) continue;
  537. child.validateDisplayList()
  538. }
  539. if(dimensionsChanged || forceUpdateDisplayList){
  540. forceUpdateDisplayList = false;
  541. this.updateDisplayList(this.getExplicitOrMeasuredWidth(), this.getExplicitOrMeasuredHeight());
  542. dimensionsChanged = false;
  543. resizeHandler();
  544. }
  545. this.displayListInvalidated=false
  546. dispatchUpdateComplete();
  547. }
  548. /*
  549. TODO:
  550. protected var _unscaledWidth:Number = NaN;
  551. protected var _unscaledHeight:Number = NaN;
  552. public function setActualSize(w:Number, h:Number):void
  553. {
  554. _unscaledWidth = w;
  555. _unscaledHeight = h;
  556. this.validateSize()
  557. this.validateDisplayList()
  558. }
  559. */
  560. protected var _creationCompleteFired:Boolean = false;
  561. public function get creationCompleteFired():Boolean{
  562. return _creationCompleteFired;
  563. }
  564. /**
  565. * Dispatches the UpdateComplete event
  566. */
  567. protected function dispatchUpdateComplete():void{
  568. dispatchEvent(new PyroEvent(PyroEvent.UPDATE_COMPLETE));
  569. if(!_creationCompleteFired){
  570. if(this._isVisible){
  571. this.visible = true;
  572. }
  573. dispatchEvent(new PyroEvent(PyroEvent.CREATION_COMPLETE));
  574. _creationCompleteFired = true;
  575. }
  576. }
  577. /**
  578. * @private
  579. */
  580. protected var _isVisible:Boolean = true;
  581. /**
  582. * @inheritDoc
  583. */
  584. override public function set visible(value:Boolean):void{
  585. this._isVisible = value;
  586. super.visible =value
  587. }
  588. public function resizeHandler():void{
  589. //trace('resize');
  590. dispatchEvent(new Event(Event.RESIZE));
  591. }
  592. /**
  593. * The updateDisplayList is triggered everytime the framework
  594. * determines that some event has taken place that needs the
  595. * UI to be refreshed.
  596. *
  597. * @param unscaledWidth The computed width of the control
  598. * @param unscaledHeight The computed height of the control
  599. */
  600. public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
  601. // stub. This is overridden in later controls
  602. }
  603. /**
  604. * Returns the explicitly defined width or the measured
  605. * number computed by the <code>measure</code> function.
  606. *
  607. */
  608. public function getExplicitOrMeasuredWidth():Number{
  609. if(!isNaN(this._explicitWidth)){
  610. return _explicitWidth
  611. }
  612. else{
  613. return _measuredWidth
  614. }
  615. }
  616. /**
  617. * Returns the explicitly defined height or the measured
  618. * height computed by the <code>measure</code> function.
  619. */
  620. public function getExplicitOrMeasuredHeight():Number{
  621. if(!isNaN(this._explicitHeight)){
  622. return _explicitHeight
  623. }
  624. else{
  625. return _measuredHeight
  626. }
  627. }
  628. private function onRemovedFromParent(event:Event):void{
  629. this.addEventListener(Event.ADDED, onAddedToParent);
  630. }
  631. ///////// Utils ///////////
  632. public function cancelMouseEvents():void{
  633. this.addEventListener(MouseEvent.MOUSE_OVER, disableEvent, true, 1,true);
  634. this.addEventListener(MouseEvent.MOUSE_DOWN, disableEvent, true, 1,true);
  635. this.addEventListener(MouseEvent.MOUSE_OUT, disableEvent, true, 1,true);
  636. this.addEventListener(MouseEvent.MOUSE_MOVE, disableEvent, true, 1,true);
  637. //this.addEventListener(MouseEvent.MOUSE_UP, disableEvent, true, 1,true);
  638. this.addEventListener(MouseEvent.CLICK, disableEvent, true, 1,true);
  639. _mouseActionsDisabled = true
  640. }
  641. public function enableMouseEvents():void{
  642. //this.removeEventListener(MouseEvent.MOUSE_UP, disableEvent,true);
  643. this.removeEventListener(MouseEvent.MOUSE_OVER, disableEvent,true);
  644. this.removeEventListener(MouseEvent.MOUSE_DOWN, disableEvent,true);
  645. this.removeEventListener(MouseEvent.MOUSE_OUT, disableEvent,true);
  646. this.removeEventListener(MouseEvent.CLICK, disableEvent,true);
  647. this.removeEventListener(MouseEvent.MOUSE_MOVE, disableEvent,true);
  648. _mouseActionsDisabled = false;
  649. }
  650. protected function disableEvent(event:Event):void{
  651. event.stopImmediatePropagation()
  652. event.preventDefault()
  653. }
  654. protected var _mouseActionsDisabled:Boolean = false;
  655. public function get mouseActionsDisabled():Boolean{
  656. return _mouseActionsDisabled;
  657. }
  658. /**
  659. * Utility function to check if a mouseEvent happened
  660. * while the mouse was over the displayObject
  661. */
  662. public function isMouseOver(event:MouseEvent):Boolean{
  663. if(event.localX < this.width && event.localX > 0 &&
  664. event.localY < this.height && event.localY > 0){
  665. return true
  666. }
  667. else{
  668. return false
  669. }
  670. }
  671. /**
  672. * @private
  673. * Since the addChild function is overridden in all MeasurableControls,
  674. * this function is defined to keep the native implementation available
  675. */
  676. public final function $addChild(child:DisplayObject):DisplayObject
  677. {
  678. return super.addChild(child);
  679. }
  680. /**
  681. * @private
  682. * Since the addChild function is overridden in all MeasurableControls,
  683. * this function is defined to keep the native implementation available
  684. */
  685. public final function $addChildAt(child:DisplayObject, index:int):DisplayObject
  686. {
  687. return super.addChildAt(child,index);
  688. }
  689. private var _includeInLayout:Boolean = true
  690. /**
  691. * @private
  692. */
  693. public function set includeInLayout(value:Boolean):void{
  694. _includeInLayout = value
  695. }
  696. /**
  697. * Specifies whether this control participates in the
  698. * layout system in OpenPyro. For example if you have 3
  699. * <code>UIControls</code> sitting in a container with a
  700. * <code>HLayout</code> layout, but the second control as the
  701. * includeInLayout property set to false, the layout will
  702. * not position that control.
  703. */
  704. public function get includeInLayout():Boolean{
  705. return _includeInLayout;
  706. }
  707. /**
  708. * @private
  709. */
  710. public final function get $width():Number
  711. {
  712. return super.width
  713. }
  714. /**
  715. * @private
  716. */
  717. final public function set $width(w:Number):void
  718. {
  719. super.width = w;
  720. }
  721. /**
  722. * @private
  723. */
  724. final public function get $height():Number
  725. {
  726. return super.height
  727. }
  728. /**
  729. * @private
  730. */
  731. final public function set $height(h:Number):void
  732. {
  733. super.height = h;
  734. }
  735. }
  736. }