umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
Classes | Public Types | Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Symbol Class Reference

#include <associationline.h>

Inheritance diagram for Symbol:
Collaboration diagram for Symbol:

Classes

struct  SymbolProperty
 A structure to hold a table of values for all symbols. More...
 

Public Types

enum  SymbolType {
  None = -1 , OpenArrow , ClosedArrow , CrowFeet ,
  Diamond , Subset , Circle , Count
}
 
typedef QPair< QPointF, QPointF > SymbolEndPoints
 

Public Member Functions

 Symbol (SymbolType symbolType, QGraphicsItem *parent=0)
 
virtual ~Symbol ()
 
SymbolType symbolType () const
 
void setSymbolType (SymbolType symbolType)
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 
virtual QRectF boundingRect () const
 
virtual QPainterPath shape () const
 
void alignTo (const QLineF &line)
 
SymbolEndPoints symbolEndPoints () const
 
QPen pen () const
 
void setPen (const QPen &pen)
 
QBrush brush () const
 
void setBrush (const QBrush &brush)
 

Static Private Member Functions

static void setupSymbolTable ()
 

Private Attributes

QPen m_pen
 pen used to draw Symbol More...
 
QBrush m_brush
 brush used to fill Symbol More...
 
SymbolType m_symbolType
 current symbol being represented by this item More...
 

Static Private Attributes

static SymbolProperty symbolTable [Symbol::Count]
 a table which stores all symbol properties More...
 

Detailed Description

This class provides various symbols that can be embedded in AssociationLine. It also provides convenience methods to align the symbol to AssociationLine.

Member Typedef Documentation

◆ SymbolEndPoints

typedef QPair<QPointF, QPointF> Symbol::SymbolEndPoints

Member Enumeration Documentation

◆ SymbolType

This enumeration lists all the symbols that can be used as embedded on AssociationLine.

Enumerator
None 
OpenArrow 
ClosedArrow 
CrowFeet 
Diamond 
Subset 
Circle 
Count 

Constructor & Destructor Documentation

◆ Symbol()

Symbol::Symbol ( SymbolType  symbolType,
QGraphicsItem *  parent = 0 
)
explicit

Constructs a Symbol with current symbol being symbol and parented to parent.

Here is the call graph for this function:

◆ ~Symbol()

Symbol::~Symbol ( )
virtual

Destructor.

Member Function Documentation

◆ alignTo()

void Symbol::alignTo ( const QLineF &  to)

This method aligns *this* Symbol to the line being passed. That is, it ensures that the axis of this symbol aligns exactly with the "to" line passed.

Also this item is moved such that the second end point of the SymbolEndPoints for the current symbol *collides* with the second end point of "to" line.

Here is the call graph for this function:

◆ boundingRect()

QRectF Symbol::boundingRect ( ) const
virtual
Returns
The bound rectangle for this based on current symbol.

◆ brush()

QBrush Symbol::brush ( ) const
Returns
The brush used to fill symbol.

◆ paint()

void Symbol::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
virtual

Draws the current symbol using the QPainterPath stored for the current symbol.

Here is the call graph for this function:

◆ pen()

QPen Symbol::pen ( ) const
Returns
The pen used to draw symbol.

◆ setBrush()

void Symbol::setBrush ( const QBrush &  brush)

Sets the brush used to fill symbol.

Here is the call graph for this function:

◆ setPen()

void Symbol::setPen ( const QPen &  pen)

Sets the pen used to draw the symbol.

Here is the call graph for this function:

◆ setSymbolType()

void Symbol::setSymbolType ( SymbolType  symbolType)

Sets the current symbol type to symbol and updates the geometry.

Here is the call graph for this function:

◆ setupSymbolTable()

void Symbol::setupSymbolTable ( )
staticprivate

◆ shape()

QPainterPath Symbol::shape ( ) const
virtual
Returns
The path for this based on current symbol.
Here is the call graph for this function:

◆ symbolEndPoints()

Symbol::SymbolEndPoints Symbol::symbolEndPoints ( ) const
Returns
The end points for the symbol.

◆ symbolType()

Symbol::SymbolType Symbol::symbolType ( ) const
Returns
The current symbol being represented.

Member Data Documentation

◆ m_brush

QBrush Symbol::m_brush
private

brush used to fill Symbol

◆ m_pen

QPen Symbol::m_pen
private

pen used to draw Symbol

◆ m_symbolType

SymbolType Symbol::m_symbolType
private

current symbol being represented by this item

◆ symbolTable

Symbol::SymbolProperty Symbol::symbolTable
staticprivate
Initial value:
=
{
{
QRectF(-6, 0, 12, 10), QPainterPath(), QLineF(0, 0, 0, 10),
SymbolEndPoints(QPointF(0, 10), QPointF(0, 10))
},
{
QRectF(-6, 0, 12, 10), QPainterPath(), QLineF(0, 0, 0, 10),
SymbolEndPoints(QPointF(0, 0), QPointF(0, 10))
},
{
QRectF(-6, 0, 12, 10), QPainterPath(), QLineF(0, 0, 0, 10),
SymbolEndPoints(QPointF(0, 10), QPointF(0, 10))
},
{
QRectF(-5, -10, 10, 20), QPainterPath(), QLineF(0, -10, 0, 10),
SymbolEndPoints(QPointF(0, -10), QPointF(0, 10))
},
{
QRectF(-15, -10, 30, 20), QPainterPath(), QLineF(-10, 0, 0, 0),
SymbolEndPoints(QPointF(0, 0), QPointF(0, 0))
},
{
QRectF(-8, -8, 16, 16), QPainterPath(), QLineF(0, -8, 0, 8),
SymbolEndPoints(QPointF(0, -8), QPointF(0, 8))
}
}
QPair< QPointF, QPointF > SymbolEndPoints
Definition: associationline.h:30

a table which stores all symbol properties

SymbolEndPoints: The first point is where the AssociationLine's visible line is supposed to end. The second points is where the actual symbol part is to appear.


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