class MobileThreadNode extends MobileAbstractNode { pt m_start, m_end; MobileThreadNode() { println("Made thread node"); m_start = new pt(0,0,0); m_end = new pt(0,20,0); m_kind = threadNode; println("m_kind = " + m_kind); // thread has a child by default AddChild(); } int SaveMyself(String [] buffer, int curIndex) { //m_start buffer[curIndex++] = str(m_start.x) +","+str(m_start.y)+","+str(m_start.z); //m_end buffer[curIndex++] = str(m_end.x) +","+str(m_end.y)+","+str(m_end.z); return curIndex; } int LoadMyself(String [] buffer, int curIndex) { float x, y, z; //m_start x = GetFloat(buffer[curIndex], 0); y = GetFloat(buffer[curIndex], 1); z = GetFloat(buffer[curIndex], 2); m_start.setTo(x, y, z); curIndex++; //m_end x = GetFloat(buffer[curIndex], 0); y = GetFloat(buffer[curIndex], 1); z = GetFloat(buffer[curIndex], 2); m_end.setTo(x, y, z); curIndex++; return curIndex; } void DrawMyself() { strokeWeight(1); stroke(black); m_start.showLineTo(m_end); } boolean IsMouseIn(float thisX, float thisY, float thisZ) { return false; } void ShowMenuMyself() {} void PressKeyMyself() {} void AddChild() { if ( m_childrenNode.size() < 1 ) { MobileAbstractNode child = new MobileBarNode(this); child.SetPos(m_end.x, m_end.y, m_end.z); m_childrenNode.add(child); } } void RemoveChild() { } void DraggedChild(float dxChild, float dyChild) { m_end.x = dxChild; m_end.y = dyChild; } void ReplaceChild(boolean toMesh) { m_childrenNode.clear(); MobileAbstractNode child; if ( toMesh == true ) { child = new MobileCustomNode(this); } else { child = new MobileBarNode(this); } child.SetPos(m_end.x, m_end.y, m_end.z); child.m_selected = true; m_childrenNode.add(child); } }