public interface ICanvasObjectGroup extends ICanvasObject, IListEnumerable<ICanvasObject>
CanvasControl
.
It is meant to group multiple ICanvasObject
instances as a logic unit. The interface is not meant to be
implemented by application programmers. Instances implementing this interface can be retrieved from the factory methods
in the canvas control. The interface extends the IListEnumerable
interface to allow for easy iteration and
determination of the size of the group.
EMPTY
Modifier and Type | Method and Description |
---|---|
ICanvasObject |
addChild(Object userObject,
ICanvasObjectDescriptor descriptor)
Adds a child element to the scene graph as a child of this group.
|
ICanvasObjectGroup |
addGroup()
Adds a new
ICanvasObjectGroup to this group in the current scene graph. |
ICanvasObject |
getFirst()
Returns the first item in the rendering list of this group or
null . |
ICanvasObject |
getLast()
Returns the last item in the rendering list of this group or
null . |
above, below, getDescriptor, getGroup, getNext, getPrevious, getUserObject, isDirty, isVisible, lower, raise, remove, setDescriptor, setDirty, setGroup, setUserObject, setVisible, toBack, toFront
concat, create, create, first, getItem, last, size
concat, concat, enumerator, iterator, parallelStream, stream
forEach, spliterator
ICanvasObject addChild(Object userObject, ICanvasObjectDescriptor descriptor)
The descriptor will be queried for the various rendering related implementations for the given userObject
at
rendering time.
userObject
- The user object to associate with this child element. This object will be passed to the descriptor
's methods.descriptor
- An implementation of the ICanvasObjectDescriptor
interface that will be passed the userObject
to provide
the various implementations that are used during rendering.remove
the element
from the scene graph, again.ICanvasObjectDescriptor
,
ICanvasObjectDescriptor.DYNAMIC_DIRTY_INSTANCE
ICanvasObjectGroup addGroup()
ICanvasObjectGroup
to this group in the current scene graph.
This can be used to build groups of ICanvasObject
instances that can be moved within the scene graph or whose visibility
can be controlled easily. The group will have a null
UserObject
.
remove
the group from the scene graph, again.ICanvasObject getFirst()
null
.
This is the item that will be rendered first, i.e. behind all of the other items in the rendering list. In order to iterate over all immediate children, use the following idiom:
IListEnumerable
,
CollectionExtensions.getEnumerator(java.lang.Iterable)
ICanvasObject getLast()
null
.
This is the item that will be on top of all other items in the list. In order to iterate over all immediate children in reverse order, use the following idiom: