/AdobeAIRSDK/frameworks/projects/framework/src/mx/containers/utilityClasses/PostScaleAdapter.as

https://github.com/kibiz0r/FlashRuby · ActionScript · 1371 lines · 428 code · 160 blank · 783 comment · 21 complexity · 59dcd9e17e073f2ecc9250f4b6939858 MD5 · raw file

  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // ADOBE SYSTEMS INCORPORATED
  4. // Copyright 2008 Adobe Systems Incorporated
  5. // All Rights Reserved.
  6. //
  7. // NOTICE: Adobe permits you to use, modify, and distribute this file
  8. // in accordance with the terms of the license agreement accompanying it.
  9. //
  10. ////////////////////////////////////////////////////////////////////////////////
  11. package mx.containers.utilityClasses
  12. {
  13. import flash.accessibility.AccessibilityProperties;
  14. import flash.display.DisplayObject;
  15. import flash.display.DisplayObjectContainer;
  16. import flash.display.LoaderInfo;
  17. import flash.display.Sprite;
  18. import flash.display.Stage;
  19. import flash.events.Event;
  20. import flash.geom.Point;
  21. import flash.geom.Rectangle;
  22. import flash.geom.Transform;
  23. import mx.core.FlexVersion;
  24. import mx.core.IConstraintClient;
  25. import mx.core.IInvalidating;
  26. import mx.core.IUIComponent;
  27. import mx.managers.ISystemManager;
  28. /**
  29. * The PostScaleAdapter class is used as a compatibility layer for Flex 3 classes that
  30. * rely on width, height, min, max, explicit, measured, and other properties to be
  31. * determined after scaling is applied.
  32. * This is useful since in Flex 4, the properties are calculated before scaling is applied.
  33. *
  34. * @langversion 3.0
  35. * @playerversion Flash 9
  36. * @playerversion AIR 1.1
  37. * @productversion Flex 3
  38. */
  39. public class PostScaleAdapter implements IUIComponent,
  40. IConstraintClient,
  41. IInvalidating
  42. {
  43. /**
  44. * Call getCompatibleIUIComponent when you need to work with an IUIComponent that
  45. * reports width, height, min, max, explicit, measured, etc. in post-scale coordinates.
  46. *
  47. * @langversion 3.0
  48. * @playerversion Flash 9
  49. * @playerversion AIR 1.1
  50. * @productversion Flex 3
  51. */
  52. static public function getCompatibleIUIComponent(obj:Object):IUIComponent
  53. {
  54. // We support only IUIComponent
  55. var uic:IUIComponent = obj as IUIComponent;
  56. if (!uic)
  57. return null;
  58. // If object is not scaled, then we don't need the adapter. We also don't
  59. // need the adapter if we are in compatibility mode.
  60. if (uic.scaleX == 1 && uic.scaleY == 1 || FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
  61. return uic;
  62. // Make sure we don't adjust for scale twice!
  63. if (uic is PostScaleAdapter)
  64. return uic;
  65. // Flex4, we should adjust for scale
  66. return new PostScaleAdapter(uic);
  67. }
  68. private var obj:IUIComponent;
  69. public function PostScaleAdapter(obj:IUIComponent)
  70. {
  71. this.obj = obj;
  72. }
  73. //--------------------------------------------------------------------------
  74. //
  75. // Properties
  76. //
  77. //--------------------------------------------------------------------------
  78. //----------------------------------
  79. // baselinePosition
  80. //----------------------------------
  81. /**
  82. *
  83. *
  84. * @langversion 3.0
  85. * @playerversion Flash 9
  86. * @playerversion AIR 1.1
  87. * @productversion Flex 3
  88. */
  89. public function get baselinePosition():Number
  90. { return obj.baselinePosition; }
  91. //----------------------------------
  92. // document
  93. //----------------------------------
  94. /**
  95. * @inheritDoc
  96. *
  97. * @langversion 3.0
  98. * @playerversion Flash 9
  99. * @playerversion AIR 1.1
  100. * @productversion Flex 3
  101. */
  102. public function get document():Object
  103. {
  104. return obj.document;
  105. }
  106. /**
  107. * @private
  108. */
  109. public function set document(value:Object):void
  110. {
  111. obj.document = value;
  112. }
  113. //----------------------------------
  114. // enabled
  115. //----------------------------------
  116. /**
  117. * @inheritDoc
  118. *
  119. * @langversion 3.0
  120. * @playerversion Flash 9
  121. * @playerversion AIR 1.1
  122. * @productversion Flex 3
  123. */
  124. public function get enabled():Boolean
  125. {
  126. return obj.enabled;
  127. }
  128. /**
  129. * @private
  130. */
  131. public function set enabled(value:Boolean):void
  132. {
  133. obj.enabled = value;
  134. }
  135. //----------------------------------
  136. // explicitHeight
  137. //----------------------------------
  138. /**
  139. * @inheritDoc
  140. *
  141. * @langversion 3.0
  142. * @playerversion Flash 9
  143. * @playerversion AIR 1.1
  144. * @productversion Flex 3
  145. */
  146. public function get explicitHeight():Number
  147. {
  148. return obj.explicitHeight * Math.abs(obj.scaleY);
  149. }
  150. /**
  151. * @private
  152. */
  153. public function set explicitHeight(value:Number):void
  154. {
  155. obj.explicitHeight = (obj.scaleY == 0) ? 0 : value / Math.abs(obj.scaleY);
  156. }
  157. //----------------------------------
  158. // explicitMaxHeight
  159. //----------------------------------
  160. /**
  161. * @inheritDoc
  162. *
  163. * @langversion 3.0
  164. * @playerversion Flash 9
  165. * @playerversion AIR 1.1
  166. * @productversion Flex 3
  167. */
  168. public function get explicitMaxHeight():Number
  169. {
  170. return obj.explicitMaxHeight * Math.abs(obj.scaleY);
  171. }
  172. //----------------------------------
  173. // explicitMaxWidth
  174. //----------------------------------
  175. /**
  176. * @inheritDoc
  177. *
  178. * @langversion 3.0
  179. * @playerversion Flash 9
  180. * @playerversion AIR 1.1
  181. * @productversion Flex 3
  182. */
  183. public function get explicitMaxWidth():Number
  184. {
  185. return obj.explicitMaxWidth * Math.abs(obj.scaleX);
  186. }
  187. //----------------------------------
  188. // explicitMinHeight
  189. //----------------------------------
  190. /**
  191. * @inheritDoc
  192. *
  193. * @langversion 3.0
  194. * @playerversion Flash 9
  195. * @playerversion AIR 1.1
  196. * @productversion Flex 3
  197. */
  198. public function get explicitMinHeight():Number
  199. {
  200. return obj.explicitMinHeight * Math.abs(obj.scaleY);
  201. }
  202. //----------------------------------
  203. // explicitMinWidth
  204. //----------------------------------
  205. /**
  206. * @inheritDoc
  207. *
  208. * @langversion 3.0
  209. * @playerversion Flash 9
  210. * @playerversion AIR 1.1
  211. * @productversion Flex 3
  212. */
  213. public function get explicitMinWidth():Number
  214. {
  215. return obj.explicitMinWidth * Math.abs(obj.scaleX);
  216. }
  217. //----------------------------------
  218. // explicitWidth
  219. //----------------------------------
  220. /**
  221. * @inheritDoc
  222. *
  223. * @langversion 3.0
  224. * @playerversion Flash 9
  225. * @playerversion AIR 1.1
  226. * @productversion Flex 3
  227. */
  228. public function get explicitWidth():Number
  229. {
  230. return obj.explicitWidth * Math.abs(obj.scaleX);
  231. }
  232. /**
  233. * @private
  234. */
  235. public function set explicitWidth(value:Number):void
  236. {
  237. obj.explicitWidth = (obj.scaleX == 0) ? 0 : value / Math.abs(obj.scaleX);
  238. }
  239. //----------------------------------
  240. // focusPane
  241. //----------------------------------
  242. /**
  243. * @inheritDoc
  244. *
  245. * @langversion 3.0
  246. * @playerversion Flash 9
  247. * @playerversion AIR 1.1
  248. * @productversion Flex 3
  249. */
  250. public function get focusPane():Sprite
  251. {
  252. return obj.focusPane;
  253. }
  254. /**
  255. * @private
  256. */
  257. public function set focusPane(value:Sprite):void
  258. {
  259. obj.focusPane = value;
  260. }
  261. //----------------------------------
  262. // includeInLayout
  263. //----------------------------------
  264. /**
  265. * @inheritDoc
  266. *
  267. * @langversion 3.0
  268. * @playerversion Flash 9
  269. * @playerversion AIR 1.1
  270. * @productversion Flex 3
  271. */
  272. public function get includeInLayout():Boolean
  273. {
  274. return obj.includeInLayout;
  275. }
  276. /**
  277. * @private
  278. */
  279. public function set includeInLayout(value:Boolean):void
  280. {
  281. obj.includeInLayout = value;
  282. }
  283. //----------------------------------
  284. // isPopUp
  285. //----------------------------------
  286. /**
  287. * @inheritDoc
  288. *
  289. * @langversion 3.0
  290. * @playerversion Flash 9
  291. * @playerversion AIR 1.1
  292. * @productversion Flex 3
  293. */
  294. public function get isPopUp():Boolean
  295. {
  296. return obj.isPopUp;
  297. }
  298. /**
  299. * @private
  300. */
  301. public function set isPopUp(value:Boolean):void
  302. {
  303. obj.isPopUp = value;
  304. }
  305. //----------------------------------
  306. // maxHeight
  307. //----------------------------------
  308. /**
  309. * @inheritDoc
  310. *
  311. * @langversion 3.0
  312. * @playerversion Flash 9
  313. * @playerversion AIR 1.1
  314. * @productversion Flex 3
  315. */
  316. public function get maxHeight():Number
  317. {
  318. return obj.maxHeight * Math.abs(obj.scaleY);
  319. }
  320. //----------------------------------
  321. // maxWidth
  322. //----------------------------------
  323. /**
  324. * @inheritDoc
  325. *
  326. * @langversion 3.0
  327. * @playerversion Flash 9
  328. * @playerversion AIR 1.1
  329. * @productversion Flex 3
  330. */
  331. public function get maxWidth():Number
  332. {
  333. return obj.maxWidth * Math.abs(obj.scaleX);
  334. }
  335. //----------------------------------
  336. // measuredMinHeight
  337. //----------------------------------
  338. /**
  339. * @inheritDoc
  340. *
  341. * @langversion 3.0
  342. * @playerversion Flash 9
  343. * @playerversion AIR 1.1
  344. * @productversion Flex 3
  345. */
  346. public function get measuredMinHeight():Number
  347. {
  348. return obj.measuredMinHeight * Math.abs(obj.scaleY);
  349. }
  350. /**
  351. * @private
  352. */
  353. public function set measuredMinHeight(value:Number):void
  354. {
  355. obj.measuredMinHeight = (obj.scaleY == 0) ? 0 : value / Math.abs(obj.scaleY);
  356. }
  357. //----------------------------------
  358. // measuredMinWidth
  359. //----------------------------------
  360. /**
  361. * @inheritDoc
  362. *
  363. * @langversion 3.0
  364. * @playerversion Flash 9
  365. * @playerversion AIR 1.1
  366. * @productversion Flex 3
  367. */
  368. public function get measuredMinWidth():Number
  369. {
  370. return obj.measuredMinWidth * Math.abs(obj.scaleX);
  371. }
  372. /**
  373. * @private
  374. */
  375. public function set measuredMinWidth(value:Number):void
  376. {
  377. obj.measuredMinWidth = (obj.scaleX == 0) ? 0 : value / Math.abs(obj.scaleX);
  378. }
  379. //----------------------------------
  380. // minHeight
  381. //----------------------------------
  382. /**
  383. * @inheritDoc
  384. *
  385. * @langversion 3.0
  386. * @playerversion Flash 9
  387. * @playerversion AIR 1.1
  388. * @productversion Flex 3
  389. */
  390. public function get minHeight():Number
  391. {
  392. return obj.minHeight * Math.abs(obj.scaleY);
  393. }
  394. //----------------------------------
  395. // minWidth
  396. //----------------------------------
  397. /**
  398. * @inheritDoc
  399. *
  400. * @langversion 3.0
  401. * @playerversion Flash 9
  402. * @playerversion AIR 1.1
  403. * @productversion Flex 3
  404. */
  405. public function get minWidth():Number
  406. {
  407. return obj.minWidth * Math.abs(obj.scaleX);
  408. }
  409. //----------------------------------
  410. // owner
  411. //----------------------------------
  412. /**
  413. * @inheritDoc
  414. *
  415. * @langversion 3.0
  416. * @playerversion Flash 9
  417. * @playerversion AIR 1.1
  418. * @productversion Flex 3
  419. */
  420. public function get owner():DisplayObjectContainer
  421. {
  422. return obj.owner;
  423. }
  424. /**
  425. * @private
  426. */
  427. public function set owner(value:DisplayObjectContainer):void
  428. {
  429. obj.owner = value;
  430. }
  431. //----------------------------------
  432. // percentHeight
  433. //----------------------------------
  434. /**
  435. * @inheritDoc
  436. *
  437. * @langversion 3.0
  438. * @playerversion Flash 9
  439. * @playerversion AIR 1.1
  440. * @productversion Flex 3
  441. */
  442. public function get percentHeight():Number
  443. {
  444. return obj.percentHeight;
  445. }
  446. /**
  447. * @private
  448. */
  449. public function set percentHeight(value:Number):void
  450. {
  451. obj.percentHeight = value;
  452. }
  453. //----------------------------------
  454. // percentWidth
  455. //----------------------------------
  456. /**
  457. * @inheritDoc
  458. *
  459. * @langversion 3.0
  460. * @playerversion Flash 9
  461. * @playerversion AIR 1.1
  462. * @productversion Flex 3
  463. */
  464. public function get percentWidth():Number
  465. {
  466. return obj.percentWidth;
  467. }
  468. /**
  469. * @private
  470. */
  471. public function set percentWidth(value:Number):void
  472. {
  473. obj.percentWidth = value;
  474. }
  475. //----------------------------------
  476. // systemManager
  477. //----------------------------------
  478. /**
  479. * @inheritDoc
  480. *
  481. * @langversion 3.0
  482. * @playerversion Flash 9
  483. * @playerversion AIR 1.1
  484. * @productversion Flex 3
  485. */
  486. public function get systemManager():ISystemManager
  487. {
  488. return obj.systemManager;
  489. }
  490. /**
  491. * @private
  492. */
  493. public function set systemManager(value:ISystemManager):void
  494. {
  495. obj.systemManager = value;
  496. }
  497. //----------------------------------
  498. // tweeningProperties
  499. //----------------------------------
  500. /**
  501. * @inheritDoc
  502. *
  503. * @langversion 3.0
  504. * @playerversion Flash 9
  505. * @playerversion AIR 1.1
  506. * @productversion Flex 3
  507. */
  508. public function get tweeningProperties():Array
  509. {
  510. return obj.tweeningProperties;
  511. }
  512. /**
  513. * @private
  514. */
  515. public function set tweeningProperties(value:Array):void
  516. {
  517. obj.tweeningProperties = value;
  518. }
  519. //--------------------------------------------------------------------------
  520. //
  521. // Methods
  522. //
  523. //--------------------------------------------------------------------------
  524. /**
  525. * @inheritDoc
  526. *
  527. * @langversion 3.0
  528. * @playerversion Flash 9
  529. * @playerversion AIR 1.1
  530. * @productversion Flex 3
  531. */
  532. public function initialize():void
  533. {
  534. obj.initialize();
  535. }
  536. /**
  537. * @inheritDoc
  538. *
  539. * @langversion 3.0
  540. * @playerversion Flash 9
  541. * @playerversion AIR 1.1
  542. * @productversion Flex 3
  543. */
  544. public function parentChanged(p:DisplayObjectContainer):void
  545. {
  546. obj.parentChanged(p);
  547. }
  548. /**
  549. * @inheritDoc
  550. *
  551. * @langversion 3.0
  552. * @playerversion Flash 9
  553. * @playerversion AIR 1.1
  554. * @productversion Flex 3
  555. */
  556. public function getExplicitOrMeasuredWidth():Number
  557. {
  558. return obj.getExplicitOrMeasuredWidth() * Math.abs(obj.scaleX);
  559. }
  560. /**
  561. * @inheritDoc
  562. *
  563. * @langversion 3.0
  564. * @playerversion Flash 9
  565. * @playerversion AIR 1.1
  566. * @productversion Flex 3
  567. */
  568. public function getExplicitOrMeasuredHeight():Number
  569. {
  570. return obj.getExplicitOrMeasuredHeight() * Math.abs(obj.scaleY);
  571. }
  572. /**
  573. * @inheritDoc
  574. *
  575. * @langversion 3.0
  576. * @playerversion Flash 9
  577. * @playerversion AIR 1.1
  578. * @productversion Flex 3
  579. */
  580. public function setVisible(value:Boolean, noEvent:Boolean = false):void
  581. {
  582. obj.setVisible(value, noEvent);
  583. }
  584. /**
  585. * @inheritDoc
  586. *
  587. * @langversion 3.0
  588. * @playerversion Flash 9
  589. * @playerversion AIR 1.1
  590. * @productversion Flex 3
  591. */
  592. public function owns(displayObject:DisplayObject):Boolean
  593. {
  594. return obj.owns(displayObject);
  595. }
  596. //--------------------------------------------------------------------------
  597. //
  598. //
  599. // IFlexDisplayObject
  600. //
  601. //
  602. //--------------------------------------------------------------------------
  603. //--------------------------------------------------------------------------
  604. //
  605. // Properties
  606. //
  607. //--------------------------------------------------------------------------
  608. //----------------------------------
  609. // measuredHeight
  610. //----------------------------------
  611. /**
  612. * @inheritDoc
  613. *
  614. * @langversion 3.0
  615. * @playerversion Flash 9
  616. * @playerversion AIR 1.1
  617. * @productversion Flex 3
  618. */
  619. public function get measuredHeight():Number
  620. {
  621. return obj.measuredHeight * Math.abs(obj.scaleY);
  622. }
  623. //----------------------------------
  624. // measuredWidth
  625. //----------------------------------
  626. /**
  627. * @inheritDoc
  628. *
  629. * @langversion 3.0
  630. * @playerversion Flash 9
  631. * @playerversion AIR 1.1
  632. * @productversion Flex 3
  633. */
  634. public function get measuredWidth():Number
  635. {
  636. return obj.measuredWidth * Math.abs(obj.scaleX);
  637. }
  638. //--------------------------------------------------------------------------
  639. //
  640. // Methods
  641. //
  642. //--------------------------------------------------------------------------
  643. /**
  644. * @inheritDoc
  645. *
  646. * @langversion 3.0
  647. * @playerversion Flash 9
  648. * @playerversion AIR 1.1
  649. * @productversion Flex 3
  650. */
  651. public function move(x:Number, y:Number):void
  652. {
  653. obj.move(x, y);
  654. }
  655. /**
  656. * @inheritDoc
  657. *
  658. * @langversion 3.0
  659. * @playerversion Flash 9
  660. * @playerversion AIR 1.1
  661. * @productversion Flex 3
  662. */
  663. public function setActualSize(newWidth:Number, newHeight:Number):void
  664. {
  665. obj.setActualSize(obj.scaleX == 0 ? 0 : newWidth / Math.abs(obj.scaleX),
  666. obj.scaleY == 0 ? 0 : newHeight / Math.abs(obj.scaleY));
  667. }
  668. //--------------------------------------------------------------------------
  669. //
  670. //
  671. // IDisplayObject
  672. //
  673. //
  674. //--------------------------------------------------------------------------
  675. /**
  676. * @inheritDoc
  677. *
  678. * @langversion 3.0
  679. * @playerversion Flash 9
  680. * @playerversion AIR 1.1
  681. * @productversion Flex 3
  682. */
  683. public function get root():DisplayObject { return obj.root; }
  684. /**
  685. * @inheritDoc
  686. *
  687. * @langversion 3.0
  688. * @playerversion Flash 9
  689. * @playerversion AIR 1.1
  690. * @productversion Flex 3
  691. */
  692. public function get stage():Stage { return obj.stage; }
  693. /**
  694. * @inheritDoc
  695. *
  696. * @langversion 3.0
  697. * @playerversion Flash 9
  698. * @playerversion AIR 1.1
  699. * @productversion Flex 3
  700. */
  701. public function get name():String { return obj.name; }
  702. public function set name(value:String):void { obj.name = value; }
  703. /**
  704. * @inheritDoc
  705. *
  706. * @langversion 3.0
  707. * @playerversion Flash 9
  708. * @playerversion AIR 1.1
  709. * @productversion Flex 3
  710. */
  711. public function get parent():DisplayObjectContainer { return obj.parent; }
  712. /**
  713. * @inheritDoc
  714. *
  715. * @langversion 3.0
  716. * @playerversion Flash 9
  717. * @playerversion AIR 1.1
  718. * @productversion Flex 3
  719. */
  720. public function get mask():DisplayObject { return obj.mask; }
  721. public function set mask(value:DisplayObject):void { obj.mask = value; }
  722. /**
  723. * @inheritDoc
  724. *
  725. * @langversion 3.0
  726. * @playerversion Flash 9
  727. * @playerversion AIR 1.1
  728. * @productversion Flex 3
  729. */
  730. public function get visible():Boolean { return obj.visible; }
  731. public function set visible(value:Boolean):void { obj.visible = value; }
  732. /**
  733. * @inheritDoc
  734. *
  735. * @langversion 3.0
  736. * @playerversion Flash 9
  737. * @playerversion AIR 1.1
  738. * @productversion Flex 3
  739. */
  740. public function get x():Number { return obj.x; }
  741. public function set x(value:Number):void { obj.x = value; }
  742. /**
  743. * @inheritDoc
  744. *
  745. * @langversion 3.0
  746. * @playerversion Flash 9
  747. * @playerversion AIR 1.1
  748. * @productversion Flex 3
  749. */
  750. public function get y():Number { return obj.y; }
  751. public function set y(value:Number):void { obj.y = value; }
  752. /**
  753. * @inheritDoc
  754. *
  755. * @langversion 3.0
  756. * @playerversion Flash 9
  757. * @playerversion AIR 1.1
  758. * @productversion Flex 3
  759. */
  760. public function get scaleX():Number { return obj.scaleX; }
  761. public function set scaleX(value:Number):void { obj.scaleX = value; }
  762. /**
  763. * @inheritDoc
  764. *
  765. * @langversion 3.0
  766. * @playerversion Flash 9
  767. * @playerversion AIR 1.1
  768. * @productversion Flex 3
  769. */
  770. public function get scaleY():Number { return obj.scaleY; }
  771. public function set scaleY(value:Number):void { obj.scaleY = value; }
  772. /**
  773. * @inheritDoc
  774. *
  775. * @langversion 3.0
  776. * @playerversion Flash 9
  777. * @playerversion AIR 1.1
  778. * @productversion Flex 3
  779. */
  780. public function get mouseX():Number // note: no setter
  781. {
  782. return obj.mouseX;
  783. }
  784. /**
  785. * @inheritDoc
  786. *
  787. * @langversion 3.0
  788. * @playerversion Flash 9
  789. * @playerversion AIR 1.1
  790. * @productversion Flex 3
  791. */
  792. public function get mouseY():Number // note: no setter
  793. {
  794. return obj.mouseY;
  795. }
  796. /**
  797. * @inheritDoc
  798. *
  799. * @langversion 3.0
  800. * @playerversion Flash 9
  801. * @playerversion AIR 1.1
  802. * @productversion Flex 3
  803. */
  804. public function get rotation():Number
  805. {
  806. return obj.rotation;
  807. }
  808. public function set rotation(value:Number):void
  809. {
  810. obj.rotation = value;
  811. }
  812. /**
  813. * @inheritDoc
  814. *
  815. * @langversion 3.0
  816. * @playerversion Flash 9
  817. * @playerversion AIR 1.1
  818. * @productversion Flex 3
  819. */
  820. public function get alpha():Number
  821. {
  822. return obj.alpha;
  823. }
  824. public function set alpha(value:Number):void
  825. {
  826. obj.alpha = value;
  827. }
  828. /**
  829. * @inheritDoc
  830. *
  831. * @langversion 3.0
  832. * @playerversion Flash 9
  833. * @playerversion AIR 1.1
  834. * @productversion Flex 3
  835. */
  836. public function get width():Number
  837. {
  838. return obj.width * Math.abs(obj.scaleX);
  839. }
  840. public function set width(value:Number):void
  841. {
  842. obj.width = (obj.scaleX == 0) ? 0 : value / Math.abs(obj.scaleX);
  843. }
  844. /**
  845. * @inheritDoc
  846. *
  847. * @langversion 3.0
  848. * @playerversion Flash 9
  849. * @playerversion AIR 1.1
  850. * @productversion Flex 3
  851. */
  852. public function get height():Number
  853. {
  854. return obj.height * Math.abs(obj.scaleY);
  855. }
  856. public function set height(value:Number):void
  857. {
  858. obj.height = (obj.scaleY == 0) ? 0 : value / Math.abs(obj.scaleY);
  859. }
  860. /**
  861. * @inheritDoc
  862. *
  863. * @langversion 3.0
  864. * @playerversion Flash 9
  865. * @playerversion AIR 1.1
  866. * @productversion Flex 3
  867. */
  868. public function get cacheAsBitmap():Boolean
  869. {
  870. return obj.cacheAsBitmap;
  871. }
  872. public function set cacheAsBitmap(value:Boolean):void
  873. {
  874. obj.cacheAsBitmap = value;
  875. }
  876. /**
  877. * @inheritDoc
  878. *
  879. * @langversion 3.0
  880. * @playerversion Flash 9
  881. * @playerversion AIR 1.1
  882. * @productversion Flex 3
  883. */
  884. public function get opaqueBackground():Object
  885. {
  886. return obj.opaqueBackground;
  887. }
  888. public function set opaqueBackground(value:Object):void
  889. {
  890. obj.opaqueBackground = value;
  891. }
  892. /**
  893. * @inheritDoc
  894. *
  895. * @langversion 3.0
  896. * @playerversion Flash 9
  897. * @playerversion AIR 1.1
  898. * @productversion Flex 3
  899. */
  900. public function get scrollRect():Rectangle
  901. {
  902. return obj.scrollRect;
  903. }
  904. public function set scrollRect(value:Rectangle):void
  905. {
  906. obj.scrollRect = value;
  907. }
  908. /**
  909. * @inheritDoc
  910. *
  911. * @langversion 3.0
  912. * @playerversion Flash 9
  913. * @playerversion AIR 1.1
  914. * @productversion Flex 3
  915. */
  916. public function get filters():Array
  917. {
  918. return obj.filters;
  919. }
  920. public function set filters(value:Array):void
  921. {
  922. obj.filters = value;
  923. }
  924. /**
  925. * @inheritDoc
  926. *
  927. * @langversion 3.0
  928. * @playerversion Flash 9
  929. * @playerversion AIR 1.1
  930. * @productversion Flex 3
  931. */
  932. public function get blendMode():String
  933. {
  934. return obj.blendMode;
  935. }
  936. public function set blendMode(value:String):void
  937. {
  938. obj.blendMode = value;
  939. }
  940. /**
  941. * @inheritDoc
  942. *
  943. * @langversion 3.0
  944. * @playerversion Flash 9
  945. * @playerversion AIR 1.1
  946. * @productversion Flex 3
  947. */
  948. public function get transform():Transform
  949. {
  950. return obj.transform;
  951. }
  952. public function set transform(value:Transform):void
  953. {
  954. obj.transform = value;
  955. }
  956. /**
  957. * @inheritDoc
  958. *
  959. * @langversion 3.0
  960. * @playerversion Flash 9
  961. * @playerversion AIR 1.1
  962. * @productversion Flex 3
  963. */
  964. public function get scale9Grid():Rectangle
  965. {
  966. return obj.scale9Grid;
  967. }
  968. public function set scale9Grid(innerRectangle:Rectangle):void
  969. {
  970. obj.scale9Grid = innerRectangle;
  971. }
  972. /**
  973. * @inheritDoc
  974. *
  975. * @langversion 3.0
  976. * @playerversion Flash 9
  977. * @playerversion AIR 1.1
  978. * @productversion Flex 3
  979. */
  980. public function globalToLocal(point:Point):Point
  981. {
  982. return obj.globalToLocal(point);
  983. }
  984. /**
  985. * @inheritDoc
  986. *
  987. * @langversion 3.0
  988. * @playerversion Flash 9
  989. * @playerversion AIR 1.1
  990. * @productversion Flex 3
  991. */
  992. public function localToGlobal(point:Point):Point
  993. {
  994. return obj.localToGlobal(point);
  995. }
  996. /**
  997. * @inheritDoc
  998. *
  999. * @langversion 3.0
  1000. * @playerversion Flash 9
  1001. * @playerversion AIR 1.1
  1002. * @productversion Flex 3
  1003. */
  1004. public function getBounds(targetCoordinateSpace:DisplayObject):Rectangle
  1005. {
  1006. return obj.getBounds(targetCoordinateSpace);
  1007. }
  1008. /**
  1009. * @inheritDoc
  1010. *
  1011. * @langversion 3.0
  1012. * @playerversion Flash 9
  1013. * @playerversion AIR 1.1
  1014. * @productversion Flex 3
  1015. */
  1016. public function getRect(targetCoordinateSpace:DisplayObject):Rectangle
  1017. {
  1018. return obj.getRect(targetCoordinateSpace);
  1019. }
  1020. /**
  1021. * @inheritDoc
  1022. *
  1023. * @langversion 3.0
  1024. * @playerversion Flash 9
  1025. * @playerversion AIR 1.1
  1026. * @productversion Flex 3
  1027. */
  1028. public function get loaderInfo() : LoaderInfo
  1029. {
  1030. return obj.loaderInfo;
  1031. }
  1032. /**
  1033. * @inheritDoc
  1034. *
  1035. * @langversion 3.0
  1036. * @playerversion Flash 9
  1037. * @playerversion AIR 1.1
  1038. * @productversion Flex 3
  1039. */
  1040. public function hitTestObject(obj:DisplayObject):Boolean
  1041. {
  1042. return obj.hitTestObject(obj);
  1043. }
  1044. /**
  1045. * @inheritDoc
  1046. *
  1047. * @langversion 3.0
  1048. * @playerversion Flash 9
  1049. * @playerversion AIR 1.1
  1050. * @productversion Flex 3
  1051. */
  1052. public function hitTestPoint(x:Number, y:Number, shapeFlag:Boolean=false):Boolean
  1053. {
  1054. return hitTestPoint(x, y, shapeFlag);
  1055. }
  1056. /**
  1057. * @inheritDoc
  1058. *
  1059. * @langversion 3.0
  1060. * @playerversion Flash 9
  1061. * @playerversion AIR 1.1
  1062. * @productversion Flex 3
  1063. */
  1064. public function get accessibilityProperties() : AccessibilityProperties
  1065. {
  1066. return obj.accessibilityProperties;
  1067. }
  1068. public function set accessibilityProperties( value : AccessibilityProperties ) : void
  1069. {
  1070. obj.accessibilityProperties = value;
  1071. }
  1072. //--------------------------------------------------------------------------
  1073. //
  1074. //
  1075. // IEventDispatcher
  1076. //
  1077. //
  1078. //--------------------------------------------------------------------------
  1079. public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
  1080. {
  1081. obj.addEventListener(type, listener, useCapture, priority, useWeakReference);
  1082. }
  1083. public function dispatchEvent(event:Event):Boolean
  1084. {
  1085. return obj.dispatchEvent(event);
  1086. }
  1087. public function hasEventListener(type:String):Boolean
  1088. {
  1089. return obj.hasEventListener(type);
  1090. }
  1091. public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
  1092. {
  1093. obj.removeEventListener(type, listener, useCapture);
  1094. }
  1095. public function willTrigger(type:String):Boolean
  1096. {
  1097. return obj.willTrigger(type);
  1098. }
  1099. //--------------------------------------------------------------------------
  1100. //
  1101. //
  1102. // IConstraintClient
  1103. //
  1104. //
  1105. //--------------------------------------------------------------------------
  1106. //--------------------------------------------------------------------------
  1107. //
  1108. // Methods
  1109. //
  1110. //--------------------------------------------------------------------------
  1111. //----------------------------------
  1112. // getConstraintValue
  1113. //----------------------------------
  1114. /**
  1115. * @inheritDoc
  1116. *
  1117. * @langversion 3.0
  1118. * @playerversion Flash 9
  1119. * @playerversion AIR 1.1
  1120. * @productversion Flex 3
  1121. */
  1122. public function getConstraintValue(constraintName:String):*
  1123. {
  1124. if (obj is IConstraintClient)
  1125. return IConstraintClient(obj).getConstraintValue(constraintName);
  1126. return null;
  1127. }
  1128. //----------------------------------
  1129. // setConstraintValue
  1130. //----------------------------------
  1131. /**
  1132. * @inheritDoc
  1133. *
  1134. * @langversion 3.0
  1135. * @playerversion Flash 9
  1136. * @playerversion AIR 1.1
  1137. * @productversion Flex 3
  1138. */
  1139. public function setConstraintValue(constraintName:String, value:*):void
  1140. {
  1141. if (obj is IConstraintClient)
  1142. IConstraintClient(obj).setConstraintValue(constraintName, value);
  1143. else
  1144. throw new Error("PostScaleAdapter can't set constraint value, underlying object is not an IConstraintClient");
  1145. }
  1146. //--------------------------------------------------------------------------
  1147. //
  1148. //
  1149. // IInvalidating
  1150. //
  1151. //
  1152. //--------------------------------------------------------------------------
  1153. //--------------------------------------------------------------------------
  1154. //
  1155. // Methods
  1156. //
  1157. //--------------------------------------------------------------------------
  1158. /**
  1159. * @inheritDoc
  1160. *
  1161. * @langversion 3.0
  1162. * @playerversion Flash 9
  1163. * @playerversion AIR 1.1
  1164. * @productversion Flex 3
  1165. */
  1166. public function invalidateProperties():void
  1167. {
  1168. if (obj is IInvalidating)
  1169. IInvalidating(obj).invalidateProperties();
  1170. }
  1171. /**
  1172. * @inheritDoc
  1173. *
  1174. * @langversion 3.0
  1175. * @playerversion Flash 9
  1176. * @playerversion AIR 1.1
  1177. * @productversion Flex 3
  1178. */
  1179. public function invalidateSize():void
  1180. {
  1181. if (obj is IInvalidating)
  1182. IInvalidating(obj).invalidateSize();
  1183. }
  1184. /**
  1185. * @inheritDoc
  1186. *
  1187. * @langversion 3.0
  1188. * @playerversion Flash 9
  1189. * @playerversion AIR 1.1
  1190. * @productversion Flex 3
  1191. */
  1192. public function invalidateDisplayList():void
  1193. {
  1194. if (obj is IInvalidating)
  1195. IInvalidating(obj).invalidateDisplayList();
  1196. }
  1197. /**
  1198. * @inheritDoc
  1199. *
  1200. * @langversion 3.0
  1201. * @playerversion Flash 9
  1202. * @playerversion AIR 1.1
  1203. * @productversion Flex 3
  1204. */
  1205. public function validateNow():void
  1206. {
  1207. if (obj is IInvalidating)
  1208. IInvalidating(obj).validateNow();
  1209. }
  1210. }
  1211. }