Class Group

java.lang.Object
nl.colorize.multimedialib.stage.Group
All Implemented Interfaces:
Iterable<StageNode3D>, StageNode, StageNode3D

public class Group extends Object implements StageNode3D, Iterable<StageNode3D>
Stage node that does not provide any graphics, but can instead be used to add additional graphics as children. Modifying the group's transform will propagate to its children.

Groups can optionally have a name. This name is only used for identification, it does not influence the group's appearance or behavior in any way.

Children are limited to 3D graphics, since the stage has a hard separation between 2D and 3D graphics. Use Container for 2D graphics.

  • Constructor Details

    • Group

      public Group(String name)
    • Group

      public Group()
  • Method Details

    • addChild

      public void addChild(StageNode3D child)
    • addChildGroup

      public Group addChildGroup()
      Convenience method that creates a new group, adds it as a child to this group, then returns the created child group.
    • removeChild

      public void removeChild(StageNode3D child)
    • clearChildren

      public void clearChildren()
    • animate

      public void animate(Timer animationTimer)
      Description copied from interface: StageNode
      Called by the renderer at the end of frame updates, while rendering the stage. animationTimer contains the elapsed time since the currently active scene was started. This allows animations to display correctly, without the need to update every single node during each frame update.
      Specified by:
      animate in interface StageNode
    • iterator

      public Iterator<StageNode3D> iterator()
      Specified by:
      iterator in interface Iterable<StageNode3D>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getName

      public String getName()
    • getParent

      public Group getParent()
      Description copied from interface: StageNode
      Returns this node's parent node. Returns null if thos node does not have a parent, or if this is the root node.
      Specified by:
      getParent in interface StageNode
      Specified by:
      getParent in interface StageNode3D
    • getTransform

      public Transform3D getTransform()
      Description copied from interface: StageNode3D
      Returns this node's local transform, which is interpreted relative to its parent node. The local transform can be modified by application code to modify how and where the node is displayed.
      Specified by:
      getTransform in interface StageNode3D
    • getGlobalTransform

      public Transform3D getGlobalTransform()
      Description copied from interface: StageNode3D
      Returns this node's global transform, which is interpreted relative to the stage. The global transform is updated by the renderer when drawing the stage at the end of frame updates. Recalculating the global transform is relatively expensive, and is therefore only done once per frame. This means that any changes made to a node's local transform since the last frame update may not yet been reflected in the current state of its global transform.
      Specified by:
      getGlobalTransform in interface StageNode3D
    • setParent

      protected void setParent(Group parent)
    • getChildren

      protected nl.colorize.util.SubscribableCollection<StageNode3D> getChildren()