Logo Search packages:      
Sourcecode: tcm version File versions  Download package

TransitionArrow Class Reference

#include <transitionarrow.h>

Inheritance diagram for TransitionArrow:

Line GShape Shape Thing

List of all members.


Detailed Description

arrow having extra horiz. line separating event and list of actions (STD).

Definition at line 28 of file transitionarrow.h.


Public Types

enum  AssocType { SUBJECT, SHAPE, VIEW }
 possible types in the assoclist.
enum  SepType { LEFT, RIGHT, UP, DOWN }

Public Member Functions

void AddPoint (const Point *pt, unsigned int n)
 Add a point after given position n.
virtual void AdjustSize ()
 update size to make the shape fit the text shape strings.
void CalcDirection ()
 Calculate direction arrow.
bool CalcEndPoint (const Point *pt, unsigned which)
 ReCalculate when first or last point of line is moved to pt.
virtual void CalcEndPoints ()
 Calculate begin and end-points (intersections with the shapes).
void CalcPosition ()
 Define a position for the line (the center of the name of the line).
bool CheckReferences ()
 Check also fromShape and toShape shape references.
TextShapeChooseTextShape (int x, int y)
 choose text shape near (x,y).
ShapeClone ()
virtual bool ContainsChild (const GShape *) const
 Returns if gs is contained in the child area of this shape.
bool ContainsPt (int x, int y)
 returns if (x,y) is on one of the segments of line.
void Draw ()
 Draws the shape: shape itself and its text and selection handles.
void DrawOutLine (const Point *)
 empty, because line has no outline.
virtual void DrawTextShapes ()
void DrawWithChildren ()
 draw the shape and all child shapes
TextAlign::Type GetAlignment () const
int GetBottomMost () const
 largest y-coordinate in shape.
int GetClassType () const
 return code of the lowest class.
const stringGetColor () const
unsigned int GetCount () const
 count and order are used to determine whether
LineEnd::Type GetEnd1 ()
LineEnd::Type GetEnd2 ()
XFontGetFont () const
 return font of the textshapes (all textshapes have same font).
GShapeGetFromShape () const
 fromShape and toShape are the connected shapes.
int GetHeight () const
const PointGetHLineFrom () const
const PointGetHLineTo () const
unsigned long GetId ()
int GetLeftMost () const
 as line, but event and actions are also considered.
bool GetLine (int x, int y)
 return if segment has (x,y). if so, lineNumber set to segment nr.
List< Point * > * GetLine () const
 'line' is a list of points.
unsigned int GetLineNumber ()
LineStyle::Type GetLineStyle () const
unsigned GetLineWidth () const
TextShapeGetName () const
ReadDirection::Type GetNameDirection () const
const stringGetNameString ()
unsigned int GetOrder () const
 more than one line connect the same pair of shapes.
const PointGetPosition () const
int GetRightMost () const
 largest x-coordinate in shape.
bool GetSegment (int n, DPoint *pt1, DPoint *pt2)
 get line segment n (if it exists).
bool GetSegment (int n, Point *pt1, Point *pt2)
 get line segment n (if it exists).
bool GetSegments (Point pt, Point *pt1, Point *pt2)
 get left and rigth line segments of point pt (if they exist).
SubjectGetSubject () const
const stringGetTextColor () const
const PointGetTopLeft () const
int GetTopMost () const
 smallest y-coordinate in shape.
GShapeGetToShape () const
ShapeViewGetView () const
int GetWidth () const
Point GiveOrthoSnp (Point to) const
 Calc the intersection of an orthogonal line with shape boundary.
Point GiveSnp (Point p, int order, int count, int &code)
 As GiveSnp but takes into account distribution of multiple lines.
Point GiveSnp (Point to) const
 intersection of boundary and line from given point to shape center.
bool HasNameString (const string *, bool, bool) const
 return if name text shape contains 's'.
bool HasString (const string *, bool, bool, List< TextShape * > *)
 put all textshapes containing 's' in the list l.
bool HasString (const string *s, bool sens, bool sub) const
 return if some text shape contains 's'.
bool HasTextShape (TextShape *t) const
 return if it has t as one of the text shapes.
