public abstract class PoshElement<T extends PoshElement,PARENT extends PoshElement> extends Object
Add new node:
Delete node: Result: PoshElement DN will be deleted along with all associated PoshWidgets
| Constructor and Description |
|---|
PoshElement() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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 |
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.
|
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. |
public final Set<PoshElementListener<T>> getElementListeners()
public final boolean addElementListener(PoshElementListener<T> listener)
listener - listener to addpublic final boolean removeElementListener(PoshElementListener<T> listener)
listener - listener to removeprotected 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
countedpublic abstract DataFlavor getDataFlavor()
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()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.