PARENT - Type of parent that the listeners will be notified about.public interface PoshElementListener<PARENT extends PoshElement> extends PropertyChangeListener
PoshElement to listen for various events that happens to the POSH
element (new node, deleted node...)
Thanks to generics, listeners can have type check for parent, but not for
child because of multiple possible types of children (e.g. DC has two types
of children, Sense and DriveElement, PoshPlan has ActionPattern
and Competence).| Modifier and Type | Method and Description |
|---|---|
void |
childElementAdded(PARENT parent,
PoshElement child)
Event handler will be notified that parent has added a new child among
its children.
|
void |
childElementMoved(PARENT parent,
PoshElement child,
int oldIndex,
int newIndex)
Evenet handler will be notified that parent has moved a child.
|
void |
childElementRemoved(PARENT parent,
PoshElement child,
int removedChildPosition)
Event handler will be notified when parent has removed child.
|
propertyChangevoid childElementAdded(PARENT parent, PoshElement child)
parent - parent that has a new childchild - Child that has been added.void childElementMoved(PARENT parent, PoshElement child, int oldIndex, int newIndex)
parent - Parent element of child.child - child that has been moved.oldIndex - Index of the child before move.newIndex - Absolute position of the moved child with its own
type. E.g. DriveCollection has two types of children, Senses
and DriveElement. First sense has absolute index 0 and first
drive has absolute index 0.void childElementRemoved(PARENT parent, PoshElement child, int removedChildPosition)
parent - parent element of childchild - child element that has been removedremovedChildPosition - What was position of removed child among
childrenCopyright © 2018 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.