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

SSDTripleClassBox Class Reference

#include <ssdtripleclassbox.h>

Inheritance diagram for SSDTripleClassBox:

TripleClassBox TripleBox DoubleBox Box NodeShape GShape Shape Thing

List of all members.

Detailed Description

A triple box used for a object class.

Definition at line 30 of file ssdtripleclassbox.h.

Public Types

enum  AssocType { SUBJECT, SHAPE, VIEW }
 possible types in the assoclist.

Public Member Functions

void AdjustSize ()
 update size to make it fit the text shapes.
void CalcCompleteIndex (string *s) const
 calculate index label with parent indication.
bool CheckReferences ()
 Check also that name reference is ok.
TextShapeChooseTextShape (int x, int y)
 return a text shape near (x,y).
ShapeClone ()
bool ContainsChild (const GShape *gs) const
 Returns true is ns is in the child area.
bool ContainsPt (int x, int y)
 Returns true if (x,y) is in the shape.
void CorrectScale (double *pwidth, double *pheight, bool constrainX, bool constrainY) const
void Draw ()
 Draws the shape: shape itself and its text and selection handles.
void DrawDuplicate ()
 draw duplicate asterisk.
void DrawMultiplicity ()
 draw multiplicity number.
void DrawOutLine (const Point *centre)
 Draw outline of the shape (when it is dragged).
virtual void DrawOutLine (double x, double y, double w, double h)
 draws the outline with a specific size.
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
const stringGetFillColor () const
FillStyle::Type GetFillStyle () const
XFontGetFont () const
 return font of the textshapes (all textshapes have same font).
int GetHeight () const
unsigned long GetId ()
TextShapeGetIndexLabel () const
int GetInitialHeight () const
TextShapeGetLabel (unsigned n)
TextShapeGetLabel2 (unsigned n)
int GetLeftMost () const
 refinements of those shape members.
LineStyle::Type GetLineStyle () const
unsigned GetLineWidth () const
TextShapeGetName () const
const stringGetNameString ()
const PointGetPosition () const
TextShapeGetPropertiesLabel () const
const stringGetPropertiesLabelString ()
int GetRightMost () const
 largest x-coordinate in shape.
LineStyle::Type GetSeparator2LineStyle () const
LineStyle::Type GetSeparatorLineStyle () const
const ShapeTypeGetShapeType () const
TextShapeGetStereotypeLabel () const
const stringGetStereotypeLabelString ()
SubjectGetSubject () const
const stringGetTextColor () const
const PointGetTopLeft () const
int GetTopMost () const
 smallest y-coordinate in shape.
ShapeViewGetView () const
int GetWidth () const
Point GiveOrthoSnp (Point to) const
 Calc the intersection of an orthogonal line with shape boundary.
