Missile behavior


Name spacerialto.widgetBehavior
FILEmulti-files in rialtoEngine\javascript\core\coreBehaviors\DD_behavior.js
NAMEMissile/Target behavior
INHERITSdraganddrop
VERSION0.86
update
DESCRIPTIONIt is rather the description of the affectation of the missile and target behavior (relative to several files) than the description of an independent component

The missile behavior is a specific drag and drop Behavior. In Fact the missile can only be drop in specific element on which you attach the target Behavior.


Details of setup properties for the MISSILE


NameTypeDescriptionDefault
domainstringpath to define authorized targets (ex. Tree.node)
domainUnauthorizedTargetstringpath to define unauthorized targets (ex. Tree.node.leaf)
targetChoicestringchoice between good targets strategy. If no value the target above (descendant of, or covered ) is the better. If 'firstIsBetter', the first target finded is the good (faster)

Details of setup properties for the TARGET


NameTypeDescriptionDefault
domainstringpath to define authorized Missile
missileAsOnePixelbooleanif true the drop missile is seen as a one pixel object whatever its real sizetrue
borderIsTargetbooleanif true the border of the target is reactivetrue

Example:
        	Missile:
        		
        	var o = document.getElementById('objectToMove');
			var setup={bMUpAction : false,
			bRectLim 	: false,	   							 
			 ghost		: {bIcone : true, aspect: 'icon'},
		   	 domainTargets:'tree.node'
		   	 ,targetChoice : 'firstIsBetter'
			});			
			rialto.widgetBehavior.affect(o,'Missile',setup);			
			
			Target:
        		
        	var o = document.getElementById('objectToMove');
			var setup={missileAsOnePixel:true,domain:'tree.node'};
			rialto.widgetBehavior.affect(o,'Target',setup);
		

CALLBACK METHODS FOR THE MISSILE

Cf drag an drop callback method

CALLBACK METHODS FOR THE TARGET


MethodArguments listReturn valueInheritsTo redefine
DDHoverobject oHtmlvoidnoyes
DDOuterobject oHtmlvoidnoyes
receiveAfterDropobject missilevoidnoyes

DDHover

this method is raise when a missile drag, move over the target
Parameters:
object oHtml:object with 3 properties 'oHtml','top','left' representing object drop,top and left in Target

The code must be redefine after . By default this method does nothing.

If this function is not redefine the default behavior is to surround the target in green (if the drop can be done) or red (no drop)

DDOuter

this method is raise when a missile drag, move out from the target
Parameters:
object oHtml:object with 3 properties 'oHtml','top','left' representing object drop,top and left in viewPort

The code must be redefine after . By default this method does nothing.

If this function is not redefine the default behavior is to remove the target decoration create on over.

receiveAfterDrop

Raise when a missile is drop in the target
Parameters:
object missile:object with 4 properties 'oHtml','top','left','doamin' representing object drop,top and left in Target and domain of the missile drop

The code must be redefine after . By default this method does nothing.

If this function is not redefine the default behavior is to drop the missile in the target