Used by CreateEdgeInputMode to determine the direction in which edges get created.
Type Details
- yFiles module
- view
Constants
A policy where edges will be created in the direction depending on whether the creation started at a source or target IPortCandidate.
Examples
With this policy CreateEdgeInputMode queries both getAllSourcePortCandidates and getAllTargetPortCandidates for a port candidate to start edge creation from. If the chosen candidate has been returned by the latter method the edge will be created in reversed order.
This requires a custom IPortCandidateProvider which implements both getAllSourcePortCandidates and getAllTargetPortCandidates to return candidates to start edge creation at the source port and at the target port, respectively.
public class TagSensitivePortCandidateProvider : IPortCandidateProvider
{
private readonly IPortOwner owner;
public TagSensitivePortCandidateProvider(IPortOwner owner) {
this.owner = owner;
}
public IEnumerable<IPortCandidate> GetSourcePortCandidates(IInputModeContext context) {
return from port in owner.Ports where "Source".Equals(port.Tag) select new DefaultPortCandidate(port);
}
public IEnumerable<IPortCandidate> GetTargetPortCandidates(IInputModeContext context) {
return from port in owner.Ports where "Target".Equals(port.Tag) select new DefaultPortCandidate(port);
}
...
}
A policy where edges can only be created from target to source port in reverse direction.
Static Methods
Converts the given argument to an enum constant of this enum type.
Remarks
Parameters
A map of options to pass to the method.
- value - EdgeDirectionPolicy
- The value to convert to an enum constant.
Returns
- ↪EdgeDirectionPolicy
- The enum constant that corresponds to the given argument.
Returns the name of the given enum constant.
Parameters
A map of options to pass to the method.
- value - EdgeDirectionPolicy
- The numeric value of an enum constant.
Returns
- ↪string
- The name of the enum constant.
Throws
- Exception({ name: 'Error' })
- If this type is a flags enums, and the provided value doesn't correspond to a single enum constant, or if this enum type contains no constant of the given numeric value.