Packagecom.yworks.graph.model
Classpublic class DefaultPortCandidate
ImplementsIPortCandidate

A simple default implementation of an IPortCandidate.

Subclasses need to override createInstance if they don't set a port instance or don't want client code to create the port for them.



Public Properties
 PropertyDefined by
  location : IPoint
Gets or set the absolute location in the world coordinate system that shall be used for the port.
DefaultPortCandidate
  owner : IPortOwner
Gets or sets the owner of the port to be created.
DefaultPortCandidate
  type : uint
Gets or set the type of this candidate.
DefaultPortCandidate
  valid : Boolean
Determines whether this candidate is valid depending on the context it has been obtained from.
DefaultPortCandidate
Public Methods
 MethodDefined by
  
DefaultPortCandidate(owner:IPortOwner, location:IPoint = null)
Creates a new instance.
DefaultPortCandidate
  
[static] Creates a candidate using the given port as the template.
DefaultPortCandidate
  
Returns the instance provided to the constructor or to the setter
DefaultPortCandidate
  
Returns the instance provided to the constructor or to the setter.
DefaultPortCandidate
  
setInstance(port:IPort):void
Sets the instance that will be returned by getInstance and createInstance.
DefaultPortCandidate
Property detail
locationproperty
location:IPoint  [read-write]

Gets or set the absolute location in the world coordinate system that shall be used for the port.

Implementation
    public function get location():IPoint
    public function set location(value:IPoint):void
ownerproperty 
owner:IPortOwner  [read-write]

Gets or sets the owner of the port to be created.

Implementation
    public function get owner():IPortOwner
    public function set owner(value:IPortOwner):void
typeproperty 
type:uint  [read-write]

Gets or set the type of this candidate.

The interpretation of this value is implementation dependent and may be used for visual feedback or interactive behavior.

Implementation
    public function get type():uint
    public function set type(value:uint):void
validproperty 
valid:Boolean  [read-write]

Determines whether this candidate is valid depending on the context it has been obtained from.

Implementation
    public function get valid():Boolean
    public function set valid(value:Boolean):void
Constructor detail
DefaultPortCandidate()constructor
public function DefaultPortCandidate(owner:IPortOwner, location:IPoint = null)

Creates a new instance.

Parameters
owner:IPortOwner — The port owner.
 
location:IPoint (default = null) — the location. If null, the first port of the owner is used.

See also

Method detail
create()method
public static function create(port:IPort):DefaultPortCandidate

Creates a candidate using the given port as the template.

Parameters
port:IPort — The port to use as template.

Returns
DefaultPortCandidate
createInstance()method 
public function createInstance():IPort

Returns the instance provided to the constructor or to the setter

Returns
IPort — The port instance to use if this candidate has been chosen. This method may return null to indicate that the client should create an appropriate port itself.
getInstance()method 
public function getInstance():IPort

Returns the instance provided to the constructor or to the setter.

Returns
IPort — The instance to use or null otherwise.

See also

setInstance()method 
public function setInstance(port:IPort):void

Sets the instance that will be returned by getInstance and createInstance.

Parameters
port:IPort — A port that already exists in the graph or null.