diff -r 598768200cfa -r 0b048b6bb6f4 xlinkobj.cpp --- a/xlinkobj.cpp Mon Apr 18 06:37:48 2005 +0000 +++ b/xlinkobj.cpp Thu Apr 21 19:14:38 2005 +0000 @@ -1,5 +1,6 @@ #include "xlinkobj.h" #include "branchobj.h" +#include "mapeditor.h" ///////////////////////////////////////////////////////////////// @@ -7,7 +8,6 @@ ///////////////////////////////////////////////////////////////// int XLinkObj::arrowSize=10; // make instances -QColor XLinkObj::defXLinkColor=QColor(180,180,180); XLinkObj::XLinkObj ():MapObj() { @@ -38,13 +38,16 @@ visBranch=NULL; xLinkState=undefinedXLink; - xLinkColor=defXLinkColor; + width=1; + color=QColor (180,180,180); line=new QCanvasLine (canvas); line->setPoints (0,0,200,200); - line->setPen (QPen(xLinkColor, 1)); + line->setPen (QPen(color, 1)); + line->setZ (Z_XLINK); poly=new QCanvasPolygon (canvas); - poly->setBrush( xLinkColor ); + poly->setBrush( color ); + poly->setZ (Z_XLINK); setVisibility (false); } @@ -79,9 +82,27 @@ } } +void XLinkObj::setWidth (int w) +{ + width=w; + setColor (color); +} + +int XLinkObj::getWidth() +{ + return width; +} + void XLinkObj::setColor(QColor c) { - xLinkColor=c; + color=c; + line->setPen (QPen(color, width)); + poly->setBrush( color ); +} + +QColor XLinkObj::getColor() +{ + return color; } void XLinkObj::setEnd (QPoint p) @@ -249,10 +270,11 @@ QString s; if (beginBranch && endBranch) { - QString colAttr=attribut ("color",xLinkColor.name()); + QString colAttr=attribut ("color",color.name()); + QString widAttr=attribut ("width",QString().setNum(width,10)); QString begSelAttr=attribut ("beginBranch",beginBranch->getSelectString()); QString endSelAttr=attribut ("endBranch", endBranch->getSelectString()); - s=beginElement ("xlink", colAttr +begSelAttr +endSelAttr); + s=beginElement ("xlink", colAttr +widAttr +begSelAttr +endSelAttr); s+=endElement ("xlink"); }