Point GiveSnp (Point to, 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.
virtual bool HasNameString (const string *s, bool c1, bool c2) const
 return if name text shape contains 's'.
bool HasString (const string *, bool, bool, List< TextShape * > *list)
 put all textshapes containing 's' in the list l.
bool HasString (const string *s, bool sens, bool sub) const
 contains s as string (case sensitive, substring).
bool HasTextShape (TextShape *t) const
 return if it has t as one of the text shapes.
int HitHandles (int x, int y)
 Return (x,y) handle hit (-1 if not, 0 when shape is line).
virtual TextShapeHitTextShape (int x, int y)
 Returns if (x,y) is in name, and if so returns name.
bool InTextArea (int x, int y)
 Returns true if (x,y) is in text-area.
bool IsDuplicate () const
bool IsFirstSelected () const
bool IsFixedIndexLabel () const
bool IsFixedName ()
virtual bool IsLine () const
virtual bool IsNodeShape () const
bool IsResizable () const
bool IsSelected () const
bool IsShape () const
bool IsShowProperties () const
bool IsShowStereotype () const
virtual bool IsSubject () const
virtual bool IsTextShape () const
virtual bool IsView () const
bool IsVisible () const
virtual void Move (const Point *delta)
 move position by delta.
virtual void MoveRaw (const Point *delta)
 move the shape over exact delta, without snap.
virtual void NotifyTextMove (TextShape *)
 react on movement of some text shape.
unsigned NrLabels ()
unsigned NrLabels2 ()
bool ReadMembers (InputFile *f, double format)
 read and parse it from file.
bool SetAssocSubject (AssocList *)
 update subject reference from assocList.
bool SetAssocView (AssocList *)
 update view reference from assocList.
void SetColor (const string *c)
void SetDuplicate (bool b)
void SetFillColor (const string *c)
void SetFillStyle (FillStyle::Type f)
virtual void SetFirstSelect (bool s)
void SetFixedIndexLabel (bool b)
void SetFixedName (bool b)
void SetFont (XFont *ft)
 set fonts of text shapes.
void SetGrafport (Grafport *g)
 set grafport of itself and its text shapes.
void SetHandles (int n)
 set n handle rectangles.
void SetId (unsigned long val)
virtual void SetIndexLabel (const string *s)
 update string of label.
void SetLineStyle (LineStyle::Type x)
void SetLineWidth (unsigned n)
void SetNameString (const string *s)
 adjusts also the handles (and new size)
void SetPosition (const Point *p, bool snap=True)
 adjusts also the label to a new place
virtual bool SetReferences (AssocList *)
 update references when thing is read.
void SetResizable (bool b)
virtual void SetSelect (bool s)
 select this shape and its text shapes are selected.
void SetSeparator2LineStyle (LineStyle::Type x)
void SetSeparatorLineStyle (LineStyle::Type x)
void SetShapeType (const ShapeType *st)
void SetShowProperties (bool b)
void SetShowStereotype (bool b)
void SetSize (int w, int h)
 adjusts also the label to a new place
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 SetView (ShapeView *v)
 set view of itself and its text shapes.
void SetVisible (bool s)
 SSDTripleClassBox (const SSDSingleClassBox &s)
 SSDTripleClassBox (const SSDDoubleClassBox &s)
 SSDTripleClassBox (const SSDTripleClassBox &s)
 SSDTripleClassBox (ShapeView *v, Grafport *g, int x, int y, int w=TRIPLECLASSBOX_WIDTH, int h=TRIPLECLASSBOX_HEIGHT)
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
virtual void UpdateAlignment (TextAlign::Type alignment)
 update text alignments and redraw.
virtual void UpdateColor (string *color)
 update color and redraw.
void UpdateDuplicate (bool b)
 set whether shape is a duplicate shape.
void UpdateFillColor (const string *c)
void UpdateFillStyle (FillStyle::Type f)
virtual void UpdateFirstSelect (bool s)
 update first selection handles and redraw.
virtual void UpdateFont (XFont *ft)
 update font and redraw.
void UpdateIndexLabel (const string *s)
 update string of label and redraw.
void UpdateLabel (const string *s, unsigned n, bool update)
 update or insert string of n-th label.
void UpdateLabel2 (const string *s, unsigned n, bool update)
 update or insert string of n-th label2.
void UpdateLineStyle (LineStyle::Type x)
void UpdateLineWidth (unsigned n)
virtual void UpdateMove (const Point *delta)
 update movement and redraw.
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.
virtual void UpdatePosition (const Point *position, bool snap=True)
 update position and redraw.
void UpdatePropertiesLabelString (const string *s)
 update string of properties text shape and redraw.
virtual void UpdateSelect (bool s)
 update selection handles and redraw.
void UpdateShowProperties (bool b)
void UpdateShowStereotype (bool b)
virtual void UpdateSize (int w, int h)
 update size and redraw.
void UpdateStereotypeLabelString (const string *s)
 update string of stereotype text shape and redraw.
void UpdateTextColor (const string *c)
void Write (OutputFile *ofile)
 write thing to file ofile.
void WriteMembers (OutputFile *f)
 write it to file.

Static Public Attributes

static const int BOX_HEIGHT = 40
static const int BOX_WIDTH = 80
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.
static const int TRIPLECLASSBOX_HEIGHT = 66
static const int TRIPLECLASSBOX_WIDTH = 76

Protected Member Functions

virtual void CalcPositionLabels ()
 calculates name position in 1st compartiment, labels in 2nd.
virtual void DrawGraySelect ()
 Draw grey handles if the object is selected.
virtual void DrawSelect ()
 Draw the handles if object is (first) selected.
void DrawShape ()
 draws the graphic part of the shape.
void ForcePosition (const Point *position)
GrafportGetGrafport () const
List< TextShape * > * GetLabels ()
List< TextShape * > * GetLabels2 ()
DiagramViewerGetViewer () const
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 SetNrHandles (int n)
void SetOutlineAttributes ()
 set attributes of grafport for drawing outlines.
void SetPositionHandles ()
 set all handle rectangles.
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.
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.
int initialHeight
string label2Description
string labelDescription

Static Protected Attributes

static const int MIN_HANDLES = 4
 minimal nr. of handles.
static const int TEXTMARGIN = 4

Private Member Functions

void AdjustSizes (const string *s)
void CalcPositionLabels2 ()
void CalcPositionPropertiesLabel ()
void CalcPositionStereotypeLabel ()
int DoubleBoxHeight ()
void DrawTextShapes ()
 draw name + index text shape.
int RequiredHeight ()
int RequiredWidth ()
void SetPropertiesLabelString (const string *s)
void SetStereotypeLabelString (const string *s)
int TripleBoxHeight ()

Private Attributes

bool showProperties
bool showStereotype

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

Generated by  Doxygen 1.6.0   Back to index