xlinkobj.h
changeset 96 598768200cfa
child 97 0b048b6bb6f4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xlinkobj.h	Mon Apr 18 06:37:48 2005 +0000
     1.3 @@ -0,0 +1,45 @@
     1.4 +#ifndef XLINKOBJ_H
     1.5 +#define XLINKOBJ_H
     1.6 +
     1.7 +#include "linkablemapobj.h"
     1.8 +
     1.9 +enum XLinkState {undefinedXLink,initXLink,activeXLink,deleteXLink};
    1.10 +
    1.11 +/////////////////////////////////////////////////////////////////////////////
    1.12 +class XLinkObj:public MapObj {
    1.13 +public:
    1.14 +    XLinkObj ();
    1.15 +    XLinkObj (QCanvas*);
    1.16 +    ~XLinkObj ();
    1.17 +    virtual void init ();
    1.18 +    virtual void copy (XLinkObj*);
    1.19 +	void setBegin (BranchObj*);
    1.20 +	void setEnd   (BranchObj*);
    1.21 +	void setEnd   (QPoint);
    1.22 +	void setColor(QColor);
    1.23 +	bool activate ();			// Sets pointers in branchObjects
    1.24 +	void deactivate();			// removes those pointers
    1.25 +	bool isUsed();				// true, if at least on branch uses it
    1.26 +	void updateXLink();
    1.27 +	BranchObj* otherBranch (BranchObj*);
    1.28 +	void positionBBox();
    1.29 +	void calcBBoxSize();
    1.30 +	void setVisibility (bool);
    1.31 +	void setVisibility ();
    1.32 +	QString saveToDir ();
    1.33 +
    1.34 +private:
    1.35 +	static int arrowSize;
    1.36 +	static QColor defXLinkColor;
    1.37 +	QColor xLinkColor;
    1.38 +	QCanvasLine *line;
    1.39 +	QCanvasPolygon *poly;
    1.40 +	BranchObj *beginBranch;
    1.41 +	BranchObj *endBranch;
    1.42 +	BranchObj *visBranch;	// the "visible" part of a partially scrolled link
    1.43 +	XLinkState xLinkState;	// init during drawing or active
    1.44 +	QPoint beginPos;
    1.45 +	QPoint   endPos;
    1.46 +};
    1.47 +
    1.48 +#endif