xlinkobj.h
author insilmaril
Fri Aug 19 07:42:31 2005 +0000 (2005-08-19)
changeset 154 fa05daf043a8
parent 95 f688a9913724
child 299 7ca34d0e299d
permissions -rw-r--r--
added license in new aboutwindow and debian subdir by Steffen Joeris
     1 #ifndef XLINKOBJ_H
     2 #define XLINKOBJ_H
     3 
     4 #include "linkablemapobj.h"
     5 
     6 enum XLinkState {undefinedXLink,initXLink,activeXLink,deleteXLink};
     7 
     8 /////////////////////////////////////////////////////////////////////////////
     9 class XLinkObj:public MapObj {
    10 public:
    11     XLinkObj ();
    12     XLinkObj (QCanvas*);
    13     ~XLinkObj ();
    14     virtual void init ();
    15     virtual void copy (XLinkObj*);
    16 	void setBegin (BranchObj*);
    17 	void setEnd   (BranchObj*);
    18 	void setEnd   (QPoint);
    19 	void setColor(QColor);
    20 	QColor getColor();
    21 	void setWidth (int);
    22 	int getWidth ();
    23 	bool activate ();			// Sets pointers in branchObjects
    24 	void deactivate();			// removes those pointers
    25 	bool isUsed();				// true, if at least on branch uses it
    26 	void updateXLink();
    27 	BranchObj* otherBranch (BranchObj*);
    28 	void positionBBox();
    29 	void calcBBoxSize();
    30 	void setVisibility (bool);
    31 	void setVisibility ();
    32 	QString saveToDir ();
    33 
    34 private:
    35 	static int arrowSize;
    36 	QColor color;
    37 	int width;
    38 	QCanvasLine *line;
    39 	QCanvasPolygon *poly;
    40 	BranchObj *beginBranch;
    41 	BranchObj *endBranch;
    42 	BranchObj *visBranch;	// the "visible" part of a partially scrolled link
    43 	XLinkState xLinkState;	// init during drawing or active
    44 	QPoint beginPos;
    45 	QPoint   endPos;
    46 };
    47 
    48 #endif