Packagecom.yworks.graph.model
Classpublic class DefaultBendCreator
InheritanceDefaultBendCreator Inheritance Object
Implements IBendCreator

Simple default implementations of the IBendCreator interface used during the creation of bends in the UI.

An instance of this class can be found in the ILookup.lookup of an edge.



Public Properties
 PropertyDefined By
  NO_BENDS : IBendCreator
[static] [read-only] A static instance that does not create any bends.
DefaultBendCreator
Public Methods
 MethodDefined By
  
Initializes a new instance of the DefaultBendCreator class for the given edge.
DefaultBendCreator
  
createBend(context:IInputModeContext, graph:IGraph, edge:IEdge, x:Number, y:Number):int
Creates a bend at the given graph for the given edge at the position supplied.
DefaultBendCreator
Property Detail
NO_BENDSproperty
NO_BENDS:IBendCreator  [read-only]

A static instance that does not create any bends.


Implementation
    public static function get NO_BENDS():IBendCreator
Constructor Detail
DefaultBendCreator()Constructor
public function DefaultBendCreator(edge:IEdge)

Initializes a new instance of the DefaultBendCreator class for the given edge.

Parameters
edge:IEdge — The edge.
Method Detail
createBend()method
public function createBend(context:IInputModeContext, graph:IGraph, edge:IEdge, x:Number, y:Number):int

Creates a bend at the given graph for the given edge at the position supplied.

Parameters

context:IInputModeContext — The context for which the bend should be created.
 
graph:IGraph — The graph, the edge belongs to.
 
edge:IEdge — The edge.
 
x:Number — The preferred x coordinate of the bend.
 
y:Number — The preferred y coordinate of the bend.

Returns
int — The index of the bend in the edges' IBendList or -1 if no bend has been created.