xlinkobj.h
branchqt4-port
changeset 2 608f976aa7bb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xlinkobj.h	Tue Jun 06 14:58:11 2006 +0000
     1.3 @@ -0,0 +1,50 @@
     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 (Q3Canvas*);
    1.16 +    ~XLinkObj ();
    1.17 +    virtual void init ();
    1.18 +    virtual void copy (XLinkObj*);
    1.19 +	void setBegin (BranchObj*);
    1.20 +	BranchObj* getBegin();
    1.21 +	void setEnd   (BranchObj*);
    1.22 +	void setEnd   (QPoint);
    1.23 +	BranchObj* getEnd();
    1.24 +	void setColor(QColor);
    1.25 +	QColor getColor();
    1.26 +	void setWidth (int);
    1.27 +	int getWidth ();
    1.28 +	bool activate ();			// Sets pointers in branchObjects
    1.29 +	void deactivate();			// removes those pointers
    1.30 +	bool isUsed();				// true, if at least on branch uses it
    1.31 +	void updateXLink();
    1.32 +	BranchObj* otherBranch (BranchObj*);
    1.33 +	void positionBBox();
    1.34 +	void calcBBoxSize();
    1.35 +	void setVisibility (bool);
    1.36 +	void setVisibility ();
    1.37 +	QString saveToDir ();
    1.38 +
    1.39 +private:
    1.40 +	static int arrowSize;
    1.41 +	QColor color;
    1.42 +	int width;
    1.43 +	Q3CanvasLine *line;
    1.44 +	Q3CanvasPolygon *poly;
    1.45 +	BranchObj *beginBranch;
    1.46 +	BranchObj *endBranch;
    1.47 +	BranchObj *visBranch;	// the "visible" part of a partially scrolled link
    1.48 +	XLinkState xLinkState;	// init during drawing or active
    1.49 +	QPoint beginPos;
    1.50 +	QPoint   endPos;
    1.51 +};
    1.52 +
    1.53 +#endif