E

EdgeDirectionPolicy

Used by CreateEdgeInputMode to determine the direction in which edges get created.

Members

No filters for this type

Constants

A policy where edges will be created in the direction depending on whether the creation started at a source or target IPortCandidate.
static

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 will be created in the same direction as last time.
The default policy where edges can only be created from source to target 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.
Most notably, this method can convert an enum constant's name into the enum constant itself.
static

Parameters

value: EdgeDirectionPolicy
The value to convert to an enum constant.

Return Value

EdgeDirectionPolicy
The enum constant that corresponds to the given argument.
Returns the name of the given enum constant.
static

Parameters

value: EdgeDirectionPolicy
The numeric value of an enum constant.

Return Value

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.