cz.cuni.amis.pogamut.sposh.elements
Interface PoshElementListener<PARENT extends PoshElement>

Package class diagram package PoshElementListener
Type Parameters:
PARENT - Type of parent that the listeners will be notified about.
All Superinterfaces:
EventListener, PropertyChangeListener
All Known Implementing Classes:
LapChain

public interface PoshElementListener<PARENT extends PoshElement>
extends PropertyChangeListener

Mainly for widgets. This is the listener that can be registered with the 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).

Author:
HonzaH

Method Summary
 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.
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Method Detail

childElementAdded

void childElementAdded(PARENT parent,
                       PoshElement child)
Event handler will be notified that parent has added a new child among its children.

Parameters:
parent - parent that has a new child
child - Child that has been added.

childElementMoved

void childElementMoved(PARENT parent,
                       PoshElement child,
                       int oldIndex,
                       int newIndex)
Evenet handler will be notified that parent has moved a child.

Parameters:
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.

childElementRemoved

void childElementRemoved(PARENT parent,
                         PoshElement child,
                         int removedChildPosition)
Event handler will be notified when parent has removed child.

Parameters:
parent - parent element of child
child - child element that has been removed
removedChildPosition - What was position of removed child among children


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.