Index: trunk/src/lib/coord/null_parent.cc
===================================================================
--- trunk/src/lib/coord/null_parent.cc	(revision 5081)
+++ trunk/src/lib/coord/null_parent.cc	(revision 5082)
@@ -22,5 +22,5 @@
 using namespace std;
 
-NullParent* NullParent::singletonRef = 0;
+NullParent* NullParent::singletonRef = NULL;
 
 /**
Index: trunk/src/lib/coord/p_node.cc
===================================================================
--- trunk/src/lib/coord/p_node.cc	(revision 5081)
+++ trunk/src/lib/coord/p_node.cc	(revision 5082)
@@ -209,4 +209,6 @@
    absCoordinates. If you don't use this, the PNode won't recognize, that something
    has changed and won't update the children Nodes.
+
+@todo check if this does what it should
 */
 void PNode::setAbsCoor (const Vector& absCoord)
Index: trunk/src/lib/graphics/render2D/element_2d.cc
===================================================================
--- trunk/src/lib/graphics/render2D/element_2d.cc	(revision 5081)
+++ trunk/src/lib/graphics/render2D/element_2d.cc	(revision 5082)
@@ -24,4 +24,5 @@
 #include "tinyxml.h"
 #include "class_list.h"
+#include "list.h"
 
 using namespace std;
@@ -59,4 +60,8 @@
   this->setAlignment(E2D_ALIGN_NONE);
   this->layer = E2D_TOP;
+  this->setParentMode2D(E2D_PARENT_ALL);
+
+  this->bRelCoorChanged = true;
+  this->bRelDirChanged = true;
 
   Render2D::getInstance()->registerElement2D(this);
@@ -180,4 +185,6 @@
 void Element2D::setRelCoor2D (const Vector& relCoord)
 {
+  this->relCoordinate = relCoord;
+  this->bRelCoorChanged = true;
 }
 
@@ -185,24 +192,52 @@
 void Element2D::setRelCoor2D (float x, float y, float z)
 {
+  this->setAbsCoor2D(Vector(x,y,z));
 }
 
 void Element2D::setRelCoorSoft2D(const Vector& relCoordSoft, float bias)
 {
-}
-
-void Element2D::setRelCoorSoft2D(float x, float y, float dontCare, float bias)
-{
+  if (likely(this->toCoordinate == NULL))
+    this->toCoordinate = new Vector();
+
+  *this->toCoordinate = relCoordSoft;
+  this->bias = bias;
+}
+
+void Element2D::setRelCoorSoft2D(float x, float y, float depth, float bias)
+{
+  this->setRelCoorSoft2D(Vector(x, y, depth), bias);
 }
 
 void Element2D::setAbsCoor2D (const Vector& absCoord)
 {
+  if( likely(this->parentMode & E2D_PARENT_MOVEMENT))
+  {
+    /* if you have set the absolute coordinates this overrides all other changes */
+    if (likely(this->parent != NULL))
+      this->relCoordinate = absCoord - parent->getAbsCoor2D ();
+    else
+      this->relCoordinate = absCoord;
+  }
+  if( this->parentMode & E2D_PARENT_ROTATE_MOVEMENT)
+  {
+    if (likely(this->parent != NULL))
+      this->relCoordinate = absCoord - parent->getAbsCoor2D ();
+    else
+      this->relCoordinate = absCoord;
+  }
+
+  this->bRelCoorChanged = true;
 }
 
 void Element2D::setAbsCoor2D (float x, float y, float depth)
 {
+  this->setAbsCoor2D(Vector(x, y, depth));
 }
 
 void Element2D::shiftCoor (const Vector& shift)
 {
+  this->relCoordinate += shift;
+  this->bRelCoorChanged = true;
+
 }
 
@@ -210,16 +245,31 @@
 void Element2D::setRelDir2D (float relDir)
 {
+  this->relDirection = relDir;
+  this->bRelDirChanged = true;
 }
 
 void Element2D::setRelDirSoft2D(float relDirSoft, float bias)
 {
+  if (likely(this->toDirection == NULL))
+    this->toDirection = new float;
+
+  *this->toDirection = relDirSoft;
+  this->bias = bias;
 }
 
 void Element2D::setAbsDir2D (float absDir)
 {
+  if (likely(this->parent != NULL))
+    this->relDirection = absDir - this->parent->getAbsDir2D();
+  else
+    this->relDirection = absDir;
+
+  this->bRelDirChanged = true;
 }
 
 void Element2D::shiftDir (float shiftDir)
 {
+  this->relDirection = this->relDirection + shiftDir;
+  this->bRelDirChanged = true;
 }
 
