Package dk.gtz.graphedit.util
Class MapGroup<K>
java.lang.Object
dk.gtz.graphedit.util.MapGroup<K>
- Type Parameters:
K- The key type
A keyed
Group of javafx Nodes-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd a new key/value entry to the map and attach theNodeto the group.booleanaddChildren(Map<K, javafx.scene.Node> children) Add a collection of key/value entries to the map and attach theNodes to the group.voidaddTransform(javafx.scene.transform.Transform transform) Add a transform to the groupbooleanReturnstrueif the provided key contains an entry in the mapjavafx.scene.NodeReturns the value associated with the key, ornullif it doesn't existfinal javafx.scene.GroupgetGroup()Will provide the underlying Group node.booleanremoveChild(K key) Removes the map entry associated with the provided key
-
Constructor Details
-
MapGroup
public MapGroup()Create a new instance
-
-
Method Details
-
getGroup
public final javafx.scene.Group getGroup()Will provide the underlying Group node. Modifying the underlying node's children list is at your own risk- Returns:
- the managed Group
-
addTransform
public void addTransform(javafx.scene.transform.Transform transform) Add a transform to the group- Parameters:
transform- the transform to add
-
getChild
Returns the value associated with the key, ornullif it doesn't exist- Parameters:
key- The key to lookup- Returns:
- The value to which the key is mapped, or
nullif it doesn't exist
-
removeChild
Removes the map entry associated with the provided key- Parameters:
key- The key of the value to remove from the map- Returns:
trueif the map contained the key, otherwisefalse.
-
contains
Returnstrueif the provided key contains an entry in the map- Parameters:
key- The key to search for- Returns:
trueif the map contains the provided key, otherwisefalse
-
addChild
Add a new key/value entry to the map and attach theNodeto the group.- Parameters:
key- The key of the map entrychild- The javafx value of the map entry- Returns:
trueif the group changed as a result of the addition
-
addChildren
Add a collection of key/value entries to the map and attach theNodes to the group.- Parameters:
children- A map of key/value entries to add to the group.- Returns:
trueif the group has changed as a result of the addition
-