xlinkobj.h
author insilmaril
Wed, 27 Jul 2005 18:56:35 +0000
changeset 139 087e60400acc
parent 97 0b048b6bb6f4
child 299 7ca34d0e299d
permissions -rw-r--r--
1.7.2 fixed undo to select the right object before undoCommand
     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