PageRenderTime 106ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/FD3/FlashDevelop/Bin/Debug/Library/AS3/frameworks/FlashIDE/fl/controls/ProgressBar.as

https://bitbucket.org/kkszysiu/flashdevelop
ActionScript | 239 lines | 70 code | 4 blank | 165 comment | 0 complexity | c8ec4c08dca0aa8b7deefd17c78b67c0 MD5 | raw file
  1. package fl.controls
  2. {
  3. import fl.controls.progressBarClasses.IndeterminateBar;
  4. import fl.controls.ProgressBarDirection;
  5. import fl.controls.ProgressBarMode;
  6. import fl.core.InvalidationType;
  7. import fl.core.UIComponent;
  8. import flash.display.DisplayObject;
  9. import flash.display.Sprite;
  10. import flash.events.Event;
  11. import flash.events.EventDispatcher;
  12. import flash.events.ProgressEvent;
  13. /**
  14. * Dispatched when the load operation completes. * * @eventType flash.events.Event.COMPLETE * * @includeExample examples/ProgressBar.complete.1.as -noswf * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  15. */
  16. [Event("complete", type="flash.events.Event")]
  17. /**
  18. * Dispatched as content loads in event mode or polled mode. * * @eventType flash.events.ProgressEvent.PROGRESS * * @includeExample examples/ProgressBar.complete.1.as -noswf * * @see ProgressBarMode#EVENT ProgressBarMode.EVENT * @see ProgressBarMode#POLLED ProgressBarMode.POLLED * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  19. */
  20. [Event("progress", type="flash.events.ProgressEvent")]
  21. /**
  22. * Name of the class to use as the default icon. Setting any other icon * style overrides this setting. * * @default null * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  23. */
  24. [Style(name="icon", type="Class")]
  25. /**
  26. * Name of the class to use as the progress indicator track. * * @default ProgressBar_trackSkin * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  27. */
  28. [Style(name="trackSkin", type="Class")]
  29. /**
  30. * Name of the class to use as the determinate progress bar. * * @default ProgressBar_barSkin * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  31. */
  32. [Style(name="barSkin", type="Class")]
  33. /**
  34. * Name of the class to use as the indeterminate progress bar. This is passed to the * indeterminate bar renderer, which is specified by the <code>indeterminateBar</code> * style. * * @default ProgressBar_indeterminateSkin * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  35. */
  36. [Style(name="indeterminateSkin", type="Class")]
  37. /**
  38. * The class to use as a renderer for the indeterminate bar animation. * This is an advanced style. * * @default fl.controls.progressBarClasses.IndeterminateBar * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  39. */
  40. [Style(name="indeterminateBar", type="Class")]
  41. /**
  42. * The padding that separates the progress bar indicator from the track, in pixels. * * @default 0 * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  43. */
  44. [Style(name="barPadding", type="Number", format="Length")]
  45. /**
  46. * The ProgressBar component displays the progress of content that is * being loaded. The ProgressBar is typically used to display the status of * images, as well as portions of applications, while they are loading. * The loading process can be determinate or indeterminate. A determinate * progress bar is a linear representation of the progress of a task over * time and is used when the amount of content to load is known. An indeterminate * progress bar has a striped fill and a loading source of unknown size. * * @includeExample examples/ProgressBarExample.as * * @see ProgressBarDirection * @see ProgressBarMode * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  47. */
  48. public class ProgressBar extends UIComponent
  49. {
  50. /**
  51. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  52. */
  53. protected var track : DisplayObject;
  54. /**
  55. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  56. */
  57. protected var determinateBar : DisplayObject;
  58. /**
  59. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  60. */
  61. protected var indeterminateBar : UIComponent;
  62. /**
  63. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  64. */
  65. protected var _direction : String;
  66. /**
  67. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  68. */
  69. protected var _indeterminate : Boolean;
  70. /**
  71. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  72. */
  73. protected var _mode : String;
  74. /**
  75. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  76. */
  77. protected var _minimum : Number;
  78. /**
  79. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  80. */
  81. protected var _maximum : Number;
  82. /**
  83. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  84. */
  85. protected var _value : Number;
  86. /**
  87. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  88. */
  89. protected var _source : Object;
  90. /**
  91. * @private (protected)
  92. */
  93. protected var _loaded : Number;
  94. /**
  95. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  96. */
  97. private static var defaultStyles : Object;
  98. /**
  99. * Indicates the fill direction for the progress bar. A value of * <code>ProgressBarDirection.RIGHT</code> indicates that the progress * bar is filled from left to right. A value of <code>ProgressBarDirection.LEFT</code> * indicates that the progress bar is filled from right to left. * * @default ProgressBarDirection.RIGHT * * @includeExample examples/ProgressBar.direction.1.as -noswf * * @see ProgressBarDirection * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  100. */
  101. public function get direction () : String;
  102. /**
  103. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  104. */
  105. public function set direction (value:String) : void;
  106. /**
  107. * Gets or sets a value that indicates the type of fill that the progress * bar uses and whether the loading source is known or unknown. A value of * <code>true</code> indicates that the progress bar has a striped fill * and a loading source of unknown size. A value of <code>false</code> * indicates that the progress bar has a solid fill and a loading source * of known size. * * <p>This property can only be set when the progress bar mode * is set to <code>ProgressBarMode.MANUAL</code>.</p> * * @default true * * @see #mode * @see ProgressBarMode * @see fl.controls.progressBarClasses.IndeterminateBar IndeterminateBar * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  108. */
  109. public function get indeterminate () : Boolean;
  110. /**
  111. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  112. */
  113. public function set indeterminate (value:Boolean) : void;
  114. /**
  115. * Gets or sets the minimum value for the progress bar when the * <code>ProgressBar.mode</code> property is set to <code>ProgressBarMode.MANUAL</code>. * * @default 0 * * @see #maximum * @see #percentComplete * @see #value * @see ProgressBarMode#MANUAL * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  116. */
  117. public function get minimum () : Number;
  118. /**
  119. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  120. */
  121. public function set minimum (value:Number) : void;
  122. /**
  123. * Gets or sets the maximum value for the progress bar when the * <code>ProgressBar.mode</code> property is set to <code>ProgressBarMode.MANUAL</code>. * * @default 0 * * @see #minimum * @see #percentComplete * @see #value * @see ProgressBarMode#MANUAL * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  124. */
  125. public function get maximum () : Number;
  126. /**
  127. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  128. */
  129. public function set maximum (value:Number) : void;
  130. /**
  131. * Gets or sets a value that indicates the amount of progress that has * been made in the load operation. This value is a number between the * <code>minimum</code> and <code>maximum</code> values. * * @default 0 * * @see #maximum * @see #minimum * @see #percentComplete * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  132. */
  133. public function get value () : Number;
  134. /**
  135. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  136. */
  137. public function set value (value:Number) : void;
  138. /**
  139. * @private (internal)
  140. */
  141. public function set sourceName (name:String) : void;
  142. /**
  143. * Gets or sets a reference to the content that is being loaded and for * which the ProgressBar is measuring the progress of the load operation. * A typical usage of this property is to set it to a UILoader component. * * <p>Use this property only in event mode and polled mode.</p> * * @default null * * @includeExample examples/ProgressBar.source.1.as -noswf * @includeExample examples/ProgressBar.source.2.as -noswf * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  144. */
  145. public function get source () : Object;
  146. /**
  147. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  148. */
  149. public function set source (value:Object) : void;
  150. /**
  151. * Gets a number between 0 and 100 that indicates the percentage * of the content has already loaded. * * <p>To change the percentage value, use the <code>setProgress()</code> method.</p> * * @default 0 * * @includeExample examples/ProgressBar.percentComplete.1.as -noswf * @includeExample examples/ProgressBar.percentComplete.2.as -noswf * * @see #maximum * @see #minimum * @see #setProgress() * @see #value * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  152. */
  153. public function get percentComplete () : Number;
  154. /**
  155. * Gets or sets the method to be used to update the progress bar. * * <p>The following values are valid for this property:</p> * <ul> * <li><code>ProgressBarMode.EVENT</code></li> * <li><code>ProgressBarMode.POLLED</code></li> * <li><code>ProgressBarMode.MANUAL</code></li> * </ul> * * <p>Event mode and polled mode are the most common modes. In event mode, * the <code>source</code> property specifies loading content that generates * <code>progress</code> and <code>complete</code> events; you should use * a UILoader object in this mode. In polled mode, the <code>source</code> * property specifies loading content, such as a custom class, that exposes * <code>bytesLoaded</code> and <code>bytesTotal</code> properties. Any object * that exposes these properties can be used as a source in polled mode.</p> * * <p>You can also use the ProgressBar component in manual mode by manually * setting the <code>maximum</code> and <code>minimum</code> properties and * making calls to the <code>ProgressBar.setProgress()</code> method.</p> * * @default ProgressBarMode.EVENT * * @see ProgressBarMode * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  156. */
  157. public function get mode () : String;
  158. /**
  159. * @private (setter) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  160. */
  161. public function set mode (value:String) : void;
  162. /**
  163. * @copy fl.core.UIComponent#getStyleDefinition() * * @includeExample ../core/examples/UIComponent.getStyleDefinition.1.as -noswf * * @see fl.core.UIComponent#getStyle() * @see fl.core.UIComponent#setStyle() * @see fl.managers.StyleManager * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  164. */
  165. public static function getStyleDefinition () : Object;
  166. /**
  167. * Creates a new ProgressBar component instance. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  168. */
  169. public function ProgressBar ();
  170. /**
  171. * Sets the state of the bar to reflect the amount of progress made when * using manual mode. The <code>value</code> argument is assigned to the * <code>value</code> property and the <code>maximum</code> argument is * assigned to the <code>maximum</code> property. The <code>minimum</code> * property is not altered. * * @param value A value describing the progress that has been made. * * @param maximum The maximum progress value of the progress bar. * * @see #maximum * @see #value * @see ProgressBarMode#MANUAL ProgressBarMode.manual * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  172. */
  173. public function setProgress (value:Number, maximum:Number) : void;
  174. /**
  175. * Resets the progress bar for a new load operation. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  176. */
  177. public function reset () : void;
  178. /**
  179. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  180. */
  181. protected function _setProgress (value:Number, maximum:Number, fireEvent:Boolean = false) : void;
  182. /**
  183. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  184. */
  185. protected function setIndeterminate (value:Boolean) : void;
  186. /**
  187. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  188. */
  189. protected function resetProgress () : void;
  190. /**
  191. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  192. */
  193. protected function setupSourceEvents () : void;
  194. /**
  195. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  196. */
  197. protected function cleanupSourceEvents () : void;
  198. /**
  199. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  200. */
  201. protected function pollSource (event:Event) : void;
  202. /**
  203. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  204. */
  205. protected function handleProgress (event:ProgressEvent) : void;
  206. /**
  207. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  208. */
  209. protected function handleComplete (event:Event) : void;
  210. /**
  211. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  212. */
  213. protected function draw () : void;
  214. /**
  215. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  216. */
  217. protected function drawTrack () : void;
  218. /**
  219. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  220. */
  221. protected function drawBars () : void;
  222. /**
  223. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  224. */
  225. protected function drawDeterminateBar () : void;
  226. /**
  227. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  228. */
  229. protected function drawLayout () : void;
  230. /**
  231. * @private (protected) * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  232. */
  233. protected function configUI () : void;
  234. }
  235. }