|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.sposh.elements.PoshElement<T,PARENT>
public abstract class PoshElement<T extends PoshElement,PARENT extends PoshElement>
Base class for each element of Yaposh plan. It can register listeners on changes of this element and has link to parent element.
| Constructor Summary | |
|---|---|
PoshElement()
|
|
| Method Summary | |
|---|---|
boolean |
addElementListener(PoshElementListener<T> listener)
Add new listener for events of this node. |
protected void |
emitChildDeleted(PoshElement child,
int removedChildPosition)
Tell all listeners that a child of this element has been deleted. |
protected void |
emitChildMove(PoshElement childNode,
int oldIndex,
int newIndex)
Notify all listeners (associated Widgets) that one child of this node has changed order(position). |
protected void |
emitChildNode(PoshElement emitedChild)
Notify all listeners (mostly associated Widgets) that this dataNode has a new child. |
protected void |
firePropertyChange(String name,
Object o,
Object n)
Notify all listeners about change of a property. |
abstract List<? extends PoshElement> |
getChildDataNodes()
Get list of children of this node. |
int |
getChildId(PoshElement child)
Get index of a @child. |
List<? extends PoshElement> |
getChildren(LapType selectType)
Get all children of this element that have @selectType. |
abstract DataFlavor |
getDataFlavor()
Get data flavour of posh plan element,used during DnD from palette to PoshScene. |
Set<PoshElementListener<T>> |
getElementListeners()
Get list of listeners that listen for changes of this node (new child, node deletion, childMoved and change of properties) |
int |
getId()
Get Id of this element. |
PARENT |
getParent()
Get parent of the node. |
PoshPlan |
getRootNode()
Get root node of POSH plan this node belongs to. |
abstract LapType |
getType()
Get type of the element. |
protected boolean |
isChildOfParent()
Is this element present as a a child in its parent? If element has no parent, return false. |
abstract boolean |
moveChild(int newIndex,
PoshElement child)
Move child to the @newIndex. |
boolean |
removeElementListener(PoshElementListener<T> listener)
Remove listener from list of listeners of this node. |
protected void |
setParent(PARENT parent)
Set parent PoshElement of the node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PoshElement()
| Method Detail |
|---|
public final Set<PoshElementListener<T>> getElementListeners()
public final boolean addElementListener(PoshElementListener<T> listener)
listener - listener to add
public final boolean removeElementListener(PoshElementListener<T> listener)
listener - listener to remove
protected final void firePropertyChange(String name,
Object o,
Object n)
name - name of propertyo - old value, can be null, but reciever has to be able to handle itn - new value, can be null, but reciever has to be able to handle itpublic abstract DataFlavor getDataFlavor()
public abstract LapType getType()
public abstract List<? extends PoshElement> getChildDataNodes()
protected final void emitChildNode(PoshElement emitedChild)
childNode -
protected final void emitChildMove(PoshElement childNode,
int oldIndex,
int newIndex)
childNode -
protected final void emitChildDeleted(PoshElement child,
int removedChildPosition)
protected void setParent(PARENT parent)
PoshElement of the node.
parent - public PARENT getParent()
public final PoshPlan getRootNode()
public abstract boolean moveChild(int newIndex,
PoshElement child)
protected final boolean isChildOfParent()
public final List<? extends PoshElement> getChildren(LapType selectType)
selectType - Type of children we are looking for.
getType() == @selectType.public final int getChildId(PoshElement child)
public final int getId()
NullPointerException - if parent is null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||