Packagecom.yworks.canvas.input
Classpublic class CompositeHandle
InheritanceCompositeHandle Inheritance Object

A controller class that makes multiple IHandle implementations appear to be synchronized.

This class wraps given IHandle implementations and synchronizes method calls to them automatically so that if clients drag one of the wrapped handles, all handles will be dragged synchronously.



Public Properties
 PropertyDefined By
  handles : ICollectionModel
[read-only] Returns a live collection of IHandles that wrap the handles added to this instance by addHandles.
CompositeHandle
Public Methods
 MethodDefined By
  
Constructs a new instance of this class.
CompositeHandle
  
addHandles(tag:Object, handleArray:Array):void
Adds the array of handles so that they appear to be synchronized with all other handles previously being added to this instance.
CompositeHandle
  
removeHandles(tag:Object):void
Removes the handles from the handles collection that have been added to this instance previously using addHandles tagged with the same tag.
CompositeHandle
  
wrap(position:uint, handle:IHandle, handleFactoryDelegate:Function = null, factoryDelegateContext:Object = null):IHandle
Wraps a given IHandle implementation so that it appears to be synchronized with all handles that are used for the same position identifier.
CompositeHandle
Property Detail
handlesproperty
handles:ICollectionModel  [read-only]

Returns a live collection of IHandles that wrap the handles added to this instance by addHandles.


Implementation
    public function get handles():ICollectionModel
Constructor Detail
CompositeHandle()Constructor
public function CompositeHandle()

Constructs a new instance of this class.

Using addHandles and removeHandles methods, clients can modify the collection of handles wrapped by this instance. The collection can be obtained usingn the handles property.

Method Detail
addHandles()method
public function addHandles(tag:Object, handleArray:Array):void

Adds the array of handles so that they appear to be synchronized with all other handles previously being added to this instance.

Parameters

tag:Object — The tag to use for removing the handles later on.
 
handleArray:Array — The handles to add to this instance.

See also

removeHandles()method 
public function removeHandles(tag:Object):void

Removes the handles from the handles collection that have been added to this instance previously using addHandles tagged with the same tag.

Parameters

tag:Object — The tag used during the call to addHandles.

See also

wrap()method 
public function wrap(position:uint, handle:IHandle, handleFactoryDelegate:Function = null, factoryDelegateContext:Object = null):IHandle

Wraps a given IHandle implementation so that it appears to be synchronized with all handles that are used for the same position identifier.

The returned wrapped instances should be added to this instance. If the returned instance will be dragged by the user all other handles that have been wrapped by this instance using the same position identifier will be dragged synchronously.

Parameters

position:uint — One of the RectangleHandlePositions the given handle should be synchronized with.
 
handle:IHandle — the handle to wrap.
 
handleFactoryDelegate:Function (default = null) — The factory method that will be called initially and each time a drag is initialized.
 
factoryDelegateContext:Object (default = null) — The context to pass as the parameter of the handleFactoryDelegate.

Returns
IHandle

See also