|
||||||||||
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>
Ancestor of representative of one element in Posh plan. Listens for various modifications in POSH tree structure. Listener is connected on one particular PoshElement, so many events are neighbours and so on. Various uses, manily during construction of new tree from file. BASIC LEMMA IS: Reality DataNode, Representation PoshWidget (Model, view, controller)
Add new node:
Delete node: Result: PoshElement DN will be deleted along with all associated PoshWidgets
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 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) |
abstract List<? extends PoshElement> |
getChildDataNodes()
Get list of children of this node. |
int |
getNumberOfChildInstances(Class searchedClass)
Get number of children of this node that have same class as parameter. |
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? |
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 int getNumberOfChildInstances(Class searchedClass)
searchedClass
- what kind of class should the child be if it is
counted
public 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |