Search this API

y.view
Interface PortLocationModel

All Known Implementing Classes:
NodeScaledPortLocationModel

public interface PortLocationModel

Determines the position of NodePort instances. Port location models can be used to describe the location of ports, respecting their associated PortLocationModelParameter. Typically, a port location model is used as a factory for port location model parameters that can be associated with different port instances, e.g. using the NodePort.setModelParameter(PortLocationModelParameter) method. Port location model instances are designed to be shared by multiple model parameters, which themselves can be shared by multiple port instances.

 

Method Summary
 PortLocationModelParameter createParameter(NodeRealizer owner, YPoint location)
          Creates a parameter for a port at the given node realizer that tries to match the specified location in absolute world coordinates.
 YPoint getLocation(NodePort port, PortLocationModelParameter parameter)
          Determines the location of the port for the given parameter.
 

Method Detail

getLocation

YPoint getLocation(NodePort port,
                   PortLocationModelParameter parameter)
Determines the location of the port for the given parameter.

Parameters:
port - The port to determine the location for.
parameter - The parameter to use.
Returns:
the calculated location of the port.

createParameter

PortLocationModelParameter createParameter(NodeRealizer owner,
                                           YPoint location)
Creates a parameter for a port at the given node realizer that tries to match the specified location in absolute world coordinates.

Parameters:
owner - The realizer that will own the port for which the parameter has to be created.
location - The location in the world coordinate system that should be matched as best as possible.
Returns:
a parameter instance that can be used to describe the location of a NodePort at the given NodeRealizer.

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.