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 Node
s-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Add a new key/value entry to the map and attach theNode
to the group.boolean
addChildren
(Map<K, javafx.scene.Node> children) Add a collection of key/value entries to the map and attach theNode
s to the group.void
addTransform
(javafx.scene.transform.Transform transform) Add a transform to the groupboolean
Returnstrue
if the provided key contains an entry in the mapjavafx.scene.Node
Returns the value associated with the key, ornull
if it doesn't existfinal javafx.scene.Group
getGroup()
Will provide the underlying Group node.boolean
removeChild
(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, ornull
if it doesn't exist- Parameters:
key
- The key to lookup- Returns:
- The value to which the key is mapped, or
null
if 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:
true
if the map contained the key, otherwisefalse
.
-
contains
Returnstrue
if the provided key contains an entry in the map- Parameters:
key
- The key to search for- Returns:
true
if the map contains the provided key, otherwisefalse
-
addChild
Add a new key/value entry to the map and attach theNode
to the group.- Parameters:
key
- The key of the map entrychild
- The javafx value of the map entry- Returns:
true
if the group changed as a result of the addition
-
addChildren
Add a collection of key/value entries to the map and attach theNode
s to the group.- Parameters:
children
- A map of key/value entries to add to the group.- Returns:
true
if the group has changed as a result of the addition
-