public final class BendAnchoredPortLocationModel extends Object implements IPortLocationModel
IPortLocationModel
that can create IPortLocationModelParameter
s that describe
the location of ports that are attached to the bends of IEdge
s.Modifier and Type | Field and Description |
---|---|
static IPortLocationModelParameter |
FIRST_BEND
A convenience instance of a parameter that is bound to the first
IBend of the edge. |
static BendAnchoredPortLocationModel |
INSTANCE
A static immutable global instance of this class.
|
static IPortLocationModelParameter |
LAST_BEND
A convenience instance of a parameter that is bound to the last
IBend of the edge. |
Constructor and Description |
---|
BendAnchoredPortLocationModel() |
Modifier and Type | Method and Description |
---|---|
IPortLocationModelParameter |
createFromSource(int bendIndex)
Creates a parameter that indicates the location of the bend with index
bendIndex starting from the source side. |
IPortLocationModelParameter |
createFromTarget(int bendIndex)
Creates a parameter that indicates the location of the bend with index
bendIndex starting from the target side. |
IPortLocationModelParameter |
createParameter(IPortOwner owner,
PointD location)
Factory method that creates a parameter for the given port that tries to match the provided location in absolute world
coordinates.
|
ILookup |
getContext(IPort port,
IPortLocationModelParameter locationParameter)
Provides a
lookup context for the given combination of port and parameter. |
PointD |
getLocation(IPort port,
IPortLocationModelParameter locationParameter)
Determines the location of the port for the given parameter.
|
<TLookup> TLookup |
lookup(Class<TLookup> type)
This implementation has nothing in its lookup and will always yield .
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, safeLookup
public static final IPortLocationModelParameter FIRST_BEND
IBend
of the edge.createFromSource(int)
public static final BendAnchoredPortLocationModel INSTANCE
public static final IPortLocationModelParameter LAST_BEND
IBend
of the edge.createFromTarget(int)
public final IPortLocationModelParameter createFromSource(int bendIndex)
bendIndex
starting from the source side.bendIndex
- The index of the bend counting from the source side.public final IPortLocationModelParameter createFromTarget(int bendIndex)
bendIndex
starting from the target side.bendIndex
- The index of the bend counting from the target side.public final IPortLocationModelParameter createParameter(IPortOwner owner, PointD location)
IPortLocationModel
createParameter
in interface IPortLocationModel
owner
- 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.IPort
at the given owner
.public final ILookup getContext(IPort port, IPortLocationModelParameter locationParameter)
IPortLocationModel
lookup context
for the given combination of port and parameter.getContext
in interface IPortLocationModel
port
- The port to use in the context.locationParameter
- The parameter to use for the port in the context.ILookup
interface that can be used to query additional aspects of the port/parameter
combination.public final PointD getLocation(IPort port, IPortLocationModelParameter locationParameter)
IPortLocationModel
getLocation
in interface IPortLocationModel
port
- The port to determine the location for.locationParameter
- The parameter to use. The parameter can be expected to be created by this instance having the Model
property set to this instance..public final <TLookup> TLookup lookup(Class<TLookup> type)
null