com.yworks.yfiles.server.graphml.flexio.data
Interface IPortLocationModel

All Known Implementing Classes:
NodeScaledPortLocationModel

public interface IPortLocationModel

Interface for data objects that model yFiles FLEX port location models.

Port models can be used to describe the location of ports, respecting an IPortLocationModelParameter instance associated with a port.


Method Summary
 IPortLocationModelParameter createParameter(java.lang.Object portOwner, YPoint location)
          Factory method that creates a parameter for the given port that tries to match the provided location in absolute world coordinates.
 Lookup getContext(Port port, IPortLocationModelParameter parameter)
          Provides a lookup context for the given combination of port and parameter.
 YPoint getLocation(Port port, IPortLocationModelParameter modelParameter)
          Calculates the location in world coordinates for a given port using the given model parameter.
 

Method Detail

getLocation

public YPoint getLocation(Port port,
                          IPortLocationModelParameter modelParameter)
Calculates the location in world coordinates for a given port using the given model parameter.

Parameters:
port - The port to calculate the location for
modelParameter - A parameter that has been created by this model. This is typically the parameter that yielded this instance through its IPortModelParameter.getModel() property.
Returns:
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

createParameter

public IPortLocationModelParameter createParameter(java.lang.Object portOwner,
                                                   YPoint location)

Factory method that creates a parameter for the given port that tries to match the provided location in absolute world coordinates.

Parameters:
portOwner - The port owner that will own the port for which the parameter shall be created.
location - The location in the world coordinate system that should be matched as best as possible.
Returns:
A new instance that can be used to describe the location of an IPort at the given IPortOwner.

getContext

public Lookup getContext(Port port,
                         IPortLocationModelParameter parameter)

Provides a lookup context for the given combination of port and parameter.

Parameters:
port - The port to use in the context.
parameter - The parameter to use for the port in the context.
Returns:
An implementation of the Lookup interface that can be used to query additional aspects of the port/parameter combination.


Copyright © 2000-2013 yWorks GmbH. All rights reserved