@@ -227,16 +277,41 @@
 void Element2D::addChild2D (Element2D* child, int parentingMod)
 {
+  if( likely(child->parent != NULL))
+  {
+    PRINTF(4)("PNode::addChild() - reparenting node: removing it and adding it again\n");
+    child->parent->children->remove(child);
+  }
+  child->parentMode = parentMode;
+  child->parent = this;
+  this->children->add(child);
+  child->parentCoorChanged();
 }
 
 void Element2D::addChild2D (const char* childName)
 {
+  Element2D* childNode = dynamic_cast<Element2D*>(ClassList::getObject(childName, CL_ELEMENT_2D));
+  if (childNode != NULL)
+    this->addChild2D(childNode);
 }
 
 void Element2D::removeChild2D (Element2D* child)
 {
+  child->remove2D();
+  this->children->remove(child);
+  child->parent = NULL;
 }
 
 void Element2D::remove2D()
 {
+  tIterator<Element2D>* iterator = this->children->getIterator();
+  Element2D* pn = iterator->nextElement();
+
+  while( pn != NULL)
+  {
+    NullElement2D::getInstance()->addChild2D(pn, pn->getParentMode2D());
+    pn = iterator->nextElement();
+  }
+  delete iterator;
+  this->parent->children->remove(this);
 }
 
@@ -244,17 +319,52 @@
 void Element2D::setParent2D (Element2D* parent)
 {
+  parent->addChild2D(this);
 }
 
 void Element2D::setParent2D (const char* parentName)
 {
-}
-
-
-void Element2D::softReparent(PNode* parentNode, float bias)
-{
-}
-
-void Element2D::softReparent(const char* parentName, float bias)
-{
+  Element2D* parentNode = dynamic_cast<Element2D*>(ClassList::getObject(parentName, CL_ELEMENT_2D));
+  if (parentNode != NULL)
+    parentNode->addChild2D(this);
+
+}
+
+
+void Element2D::softReparent2D(Element2D* parentNode, float bias)
+{
+  if (this->parent == parentNode)
+    return;
+
+  if (likely(this->toCoordinate == NULL))
+  {
+    this->toCoordinate = new Vector();
+    *this->toCoordinate = this->getRelCoor2D();
+  }
+  if (likely(this->toDirection == NULL))
+  {
+    this->toDirection = new float;
+    *this->toDirection = this->getRelDir2D();
+  }
+  this->bias = bias;
+
+
+  Vector tmpV = this->getAbsCoor2D();
+  float tmpQ = this->getAbsDir2D();
+
+  parentNode->addChild2D(this);
+
+  if (this->parentMode & PNODE_ROTATE_MOVEMENT)
+    ;//this->setRelCoor(this->parent->getAbsDir().inverse().apply(tmpV - this->parent->getAbsCoor()));
+  else
+    this->setRelCoor2D(tmpV - parentNode->getAbsCoor2D());
+
+  this->setRelDir2D(tmpQ - parentNode->getAbsDir2D());
+}
+
+void Element2D::softReparent2D(const char* parentName, float bias)
+{
+  Element2D* parentNode = dynamic_cast<Element2D*>(ClassList::getObject(parentName, CL_ELEMENT_2D));
+  if (parentNode != NULL)
+    this->softReparent2D(parentNode, bias);
 }
 
@@ -262,4 +372,5 @@
 void Element2D::setParentMode2D (const char* parentingMode)
 {
+  this->setParentMode2D(Element2D::charToParentingMode2D(parentingMode));
 }
 
@@ -267,4 +378,5 @@
 void Element2D::update2D (float dt)
 {
+
 }
 
@@ -272,18 +384,71 @@
 void Element2D::debug (unsigned int depth, unsigned int level) const
 {
-}
+  for (unsigned int i = 0; i < level; i++)
+    PRINT(0)(" |");
+  if (this->children->getSize() > 0)
+    PRINT(0)(" +");
+  else
+    PRINT(0)(" -");
+  PRINT(0)("Element2D(%s::%s) - absCoord: (%0.2f, %0.2f), relCoord(%0.2f, %0.2f), direction(%0.2f) - %s\n",
+  this->getClassName(),
+  this->getName(),
+  this->absCoordinate.x,
+  this->absCoordinate.y,
+  this->relCoordinate.x,
+  this->relCoordinate.y,
+  this->getAbsDir2D(),
+  Element2D::parentingModeToChar2D(parentMode));
+  if (depth >= 2 || depth == 0)
+  {
+    tIterator<Element2D>* iterator = this->children->getIterator();
+      //PNode* pn = this->children->enumerate ();
+    Element2D* pn = iterator->nextElement();
+    while( pn != NULL)
+    {
+      if (depth == 0)
+        pn->debug(0, level + 1);
+      else
+        pn->debug(depth - 1, level +1);
+      pn = iterator->nextElement();
+    }
+    delete iterator;
+  }
+}
+
+#include "color.h"
 
 void Element2D::debugDraw2D(unsigned int depth, float size, Vector color) const
 {
+
 }
 
 
 // helper functions //
