Class MapGroup<K>

java.lang.Object
dk.gtz.graphedit.util.MapGroup<K>
Type Parameters:
K - The key type

public class MapGroup<K> extends Object
A keyed Group of javafx Nodes
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new instance
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addChild(K key, javafx.scene.Node child)
    Add a new key/value entry to the map and attach the Node to the group.
    boolean
    addChildren(Map<K,javafx.scene.Node> children)
    Add a collection of key/value entries to the map and attach the Nodes to the group.
    void
    addTransform(javafx.scene.transform.Transform transform)
    Add a transform to the group
    boolean
    contains(K key)
    Returns true if the provided key contains an entry in the map
    javafx.scene.Node
    getChild(K key)
    Returns the value associated with the key, or null if it doesn't exist
    final javafx.scene.Group
    Will provide the underlying Group node.
    boolean
    Removes the map entry associated with the provided key

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public javafx.scene.Node getChild(K key)
      Returns the value associated with the key, or null 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

      public boolean removeChild(K key)
      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, otherwise false.
    • contains

      public boolean contains(K key)
      Returns true 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, otherwise false
    • addChild

      public boolean addChild(K key, javafx.scene.Node child)
      Add a new key/value entry to the map and attach the Node to the group.
      Parameters:
      key - The key of the map entry
      child - The javafx value of the map entry
      Returns:
      true if the group changed as a result of the addition
    • addChildren

      public boolean addChildren(Map<K,javafx.scene.Node> children)
      Add a collection of key/value entries to the map and attach the Nodes 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