PageRenderTime 5ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/tweego/src/org/goasap/interfaces/IManageable.as

http://tweego.googlecode.com/
ActionScript | 4 lines | 2 code | 0 blank | 2 comment | 0 complexity | a4b94134c93acb950ec2a671b2279252 MD5 | raw file
  1/**
  2 * Copyright (c) 2007 Moses Gunesch
  3 * 
  4 * Permission is hereby granted, free of charge, to any person obtaining a copy
  5 * of this software and associated documentation files (the "Software"), to deal
  6 * in the Software without restriction, including without limitation the rights
  7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8 * copies of the Software, and to permit persons to whom the Software is
  9 * furnished to do so, subject to the following conditions:
 10 * 
 11 * The above copyright notice and this permission notice shall be included in
 12 * all copies or substantial portions of the Software.
 13 * 
 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 20 * THE SOFTWARE.
 21 */
 22package org.goasap.interfaces {
 23	
 24	/**
 25	 * Makes udpatable items usable by IManager instances.
 26	 * 
 27	 * <p>The Go system decouples manager classes so they remain compile-
 28	 * optional for the end user, who must explicitly register an instance 
 29	 * of each desired manager for use with GoEngine. <i>To uphold this system
 30	 * it is extremely important that item classes do not import or make 
 31	 * direct reference to specific manager classes. If you need to make a
 32	 * reference to a manager from any item class, datatype to manager interfaces
 33	 * like IManager, not manager classes like OverlapMonitor.</i></p>
 34	 * 
 35	 * @see IManager
 36	 * 
 37	 * @author Moses Gunesch
 38	 */
 39	public interface IManageable extends IUpdatable
 40	{
 41		/**
 42		 * IManageable requirement.
 43		 * 
 44		 * @return	All animation targets currently being handled.
 45		 */
 46		function getActiveTargets () : Array;
 47		
 48		
 49		/**
 50		 * IManageable requirement. 
 51		 * 
 52		 * <p>This list is often passed to the <code>isHandling</code> method of other active 
 53		 * IManageable items. <i>DO NOT return all properties the item handles in general, 
 54		 * only ones the instance is currently tweening or setting.</i> The list can include 
 55		 * any custom property names the item defines.</p>
 56		 * 
 57		 * @return All property-strings currently being handled.
 58		 */
 59		function getActiveProperties () : Array;
 60		
 61		
 62		/**
 63		 * IManageable requirement: 
 64		 * 
 65		 * Return true if any of the property strings passed in overlap with any 
 66		 * properties being actively handled.
 67		 * 
 68		 * <p><b>Direct matching:</b></p>
 69		 * 
 70		 * <p>First and foremost, test for a direct match with al properties the item
 71		 * is currently handling on all targets. For example, if the item is actively 
 72		 * setting a 'width' property on any of its animation targets:
 73		 * <br><br>
 74		 * <code>if (properties.indexOf("width")>-1) return true;</code></p>
 75		 * 
 76		 * <p><b>Indirect matching:</b></p>
 77		 * 
 78		 * <p>You must be sure to check for indirect, as well as direct  matches. 
 79		 * This is very important and can at times require some creative thought 
 80		 * on your part. Try to keep isHandling code effiecient to reduce processing
 81		 * and filesize across batches of items.</p>
 82		 * 
 83		 * <ol>
 84		 * <li><i>Overlap,</i> like 'width' and 'scaleX'. These would certainly conflict if 
 85		 * two different Go items were allowed to handle them at once on the same target. 
 86		 * Overlaps might not always be this obvious, so think creatively.<br><br></li>
 87		 * 
 88		 * <li><i>Multi-property groups.</i> If the item is setting multiple properties at 
 89		 * once for a single result, such as a bezier-curve tween that operates on both x 
 90		 * and y, and may also define a custom property like 'bezier', be sure to return 
 91		 * true if any of those properties are passed in.<br><br></li>
 92		 * 
 93		 * <li><i>Multi-property groups with overlap,</i> in which both of the above occurs. 
 94		 * Consider a class with custom 'scale' and 'size' properties that tween <i>scaleX/scaleY</i> 
 95		 * and <i>width/height</i>. Overlap occurs between entire groups of properties: 
 96		 * <i>scaleX/width/scale/size</i> and <i>scaleY/height/scale/size</i>. You must check 
 97		 * whether each property passed in conflicts with this item's active properties using 
 98		 * those groupings to check for any indirect match.</li>
 99		 * </ol>
100		 * 
101		 * @param properties	A list of properties to test for active overlap.
102		 * @return				Whether any active overlap occurred with any property passed in.
103		 */
104		function isHandling (properties : Array) : Boolean;
105		
106		
107		/**
108		 * IManageable requirement: Normally this method should stop the instance.
109		 * 
110		 * @param params	Gives more complex managers leeway to send additional information
111		 * 					like specific targets or properties to release, etc.
112		 */
113		function releaseHandling (...params) : void;
114		
115	}
116}