Package org.eclipse.gef.graph
Class Node.Builder
java.lang.Object
org.eclipse.gef.graph.Node.Builder
- Enclosing class:
- Node
The 
Node.Builder can be used to construct a Node little by
 little.- 
Constructor SummaryConstructorsConstructorDescriptionBuilder()Constructs a new (anonymous) context-freeNode.Builder, which can only be used to construct a single node viabuildNode(), i.e. which cannot be chained.Builder(Graph.Builder.Context context) Constructs a new (anonymous)Node.Builderfor the givenGraph.Builder.Context.Builder(Graph.Builder.Context context, Object key) Constructs a new identifiableNode.Builderfor the givenGraph.Builder.Context.
- 
Method SummaryModifier and TypeMethodDescriptionPuts the given key-value-pair into theattributesProperty mapof theNodewhich is constructed by thisNode.Builder.<T> Node.Builderattr(BiConsumer<Node, 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 newNode, setting the values specified via thisNode.Builder.Constructs a newEdge.Builder.protected ObjectgetKey()Returns the key that can be used to identify thisNode.Buildernode()Constructs a new (anonymous)Node.Builder.Constructs a new (identifiable)Node.Builder.
- 
Constructor Details- 
Builderpublic Builder()Constructs a new (anonymous) context-freeNode.Builder, which can only be used to construct a single node viabuildNode(), i.e. which cannot be chained.
- 
BuilderConstructs a new (anonymous)Node.Builderfor the givenGraph.Builder.Context.- Parameters:
- context- The context in which the- Node.Builderis used.
 
- 
BuilderConstructs a new identifiableNode.Builderfor the givenGraph.Builder.Context.- Parameters:
- context- The context in which the- Node.Builderis used.
- key- The key to identify the builder.
 
 
- 
- 
Method Details- 
attrUses the given setter to set the attribute value.- Type Parameters:
- T- The type of the attribute.
- Parameters:
- setter- The setter to apply.
- value- The value to apply.
- Returns:
- thisfor convenience.
 
- 
attrPuts the given key-value-pair into theattributesProperty mapof theNodewhich is constructed by thisNode.Builder.- Parameters:
- key- The attribute name which is inserted.
- value- The attribute value which is inserted.
- Returns:
- thisfor convenience.
 
- 
buildConstructs a newGraphfrom the values which have been supplied to the builder chain.- Returns:
- A new Graph.
 
- 
buildNodeCreates a newNode, setting the values specified via thisNode.Builder.- Returns:
- A newly created Node.
 
- 
edgeConstructs a newEdge.Builder.- Parameters:
- sourceNodeOrKey- The source- Nodeor a key to identify the source- Node(or its- Node.Builder).
- targetNodeOrKey- The target- Nodeor a key to identify the target- Node(or its- Node.Builder).
- Returns:
- A new Edge.Builder.
 
- 
getKeyReturns the key that can be used to identify thisNode.Builder- Returns:
- The key that can be used for identification.
 
- 
nodeConstructs a new (anonymous)Node.Builder.- Returns:
- A new Node.Builder.
 
- 
nodeConstructs a new (identifiable)Node.Builder.- Parameters:
- key- The key that can be used to identify the- Node.Builder
- Returns:
- A new Node.Builder.
 
 
-