Packagecom.flextoolbox.controls
Classpublic class WireJack
InheritanceWireJack Inheritance mx.core.UIComponent
Implementsmx.core.IDataRenderer
SubclassesInputWireJack, OutputWireJack

A UI control representing a jack for connecting wires.



Public Properties
 PropertyDefined by
  acceptedDataFormat : String
The dataFormat required for other jacks before they may connect to this jack.
WireJack
  clickToDrag : Boolean = false
[static] If true, dragging a wire from one jack to other will be initiated by a mouse click event on the first jack in addition to the standard drag while the mouse is down.
WireJack
  connectedJacks : Array
[read-only] The other jacks that are currently connected to this jack.
WireJack
  connectionAngle : Number
The angle, in degrees, at which the wire enters or exits the jack.
WireJack
  data : Object
The data associated with this jack.
WireJack
  dataFormat : String
The format of the data associated with this jack.
WireJack
  ignoredJacks : Array
A list of jacks that are always incompatible with this jack.
WireJack
  maxConnections : uint
The maximum number of wires that may be connected to this jack.
WireJack
  wireManager : IWireManager
The IWireManager with which this jack is registered.
WireJack
Public Methods
 MethodDefined by
  
Constructor.
WireJack
  
connectToJack(otherJack:WireJack):Boolean
Creates a connection between this jack and another jack.
WireJack
  
disconnect(otherJack:WireJack):void
Destroys a connection between this jack and another jack.
WireJack
  
Destroys a connection between this jack and any other jacks that are connected to it.
WireJack
  
Determines if this jack is compatible with another jack.
WireJack
  
isConnectedToJack(otherJack:WireJack):Boolean
Checks if this jack is connected to another jack.
WireJack
Events
 EventSummaryDefined by
   Dispatched when a wire will soon connected to the WireJack instance.WireJack
   Dispatched when a wire is connected to the WireJack instance.WireJack
   Dispatched when the value of the data property of the WireJack changes.WireJack
   Dispatched when a connected wire is removed from the WireJack instance.WireJack
Styles
 StyleDescriptionDefined by
  
dragImage
Type: Class
The class used to create the drag image.
WireJack
  
dragImageStyleName
Type: String
If the dragImage supports styleNames, this value is used.
WireJack
  
skin
Type: Class
The class used for the WireJack's skin.
WireJack
Public Constants
 ConstantDefined by
  WIRE_JACK_DRAG_FORMAT : String = "flextoolbox::wireJack"
[static] The dragFormat used by wire jacks for drag and drop operations.
WireJack
Property detail
acceptedDataFormatproperty
acceptedDataFormat:String  [read-write]

The dataFormat required for other jacks before they may connect to this jack.

This property can be used as the source for data binding.

Implementation
    public function get acceptedDataFormat():String
    public function set acceptedDataFormat(value:String):void

See also

clickToDragproperty 
public static var clickToDrag:Boolean = false

If true, dragging a wire from one jack to other will be initiated by a mouse click event on the first jack in addition to the standard drag while the mouse is down.

Note: In previous versions, the dragging could begin only on click if clickToDrag is enabled. For usability reasons, this has been changed to include the default behavior as well.


Example
To initialize this alternate behavior, use the following code:
   WireJack.clickToDrag = true;
   

connectedJacksproperty 
connectedJacks:Array  [read-only]

The other jacks that are currently connected to this jack. Do not manipulate this list to add or remove jacks from the connections. Instead use connectToJack() and disconnect()

Implementation
    public function get connectedJacks():Array

See also

connectionAngleproperty 
connectionAngle:Number  [read-write]

The angle, in degrees, at which the wire enters or exits the jack. Used by the wire renderer.

This property can be used as the source for data binding.

Implementation
    public function get connectionAngle():Number
    public function set connectionAngle(value:Number):void

See also

dataproperty 
data:Object  [read-write]

The data associated with this jack. The related dataFormat property specifies the type of data that the jack may hold, although this isn't enforced.

This property can be used as the source for data binding.

Implementation
    public function get data():Object
    public function set data(value:Object):void

See also

dataFormatproperty 
dataFormat:String  [read-write]

The format of the data associated with this jack. Used in combination with acceptedDataFormat to control which jacks may be connected to other jacks.

This property can be used as the source for data binding.

Implementation
    public function get dataFormat():String
    public function set dataFormat(value:String):void

See also

ignoredJacksproperty 
ignoredJacks:Array  [read-write]

A list of jacks that are always incompatible with this jack.

This property can be used as the source for data binding.

Implementation
    public function get ignoredJacks():Array
    public function set ignoredJacks(value:Array):void
maxConnectionsproperty 
maxConnections:uint  [read-write]

The maximum number of wires that may be connected to this jack.

This property can be used as the source for data binding.

Implementation
    public function get maxConnections():uint
    public function set maxConnections(value:uint):void
wireManagerproperty 
wireManager:IWireManager  [read-write]

The IWireManager with which this jack is registered.

This property can be used as the source for data binding.

Implementation
    public function get wireManager():IWireManager
    public function set wireManager(value:IWireManager):void
Constructor detail
WireJack()constructor
public function WireJack()

Constructor.

Method detail
connectToJack()method
public function connectToJack(otherJack:WireJack):Boolean

Creates a connection between this jack and another jack.

Parameters
otherJack:WireJack — The other jack with which to create a connection

Returns
Booleantrue if the connection is successful, and false if the connection is not successful. A connection may be unsuccessful for any number of reasons. However, the most likely reason for an unsuccessful connection is that the two jacks don't have compatible data formats.
disconnect()method 
public function disconnect(otherJack:WireJack):void

Destroys a connection between this jack and another jack.

Parameters
otherJack:WireJack — The other jack with which to destroy a connection
disconnectAll()method 
public function disconnectAll():void

Destroys a connection between this jack and any other jacks that are connected to it.

isCompatibleWithJack()method 
public function isCompatibleWithJack(jack:WireJack):Boolean

Determines if this jack is compatible with another jack. By default, the following conditions must be met:

Parameters
jack:WireJack — other jack used to check compatibility.

Returns
Boolean
isConnectedToJack()method 
public function isConnectedToJack(otherJack:WireJack):Boolean

Checks if this jack is connected to another jack.

Parameters
otherJack:WireJack — The jack to check.

Returns
Boolean
Event detail
connectingWireevent 
Event object type: com.flextoolbox.events.WireJackEvent

Dispatched when a wire will soon connected to the WireJack instance. If this event is cancelled, the wire will not be connected.

connectWireevent  
Event object type: com.flextoolbox.events.WireJackEvent

Dispatched when a wire is connected to the WireJack instance.

dataChangeevent  
Event object type: mx.events.FlexEvent

Dispatched when the value of the data property of the WireJack changes.

disconnectWireevent  
Event object type: com.flextoolbox.events.WireJackEvent

Dispatched when a connected wire is removed from the WireJack instance.

Constant detail
WIRE_JACK_DRAG_FORMATconstant
public static const WIRE_JACK_DRAG_FORMAT:String = "flextoolbox::wireJack"

The dragFormat used by wire jacks for drag and drop operations.