Package org.eclipse.gef.graph
Class Edge.Builder
java.lang.Object
org.eclipse.gef.graph.Edge.Builder
- Enclosing class:
- Edge
The
Edge.Builder can be used to construct an Edge little by
little.-
Constructor Summary
ConstructorsConstructorDescriptionBuilder(Graph.Builder.Context context, Object sourceNodeOrKey, Object targetNodeOrKey) Constructs a new (anonymous)Edge.Builderfor the givenGraph.Builder.Context.Constructs a new (anonymous) context-freeEdge.Builder, which can only be used to construct a single edge viabuildEdge(), i.e. which cannot be chained. -
Method Summary
Modifier and TypeMethodDescriptionPuts the given key-value-pair into theattributesProperty mapof theEdgewhich is constructed by thisEdge.Builder.<T> Edge.Builderattr(BiConsumer<Edge, T> setter, T value) Uses the given setter to set the attribute value.build()Constructs a newGraphfrom the values which have been supplied to the builder chain.Creates a newEdge, setting the values specified via thisEdge.Builder.Constructs a newEdge.Builder.node()Constructs a new (anonymous)Node.Builderfor a node.Constructs a new (identifiable)Node.Builderfor a node.
-
Constructor Details
-
Builder
Constructs a new (anonymous)Edge.Builderfor the givenGraph.Builder.Context.- Parameters:
context- The context in which theEdge.Builderis used.sourceNodeOrKey- The sourceNodeor a key to identify the sourceNode(or itsNode.Builder).targetNodeOrKey- The targetNodeor a key to identify the targetNode(or itsNode.Builder).
-
Builder
Constructs a new (anonymous) context-freeEdge.Builder, which can only be used to construct a single edge viabuildEdge(), i.e. which cannot be chained.
-
-
Method Details
-
attr
Uses the given setter to set the attribute value.- Type Parameters:
T- The attribute type.- Parameters:
setter- The setter to apply.value- The value to apply.- Returns:
thisfor convenience.
-
attr
Puts the given key-value-pair into theattributesProperty mapof theEdgewhich is constructed by thisEdge.Builder.- Parameters:
key- The attribute name which is inserted.value- The attribute value which is inserted.- Returns:
thisfor convenience.
-
build
Constructs a newGraphfrom the values which have been supplied to the builder chain.- Returns:
- A new
Graph.
-
buildEdge
Creates a newEdge, setting the values specified via thisEdge.Builder.- Returns:
- A newly created
Edge.
-
edge
Constructs a newEdge.Builder.- Parameters:
sourceNodeOrKey- The sourceNodeor a key to identify the sourceNode(or itsNode.Builder).targetNodeOrKey- The targetNodeor a key to identify the targetNode(or itsNode.Builder).- Returns:
- A new
Edge.Builder.
-
node
Constructs a new (anonymous)Node.Builderfor a node.- Returns:
- A
Node.Builder.
-
node
Constructs a new (identifiable)Node.Builderfor a node.- Parameters:
key- The key that can be used to identify theNode.Builder- Returns:
- A
Node.Builder.
-