-const char* Element2D::parentingModeToChar(int parentingMode)
-{
-}
-
-E2D_PARENT_MODE Element2D::charToParentingMode(const char* parentingMode)
-{
+const char* Element2D::parentingModeToChar2D(int parentingMode)
+{
+  if (parentingMode == E2D_PARENT_LOCAL_ROTATE)
+    return "local-rotate";
+  else if (parentingMode == E2D_PARENT_ROTATE_MOVEMENT)
+    return "rotate-movement";
+  else if (parentingMode == E2D_PARENT_MOVEMENT)
+    return "movement";
+  else if (parentingMode == E2D_PARENT_ALL)
+    return "all";
+  else if (parentingMode == E2D_PARENT_ROTATE_AND_MOVE)
+    return "rotate-and-move";
+}
+
+E2D_PARENT_MODE Element2D::charToParentingMode2D(const char* parentingMode)
+{
+  if (!strcmp(parentingMode, "local-rotate"))
+    return (E2D_PARENT_LOCAL_ROTATE);
+  else  if (!strcmp(parentingMode, "rotate-movement"))
+    return (E2D_PARENT_ROTATE_MOVEMENT);
+  else  if (!strcmp(parentingMode, "movement"))
+    return (E2D_PARENT_MOVEMENT);
+  else  if (!strcmp(parentingMode, "all"))
+    return (E2D_PARENT_ALL);
+  else  if (!strcmp(parentingMode, "rotate-and-move"))
+    return (E2D_PARENT_ROTATE_AND_MOVE);
 }
 
@@ -301,2 +466,33 @@
   this->positioning();
 }
+
+
+
+
+
+
+
+NullElement2D* NullElement2D::singletonRef = 0;
+
+/**
+ *  creates the one and only NullElement2D
+ * @param absCoordinate the cordinate of the Parent (normally Vector(0,0,0))
+ */
+NullElement2D::NullElement2D ()
+{
+  this->setClassID(CL_NULL_PARENT, "NullElement2D");
+  this->setName("NullElement2D");
+
+  this->setParentMode2D(E2D_PARENT_ALL);
+  NullElement2D::singletonRef = this;
+}
+
+
+/**
+ *  standard deconstructor
+ */
+NullElement2D::~NullElement2D ()
+{
+  //delete singletonRef;
+  NullElement2D::singletonRef = NULL;
+}
Index: trunk/src/lib/graphics/render2D/element_2d.h
===================================================================
--- trunk/src/lib/graphics/render2D/element_2d.h	(revision 5081)
+++ trunk/src/lib/graphics/render2D/element_2d.h	(revision 5082)
@@ -40,13 +40,13 @@
 typedef enum
 {
-  E2D_LOCAL_ROTATE          =   1,    //!< Rotates all the children around their centers.
-  E2D_ROTATE_MOVEMENT       =   2,    //!< Moves all the children around the center of their parent, without the rotation around their own centers.
-
-  E2D_MOVEMENT              =   4,    //!< Moves all children along with the parent.
+  E2D_PARENT_LOCAL_ROTATE       =   1,    //!< Rotates all the children around their centers.
+  E2D_PARENT_ROTATE_MOVEMENT    =   2,    //!< Moves all the children around the center of their parent, without the rotation around their own centers.
+
+  E2D_PARENT_MOVEMENT           =   4,    //!< Moves all children along with the parent.
 // special linkage modes
-  E2D_ALL                   =   3,    //!< Moves all children around the center of their parent, and also rotates their centers
-  E2D_ROTATE_AND_MOVE       =   5     //!< Rotates all children around their axis, and moves them as the Parent Moves, but does not rotate around the center of their parent.
+  E2D_PARENT_ALL                =   3,    //!< Moves all children around the center of their parent, and also rotates their centers
+  E2D_PARENT_ROTATE_AND_MOVE    =   5     //!< Rotates all children around their axis, and moves them as the Parent Moves, but does not rotate around the center of their parent.
 } E2D_PARENT_MODE;
-#define     E2D_DEFAULT_PARENTING_MODE  E2D_ALL
+#define     E2D_DEFAULT_PARENTING_MODE  E2D_PARENT_ALL
 
 //! A Struct defining the Position of an Element in 2D-space
@@ -137,6 +137,6 @@
     Element2D* getParent () const { return this->parent; };
 
-    void softReparent(PNode* parentNode, float bias = 1.0);
-    void softReparent(const char* parentName, float bias = 1.0);
+    void softReparent2D(Element2D* parentNode, float bias = 1.0);
+    void softReparent2D(const char* parentName, float bias = 1.0);
 
     /** @param parentMode sets the parentingMode of this Node */
@@ -152,6 +152,6 @@
 
     // helper functions //
-    static const char* parentingModeToChar(int parentingMode);
-    static E2D_PARENT_MODE charToParentingMode(const char* parentingMode);
+    static const char* parentingModeToChar2D(int parentingMode);
+    static E2D_PARENT_MODE charToParentingMode2D(const char* parentingMode);
 
   private:
@@ -213,4 +213,20 @@
 };
 
+//! The top joint of all Element2D's every Element2D is somehow connected to this one.
+class NullElement2D : public Element2D {
+
+  public:
+    /** @returns a Pointer to the only object of this Class */
+    inline static NullElement2D* getInstance() { if (!singletonRef) singletonRef = new NullElement2D();  return singletonRef; };
+    virtual ~NullElement2D ();
+
+  private:
+    NullElement2D ();
+    virtual void draw() const {};
+
+  private:
+    static NullElement2D* singletonRef;        //!< A reference to the NullElement2D
+
+};
 
 #endif /* _ELEMENT_2D_H */
