Packagecom.yworks.graph.model
Interfacepublic interface IPortCandidate
ImplementorsAbstractPortCandidateProvider, CompositePortCandidateProvider, DefaultPortCandidate, EmptyPortsCandidateProvider

An interface for possible IPort candidates used by IPortCandidateProvider and the like.



Public Properties
 PropertyDefined by
  location : IPoint
[read-only] Returns the absolute location of the port in the world coordinate system for this candidate.
IPortCandidate
  owner : IPortOwner
[read-only] Returns the possible owner of the port to be created for this candidate.
IPortCandidate
  type : uint
[read-only] Returns the type of this candidate.
IPortCandidate
  valid : Boolean
[read-only] Whether this instance is a valid port candidate.
IPortCandidate
Public Methods
 MethodDefined by
  
If the client decides to use this port candidate, this method will serve as a factory to create the instance.
IPortCandidate
  
Returns the instance that is already live in the graph if this candidate wraps an exisiting port or null otherwise.
IPortCandidate
Property detail
locationproperty
location:IPoint  [read-only]

Returns the absolute location of the port in the world coordinate system for this candidate.

Implementation
    public function get location():IPoint
ownerproperty 
owner:IPortOwner  [read-only]

Returns the possible owner of the port to be created for this candidate.

Implementation
    public function get owner():IPortOwner
typeproperty 
type:uint  [read-only]

Returns 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

See also

validproperty 
valid:Boolean  [read-only]

Whether this instance is a valid port candidate.

Implementations of IPortCandidateProvider may return sets of port candidates where some of them are marked as invalid e.g. in order to give visual feedback.

Implementation
    public function get valid():Boolean
Method detail
createInstance()method
public function createInstance():IPort

If the client decides to use this port candidate, this method will serve as a factory to create the instance.

If this candidate wraps an existing port, it may return that instance.

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 that is already live in the graph if this candidate wraps an exisiting port or null otherwise.

Returns
IPort — The instance to use or null otherwise.

See also