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
ConstructorDescriptionBuilder
(Graph.Builder.Context context, Object sourceNodeOrKey, Object targetNodeOrKey) Constructs a new (anonymous)Edge.Builder
for 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 map
of theEdge
which is constructed by thisEdge.Builder
.<T> Edge.Builder
attr
(BiConsumer<Edge, T> setter, T value) Uses the given setter to set the attribute value.build()
Constructs a newGraph
from 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.Builder
for a node.Constructs a new (identifiable)Node.Builder
for a node.
-
Constructor Details
-
Builder
Constructs a new (anonymous)Edge.Builder
for the givenGraph.Builder.Context
.- Parameters:
context
- The context in which theEdge.Builder
is used.sourceNodeOrKey
- The sourceNode
or a key to identify the sourceNode
(or itsNode.Builder
).targetNodeOrKey
- The targetNode
or 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:
this
for convenience.
-
attr
Puts the given key-value-pair into theattributesProperty map
of theEdge
which is constructed by thisEdge.Builder
.- Parameters:
key
- The attribute name which is inserted.value
- The attribute value which is inserted.- Returns:
this
for convenience.
-
build
Constructs a newGraph
from 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 sourceNode
or a key to identify the sourceNode
(or itsNode.Builder
).targetNodeOrKey
- The targetNode
or a key to identify the targetNode
(or itsNode.Builder
).- Returns:
- A new
Edge.Builder
.
-
node
Constructs a new (anonymous)Node.Builder
for a node.- Returns:
- A
Node.Builder
.
-
node
Constructs a new (identifiable)Node.Builder
for a node.- Parameters:
key
- The key that can be used to identify theNode.Builder
- Returns:
- A
Node.Builder
.
-