Package | com.yworks.graph.model |
Class | public class DefaultPortCandidate |
Inheritance | DefaultPortCandidate Object |
Implements | IPortCandidate |
IPortCandidate
.
Subclasses need to override createInstance
if they don't set a port instance.
Property | Defined By | ||
---|---|---|---|
candidateTag : Object
Gets or set the tag of this candidate. | DefaultPortCandidate | ||
locationModelParameter : IPortLocationModelParameter
Gets or sets the model parameter that will be used for the port if this candidate is chosen. | DefaultPortCandidate | ||
model : IPortLocationModel
The model that will be used by this instance to determine the new locationModelParameter if
getPortCandidateAt is called and the validity is set to
PortCandidateValidity.DYNAMIC. | DefaultPortCandidate | ||
owner : IPortOwner
Gets or sets the owner of the port to be created. | DefaultPortCandidate | ||
style : IPortStyle
Gets or tsets the style to use for the newly created port. | DefaultPortCandidate | ||
validity : PortCandidateValidity
Determines whether this candidate is valid depending on the context it has
been obtained from. | DefaultPortCandidate |
Method | Defined By | ||
---|---|---|---|
DefaultPortCandidate(owner:IPortOwner, locationModelParameter:IPortLocationModelParameter = null, useExistingPort:Boolean = true)
Creates a new instance. | DefaultPortCandidate | ||
[static]
Creates a candidate using the given port as the template. | DefaultPortCandidate | ||
[static]
Creates a dynamic candidate for the given owner using the specified model. | DefaultPortCandidate | ||
This implementation will throw an IllegalOperationError if the validity is
PortCandidateValidity.DYNAMIC. | DefaultPortCandidate | ||
Returns the instance provided to the constructor or to the setter. | DefaultPortCandidate | ||
Returns a candidate that is derived from this instance that best fits the provided location. | DefaultPortCandidate | ||
setInstance(port:IPort):void
Sets the instance that will be returned by getInstance and createInstance. | DefaultPortCandidate |
Method | Defined By | ||
---|---|---|---|
createInstanceCore(context:IInputModeContext, graph:IGraph, parameter:IPortLocationModelParameter, style:IPortStyle):IPort
Actually create the IPort instance. | DefaultPortCandidate |
candidateTag | property |
candidateTag:Object
Gets or set the tag of this candidate.
The interpretation of this value is implementation dependent and may be used for visual feedback or interactive behavior.
The default value is null
.
public function get candidateTag():Object
public function set candidateTag(value:Object):void
locationModelParameter | property |
locationModelParameter:IPortLocationModelParameter
Gets or sets the model parameter that will be used for the port if this candidate is chosen.
public function get locationModelParameter():IPortLocationModelParameter
public function set locationModelParameter(value:IPortLocationModelParameter):void
model | property |
model:IPortLocationModel
The model that will be used by this instance to determine the new locationModelParameter
if
getPortCandidateAt
is called and the validity
is set to
PortCandidateValidity.DYNAMIC
.
public function get model():IPortLocationModel
public function set model(value:IPortLocationModel):void
See also
owner | property |
owner:IPortOwner
Gets or sets the owner of the port to be created.
public function get owner():IPortOwner
public function set owner(value:IPortOwner):void
style | property |
style:IPortStyle
Gets or tsets the style to use for the newly created port.
If this property is null
, the current default in the graph will be used.
public function get style():IPortStyle
public function set style(value:IPortStyle):void
validity | property |
validity:PortCandidateValidity
Determines whether this candidate is valid depending on the context it has been obtained from.
The default value is PortCandidateValidity#VALID
.
public function get validity():PortCandidateValidity
public function set validity(value:PortCandidateValidity):void
DefaultPortCandidate | () | Constructor |
public function DefaultPortCandidate(owner:IPortOwner, locationModelParameter:IPortLocationModelParameter = null, useExistingPort:Boolean = true)
Creates a new instance.
Parametersowner:IPortOwner — The port owner.
| |
locationModelParameter:IPortLocationModelParameter (default = null ) — the port location model parameter. If null , the location model
parameter of the first port of the owner is used.
| |
useExistingPort:Boolean (default = true ) — If true and no locationModelParameter is passed,
the first port of the owner is set as instance and it's locationModelParameter is used.
|
See also
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.
|
DefaultPortCandidate |
createDynamic | () | method |
public static function createDynamic(owner:IPortOwner, model:IPortLocationModel):DefaultPortCandidate
Creates a dynamic candidate for the given owner
using the specified model
.
Parameters
owner:IPortOwner — The port owner.
| |
model:IPortLocationModel — The port location model used in getPortCandidateAt to create parameters.
|
DefaultPortCandidate |
See also
createInstance | () | method |
public function createInstance(context:IInputModeContext):IPort
This implementation will throw an IllegalOperationError
if the validity is
PortCandidateValidity.DYNAMIC
.
This implementation will delegate to the
Parameters
context:IInputModeContext |
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.
|
createInstanceCore | () | method |
protected function createInstanceCore(context:IInputModeContext, graph:IGraph, parameter:IPortLocationModelParameter, style:IPortStyle):IPort
Actually create the IPort
instance.
This method is called in response to a call to createInstance
on this instance and the
instances created by getPortCandidateAt
.
Parameters
context:IInputModeContext — The input mode context.
| |
graph:IGraph — The graph to add the port to.
| |
parameter:IPortLocationModelParameter — The parameter to use.
| |
style:IPortStyle — The style to use.
|
IPort — The newly created port.
|
See also
getInstance | () | method |
public function getInstance():IPort
Returns the instance provided to the constructor or to the setter.
ReturnsIPort — The instance to use or null otherwise.
|
See also
getPortCandidateAt | () | method |
public function getPortCandidateAt(context:IInputModeContext, location:IPoint):IPortCandidate
Returns a candidate that is derived from this instance that best fits the provided location
.
The returned implementation will finally call createInstance
using the newly created
locationModelParameter
.
Parameters
context:IInputModeContext — The input mode context for which a concrete candidate is queried.
| |
location:IPoint — The location for which a candidate should be returned.
|
IPortCandidate — An IPortCandidate implementation whose validity is guaranteed to be
non-PortCandidateValidity.DYNAMIC .
|
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 .
|