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

C2R2MListLine Class Reference

#include <c2r2mlistline.h>

Inheritance diagram for C2R2MListLine:

T4TListLine T4Line T2Line T1Line Line GShape Shape Thing

List of all members.

Detailed Description

line having card. constraints and role names at both sides PLUS a list of textshapes

Definition at line 31 of file c2r2mlistline.h.

Public Types

enum  AssocType { SUBJECT, SHAPE, VIEW }
 possible types in the assoclist.
enum  PositionType { TL, TR, BL, BR }

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.
 C2R2MListLine (ShapeView *v, Grafport *g, GShape *n1, GShape *n2, bool Curved)
 C2R2MListLine (ShapeView *v, Grafport *g, GShape *n1, GShape *n2, List< Point * > *line, bool Curved)
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 CalcMsgDirection (unsigned n)
void CalcPosition ()
 Define a position for the line (the center of the name of the line).
void CalcPositionTextShapeList ()
 calculate position of text shapes list.
void CalcPositionTextShapes ()
 calculate position of all text shapes.
bool CheckReferences ()
 Check also fromShape and toShape shape references.
TextShapeChooseTextShape (int x, int y)
 returns text shape if hit or if empty, otherwise return name.
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.
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
unsigned long GetId ()
int GetLeftMost () const
 as line, but all text shapes are 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.
TextShapeHitTextShape (int x, int y)
 returns name or extra text shape if hit.
bool InTextArea (int x, int y)
 see T4Line. Holds all text shapes into account.
bool IsCurved () const
bool IsDuplicate () const
bool IsFirstSelected () const
bool IsFixedName ()
bool IsLine () const
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 ReDrawTListTextShape (const string *s, unsigned n)
void RemovePoint (unsigned int n)
 Remove the point at given position n.
int ReplaceNameString (const string *, const string *, bool, bool)
void SetAlignment (TextAlign::Type alignment)
 set alignments of text shapes.
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)
void Undraw ()
 Erases the shape: by redrawing it in XOR mode.
void UndrawDuplicate ()
virtual void UndrawShape ()
virtual void UndrawTextShapes ()
void UndrawTListTextShape (const string *s, unsigned n)
void UndrawWithChildren ()
 undraw the shape and all child shapes
virtual void UpdateAlignment (TextAlign::Type alignment)
 update text alignments and redraw.
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)
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 UpdateTextShape1 (const string *s)
 calls corresponding members of textShape1.
void UpdateTextShape2 (const string *s)
void UpdateTextShape3 (const string *s)
void UpdateTextShape4 (const string *s)
void UpdateTListTextShape (const string *s, unsigned n)
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.
void CalcPositionTextShape (TextShape *t, PositionType tpos)
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 DrawShape ()
 draw line+ 4 other text shapes.
void DrawTextShapes ()
void ForcePosition (const Point *position)
GrafportGetGrafport () const
PositionType GetT1Position ()
PositionType GetT2Position ()
PositionType GetT3Position ()
PositionType GetT4Position ()
TextShapeGetTextShape1 () const
TextShapeGetTextShape2 () const
TextShapeGetTextShape3 () const
TextShapeGetTextShape4 () const
List< TextShape * > * GetTList () const
DiagramViewerGetViewer () const
bool HitExtraTextShapeArea (int x, int y, const Point *from, const Point *to)
 returns of (x,y) hits area for extra textshapes.
bool HitTextShapeArea (TextShape *t, PositionType tpos, int x, int y)
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 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 SetT1Position (PositionType t)
void SetT2Position (PositionType t)
void SetT3Position (PositionType t)
void SetT4Position (PositionType t)
void SetTextShape1 (TextShape *t)
void SetTextShape2 (TextShape *t)
void SetTextShape3 (TextShape *t)
void SetTextShape4 (TextShape *t)
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 CL_FRACTION = 4
 fraction of line for the extra textshapes.
static const int MIN_HANDLES = 4
 minimal nr. of handles.

Private Member Functions

void InitTextShapes ()

Private Attributes

LineEnd dummy
List< Point * > * plist

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

Generated by  Doxygen 1.6.0   Back to index