X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=xlink.cpp;fp=xlink.cpp;h=0000000000000000000000000000000000000000;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=4c286dc90c28241cad6d0947358bd7d4d12bcc19;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/xlink.cpp b/xlink.cpp deleted file mode 100644 index 4c286dc..0000000 --- a/xlink.cpp +++ /dev/null @@ -1,286 +0,0 @@ -#include - -#include "xlink.h" - -#include "branchitem.h" -#include "misc.h" -#include "vymmodel.h" -#include "xlinkitem.h" -#include "xlinkobj.h" - -class VymModel; - -///////////////////////////////////////////////////////////////// -// Link -///////////////////////////////////////////////////////////////// - -Link::Link (VymModel *m) -{ - //qDebug() << "Const Link () this="<setStyleBegin( s ); - xlo->updateXLink(); - } -} - -QString Link::getStyleBeginString() -{ - if (xlo) - return ArrowObj::styleToString( xlo->getStyleBegin() ); - else - return QString(); -} - -void Link::setStyleEnd (const QString &s) -{ - if (xlo) - { - xlo->setStyleEnd( s ); - xlo->updateXLink(); - } -} - -QString Link::getStyleEndString() -{ - if (xlo) - return ArrowObj::styleToString( xlo->getStyleEnd() ); - else - return QString(); -} - -bool Link::activate () -{ - if (beginBranch && endBranch) - { - if ( beginBranch == endBranch) return false; - xLinkState = activeXLink; - model->updateActions(); - return true; - } else - return false; -} - -void Link::deactivate () -{ - // Remove pointers from XLinkItem to Link and - // delete XLinkObj - -// qDebug()<<"Link::deactivate ******************************"; - xLinkState=deleteXLink; - if (beginLinkItem) beginLinkItem->setLink (NULL); - if (endLinkItem) endLinkItem->setLink (NULL); - if (xlo) - { - delete (xlo); - xlo=NULL; - } -} - -Link::XLinkState Link::getState() -{ - return xLinkState; -} - -void Link::removeXLinkItem (XLinkItem *xli) -{ - // Only mark _one_ end for removal here! - if (xli==beginLinkItem) beginLinkItem=NULL; - if (xli==endLinkItem) endLinkItem=NULL; - xLinkState=deleteXLink; -} - -void Link::updateLink() -{ - if(xlo ) xlo->updateXLink(); -} - -QString Link::saveToDir () -{ -// qDebug()<<"Link::saveToDir this="<getC0() ) ); - ctrlAttr +=attribut ("c1",pointToString (xlo->getC1() ) ); - } - break; - } - QString begSelAttr=attribut ("beginID",model->getSelectString(beginBranch)); - QString endSelAttr=attribut ("endID", model->getSelectString(endBranch)); - QString styleAttr; - if (xlo) - { - styleAttr = QString(" styleBegin=\"%1\"").arg( ArrowObj::styleToString( xlo->getStyleBegin() )); - styleAttr+= QString(" styleEnd=\"%1\"" ).arg( ArrowObj::styleToString( xlo->getStyleEnd() )); - } - s=singleElement ("xlink", - colAttr - +widAttr - +styAttr - +typeAttr - +ctrlAttr - +begSelAttr - +endSelAttr - +styleAttr); - } - } - return s; -} - -XLinkObj* Link::getXLinkObj() -{ - return xlo; -} - -XLinkObj* Link::createMapObj() -{ - if (!xlo) xlo=new XLinkObj (beginBranch->getLMO(),this); - xlo->setVisibility(); - return xlo; -} - -MapObj* Link::getMO() -{ - return xlo; -} -