int HitHandles (int x, int y)
 returns handle-nr if (x,y) hits a handle, otherwise -1.
bool HitHLine (int x, int y)
TextShapeHitTextShape (int x, int y)
 Returns if (x,y) is in name, and if so returns name.
bool InTextArea (int x, int y)
 returns if (x,y) is in text area (used for edit cursor).
bool IsCurved () const
bool IsDuplicate () const
bool IsFirstSelected () const
bool IsFixedName ()
bool IsLine () const
 yep.
virtual bool IsNodeShape () const
bool IsSelected () const
bool IsShape () const
virtual bool IsSubject () const
virtual bool IsTextShape () const
virtual bool IsView () const
bool IsVisible () const
void MoveRaw (const Point *delta)
 move all points and text shapes with delta.
unsigned int NrPoints () const
bool ReadMembers (InputFile *f, double format)
 See shape. Reads/writes also the points.
Point RecalcPositionName (bool useReadDirection)
 just recalculate the position of the name text shape.
void RemovePoint (unsigned int n)
 Remove the point at given position n.
virtual void SetAnchors ()
bool SetAssocSubject (AssocList *)
 Set subject (edge) reference,.
bool SetAssocView (AssocList *)
 update view reference from assocList.
void SetColor (const string *c)
void SetCount (unsigned int i)
void SetDuplicate (bool b)
void SetEnd1 (LineEnd::Type t)
void SetEnd2 (LineEnd::Type t)
virtual void SetFirstSelect (bool s)
void SetFixedName (bool b)
void SetFont (XFont *ft)
 set fonts of text shapes.
void SetFromBottom ()
 set first point of line to bottom of fromShape.
void SetFromShape (GShape *n)
void SetFromTop ()
 set first point of line to top of fromShape.
void SetGrafport (Grafport *g)
 set grafport of itself and its text shapes.
void SetId (unsigned long val)
void SetLineNumber (unsigned int n)
void SetLineStyle (LineStyle::Type x)
void SetLineWidth (unsigned n)
virtual void SetNameString (const string *s)
void SetOrder (unsigned int i)
void SetPoint (const Point *pt, unsigned int n)
 Update point of given position n.
void SetPosition (const Point *p, bool snap=True)
 empty (line has no independent position).
bool SetReferences (AssocList *)
 Set also fromShape and toShape references.
void SetSelect (bool s)
 select this shape and its text shapes are selected.
void SetSubject (Subject *s)
void SetTextColor (const string *color)
 set color of text shapes.
void SetTextShape ()
 update the strings of text shapes with the subject strings.
void SetToBottom ()
 set last point of line to bottom of toShape.
void SetToShape (GShape *n)
void SetToTop ()
 set last point of line to top of toShape.
void SetView (ShapeView *v)
 set view of itself and its text shapes.
void SetVisible (bool s)
 TransitionArrow (const TransitionArrow &line)
 TransitionArrow (ShapeView *v, Grafport *g, GShape *n1, GShape *n2, bool Curved)
 TransitionArrow (ShapeView *v, Grafport *g, GShape *n1, GShape *n2, List< Point * > *line, bool Curved)
void Undraw ()
 Erases the shape: by redrawing it in XOR mode.
void UndrawDuplicate ()
virtual void UndrawShape ()
virtual void UndrawTextShapes ()
void UndrawWithChildren ()
 undraw the shape and all child shapes
void UpdateAction (const string *s, unsigned n, bool update)
virtual void UpdateAlignment (TextAlign::Type alignment)
 update text alignments and redraw.
void UpdateAnchor (const Point *delta, const Point *position)
virtual void UpdateColor (string *color)
 update color and redraw.
void UpdateCurve (bool b)
void UpdateDuplicate (bool b)
 set whether shape is a duplicate shape.
void UpdateEnd1 (LineEnd::Type t)
void UpdateEnd2 (LineEnd::Type t)
void UpdateEvent (const string *s)
virtual void UpdateFirstSelect (bool s)
 update first selection handles and redraw.
virtual void UpdateFont (XFont *ft)
 update font and redraw.
