Package | com.yworks.graph.model.portLocation |
Interface | public interface IPortLocationModel extends ILookup |
Implementors | NodeScaledPortLocationModel |
IPort
instances.
Port models can be used to describe the location of ports, respecting
an IPortLocationModelParameter
instance associated with a port.
Typically, a port model is used as a factory for port location model parameters that
can be associated with different port instances, e.g. using the
IGraph.setPortLocationModelParameter
method.
Port location model instances are designed to be shared for multiple model parameters,
which themselves can be shared for multiple port instances.
This interface supports the
ILookup.lookup
method that can be used to query additional aspects of the implementation.
Method | Defined By | ||
---|---|---|---|
Factory method that creates a parameter for the given port that tries to match the provided location
in absolute world coordinates.
| IPortLocationModel | ||
Provides a lookup context for the given combination of port and parameter.
| IPortLocationModel | ||
Calculates the location in form of an IPoint
for a given port using the given model parameter. | IPortLocationModel | ||
lookup(type:Class):Object
Returns an instance that implements the given type or null. | ILookup |
createParameter | () | method |
public function createParameter(portOwner:IPortOwner, location:IPoint = null):IPortLocationModelParameter
Factory method that creates a parameter for the given port that tries to match the provided location in absolute world coordinates.
Parameters
portOwner:IPortOwner — The port owner that will own the port for which the parameter shall be created.
| |
location:IPoint (default = null ) — The location in the world coordinate system that should be matched as best as possible.
|
IPortLocationModelParameter — A new instance that can be used to describe the location of an IPort at the given
IPortOwner .
|
getContext | () | method |
public function getContext(port:IPort, parameter:IPortLocationModelParameter):ILookup
Provides a lookup context for the given combination of port and parameter.
Parameters
port:IPort — The port to use in the context.
| |
parameter:IPortLocationModelParameter — The parameter to use for the port in the context.
|
ILookup — An implementation of the ILookup interface that can be used to query additional aspects
of the port/parameter combination.
|
getLocation | () | method |
public function getLocation(port:IPort, modelParameter:IPortLocationModelParameter):IPoint
Calculates the location in form of an IPoint
for a given port using the given model parameter.
Parameters
port:IPort — The port to calculate the location for
| |
modelParameter:IPortLocationModelParameter — A parameter that has been created by this model.
This is typically the parameter that yielded this instance through its
IPortModelParameter.model property.
|
IPoint — An instance that describes the location. This is typically
an instance designed as a flyweight, so clients should not cache the
instance but store the values if they need a snapshot for later use
|