void UpdateLineStyle (LineStyle::Type x)
void UpdateLineWidth (unsigned n)
virtual void UpdateMove (const Point *delta)
 update movement and redraw.
void UpdateNameDirection (ReadDirection::Type nd)
virtual void UpdateNameString (const string *s)
 update string of name text shape and redraw.
virtual void UpdateParent (Node *parent)
 update subject's parent and redraw.
void UpdatePosition ()
 recalculates position and redraws the line.
void UpdatePosition (const Point *p, bool snap=True)
 empty (line has no independent position).
virtual void UpdateSelect (bool s)
 update selection handles and redraw.
virtual void UpdateSize (int w, int h)
 update size and redraw.
void UpdateTextColor (const string *c)
void Write (OutputFile *ofile)
 write thing to file ofile.
void WriteMembers (OutputFile *f)
 See shape. Reads/writes also the points.

Static Public Attributes

static const int HANDLE_WIDTH = 6
 size of selection handle.
static const int MIN_HEIGHT = 20
 minimal height of a shape.
static const int MIN_WIDTH = 20
 minimal width of a shape.

Protected Member Functions

bool AboveLine (int x, int y, Point *from, Point *to)
 return if (x,y) is above line from->to.
bool BelowLine (int x, int y, Point *from, Point *to)
 return if (x,y) is down to line from->to.
void CalcPositionName ()
 recalculate the position of the name text shape.
bool ContainsPtLine (int x, int y, const Point *from, const Point *to, int &cx, int &cy) const
 returns (x,y) is near line from-to, cx and cy are points on line.
void DrawDirection ()
void ForcePosition (const Point *position)
GrafportGetGrafport () const
DiagramViewerGetViewer () const
void NotifyTextMove (TextShape *t)
 react on movement of some text shape.
void PositiveCoord ()
 change position so that shape has only positive coordinates.
bool ReadGraphicsPart (InputFile *ifile, double format)
 read line width and style from file.
bool ReadTextPart (InputFile *ifile, double format)
 read and parse font and alignment from file.
virtual void SetAlignment (TextAlign::Type a)
 set alignments of text shapes.
virtual void SetDrawAttributes ()
 set attributes of grafport before drawing.
void SetHeight (int h)
void SetNameDirection (ReadDirection::Type nd)
void SetNrHandles (int n)
void SetOutlineAttributes ()
 set attributes of grafport for drawing outlines.
virtual void SetPositionHandles ()
 set all handle rectangles.
virtual void SetSize (int w, int h)
 set the size of the shape (with a minimum).
void SetTopLeft (const Point *topLeft)
 set the top-left and position (take into account width and height).
void SetWidth (int w)
virtual void SnapPosition ()
 snap at position and text shapes are moved with.
virtual void SnapTopleft ()
 snap at topleft and text shapes are moved with.
void UndrawDirection ()
virtual void UndrawGraySelect ()
virtual void UndrawSelect ()
void WriteGraphicsPart (OutputFile *ofile)
 write line width and style to file.
void WriteTextPart (OutputFile *ofile)
 write font and alignment to file.

Protected Attributes

Rectangle handles [8]
 the position and size of the selection handles.

Static Protected Attributes

static const int CL_DISTX = 14
 default x distance between textshapes to line.
static const int CL_DISTY = 10
 default y distance between textshapes to line.
static const int MIN_HANDLES = 4
 minimal nr. of handles.

Private Member Functions

void CalcHLinePart ()
void CalcPositionActions ()
void CalcPositionEvent ()
void CalcPositionHLine ()
 calculate line position and action and event.
void CalcSeparator ()
void DrawShape ()
 draw arrow + all labels + 1 horiz line.
int HLineLength ()
const char * Sep2String (SepType sep)
void SetAction (const string *s, unsigned n, bool update)
TransitionArrow::SepType String2Sep (const string *s)

Private Attributes

List< TextShape * > * actions
Point anchorPoint
TextShapeevent
Point hlineFrom
Point hlineTo
SepType separator

Static Private Attributes

static const int HLINEDIST = 10
 distance to horizontal line.
static const int HLINELEN = 20
 minimal length hline.
static const int HLINEXOFFSET = 4
static const int HLINEYOFFSET = 2

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index