umbrello/umbrello
associationline.cpp
Go to the documentation of this file.
739 stroker.setWidth(qMax<qreal>(2*SelectedPointDiameter, pen().widthF()) + 2.0); // allow delta region
900 void AssociationLine::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
1015 m_activeSegmentIndex = (m_activePointIndex != -1) ? -1 : closestSegmentIndex(event->scenePos());
1104 m_activeSegmentIndex = (m_activePointIndex != -1) ? -1 : closestSegmentIndex(event->scenePos());
1106 bool isChanged = (oldSegmentIndex != m_activeSegmentIndex || oldPointIndex != m_activePointIndex);
1127 m_activeSegmentIndex = (m_activePointIndex != -1) ? -1 : closestSegmentIndex(event->scenePos());
1129 bool isChanged = (oldSegmentIndex != m_activeSegmentIndex || oldPointIndex != m_activePointIndex);
1302 void Symbol::paint(QPainter *painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
const char * className() const
Definition: associationline.h:44
QPointF mapToParent(const QPointF &point) const
Definition: associationline.h:111
QPointF mapFromParent(const QPointF &point) const
void setWidth(qreal width)
void translate(const QPointF &offset)
qreal x() const
qreal y() const
static QString toString(LayoutType layout)
Convert enum LayoutType to string.
Definition: associationline.cpp:747
int closestSegmentIndex(const QPointF &point, qreal delta=Delta) const
Return index of closest segment.
Definition: associationline.cpp:211
void setStyle(Qt::PenStyle style)
bool isEndSegmentIndex(int index) const
Retval True If segment at index is start or end.
Definition: associationline.cpp:246
qreal snappedX(qreal x)
Returns the input coordinate with possible grid-snap applied.
Definition: umlscene.cpp:3402
QPointF scenePos() const
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Reset active indices and also push undo command.
Definition: associationline.cpp:1080
QDomNode appendChild(const QDomNode &newChild)
Definition: basictypes.h:117
bool loadFromXMI(QDomElement &qElement)
Loads AssociationLine information saved in qElement XMI element.
Definition: associationline.cpp:295
QString attribute(const QString &name, const QString &defValue) const
void moveBy(qreal dx, qreal dy)
Definition: associationline.h:113
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Draws the current symbol using the QPainterPath stored for the current symbol.
Definition: associationline.cpp:1302
void setPen(const QPen &pen)
Sets the pen used to draw the symbol.
Definition: associationline.cpp:1380
Definition: basictypes.h:116
bool contains(const QPointF &point) const
Definition: basictypes.h:216
UMLScene * umlScene() const
Deliver a pointer to the connected UMLView (needed esp.
Definition: widgetbase.cpp:107
bool isSelf() const
Returns true if this AssociationWidget represents a self message.
Definition: associationwidget.cpp:1438
T & last()
void insert(int i, const T &value)
virtual const QMetaObject * metaObject() const
Definition: basictypes.h:115
void cubicTo(const QPointF &c1, const QPointF &c2, const QPointF &endPoint)
void setAlpha(int alpha)
void moveTo(const QPointF &point)
qreal top() const
Definition: associationline.h:47
QPointF scenePos() const
T & first()
Definition: associationline.h:46
qreal angleTo(const QLineF &line) const
int closestPointIndex(const QPointF &point, qreal delta=Delta) const
Return index of point closer a given delta.
Definition: associationline.cpp:185
void drawLine(const QLineF &line)
void setRed(int red)
QGraphicsScene * scene() const
QRectF boundingRect() const
The points are used for the bounding rect.
Definition: associationline.cpp:724
Definition: associationline.h:112
Definition: associationline.h:49
qreal left() const
Definition: associationline.h:48
void adjust(qreal dx1, qreal dy1, qreal dx2, qreal dy2)
void update(const QRectF &rect)
void hoverMoveEvent(QGraphicsSceneHoverEvent *event)
Calculates the "to be highlighted" point and segment indicies and updates if necessary.
Definition: associationline.cpp:1116
Definition: basictypes.h:104
virtual int type() const
void setHeight(qreal height)
QDomNode nextSibling() const
Definition: associationline.h:43
This class represents an association inside a diagram.
Definition: associationwidget.h:50
#define ENUM_NAME(o, e, v)
In a Q_OBJECT class define any enum as Q_ENUMS.
Definition: debug_utils.h:125
QDomElement toElement() const
qreal bottom() const
void drawRect(const QRectF &rectangle)
void calculateInitialEndPoints()
This method simply ensures presence of two points and adds the needed points for self associations...
Definition: associationline.cpp:413
QColor color() const
void clear()
A convenience class that encapsulates geometry management, handles mouse and hover events...
Definition: associationline.h:105
qreal x() const
qreal y() const
QPointF p1() const
QPointF p2() const
void addPolygon(const QPolygonF &polygon)
QLineF normalVector() const
void setBrush(const QBrush &brush)
Sets the brush used to fill symbol.
Definition: associationline.cpp:1399
int red() const
void setPen(const QColor &color)
void drawEllipse(const QRectF &rectangle)
void lineTo(const QPointF &endPoint)
void setAttribute(const QString &name, const QString &value)
static LayoutType fromString(const QString &layout)
Convert string to enum LayoutType.
Definition: associationline.cpp:755
QPointF topLeft() const
SymbolType
This enumeration lists all the symbols that can be used as embedded on AssociationLine.
Definition: associationline.h:41
QList< QPolygonF > toSubpathPolygons(const QMatrix &matrix) const
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Reimplemented from QGraphicsItem::paint.
Definition: associationline.cpp:900
void addRect(const QRectF &rectangle)
void remove(int i)
QLineF unitVector() const
UMLWidget * widgetAt(const QPointF &p)
Tests the given point against all widgets and returns the widget for which the point is within its bo...
Definition: umlscene.cpp:1007
void setLine(const QLineF &line)
Definition: associationline.h:42
QPointF mapFromScene(const QPointF &point) const
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Moves the point or line if active.
Definition: associationline.cpp:1029
void optimizeLinePoints()
This method optimizes the number of points in the AssociationLine.
Definition: associationline.cpp:161
void removePoint(int index)
Removes the point at index passed in.
Definition: associationline.cpp:125
bool setEndPoints(const QPointF &start, const QPointF &end)
Sets the start and end points.
Definition: associationline.cpp:258
void setBrush(const QBrush &brush)
QLineF translated(const QPointF &offset) const
QPainterPath createStroke(const QPainterPath &path) const
QPointF center() const
QPointF topRight() const
Symbol(SymbolType symbolType, QGraphicsItem *parent=0)
Constructs a Symbol with current symbol being symbol and parented to parent.
Definition: associationline.cpp:1266
void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Saves association line information into XMI element named "linepath".
Definition: associationline.cpp:348
void setLayout(LayoutType layout)
Set the layout type of the association line.
Definition: associationline.cpp:779
T & first()
QPointF pointAtPercent(qreal t) const
void setColor(const QColor &color)
void alignTo(const QLineF &line)
This method aligns this Symbol to the line being passed.
Definition: associationline.cpp:1347
QRectF rect() const
return drawing rectangle of widget in local coordinates
Definition: widgetbase.cpp:611
void prepareGeometryChange()
void setPen(const QPen &pen)
void moveCenter(const QPointF &position)
int green() const
qreal right() const
QColor lighter(int factor) const
bool isNull() const
void cleanup()
Removes all the points and signals a geometry update.
Definition: associationline.cpp:145
int blue() const
const T & at(int i) const
bool isEnabled() const
void insertPoint(int index, const QPointF &point)
Inserts the passed in point at the index passed in and recalculates the bounding rect.
Definition: associationline.cpp:114
void reconstructSymbols()
This method creates, deletes symbols and collaboration lines based on m_associationWidget->associatio...
Definition: associationline.cpp:452
QDomNode firstChild() const
QRectF boundingRect() const
QPointF mapToScene(const QPointF &point) const
qreal width() const
void setSymbolType(SymbolType symbolType)
Sets the current symbol type to symbol and updates the geometry.
Definition: associationline.cpp:1292
void drawPath(const QPainterPath &path)
QPen pen() const
Returns the type of pen to use depending on the type of Association.
Definition: associationline.cpp:393
QPointF point(int index) const
Returns the point at the point index.
Definition: associationline.cpp:67
Definition: basictypes.h:118
bool isEmpty() const
void setWidth(qreal width)
void mousePressEvent(QGraphicsSceneMouseEvent *event)
Determines the active point or segment, the latter being given more priority.
Definition: associationline.cpp:1005
Qt::MouseButtons buttons() const
float toFloat(bool *ok) const
void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Calculates the "to be highlighted" point and segment indicies and updates if necessary.
Definition: associationline.cpp:1092
void setCapStyle(Qt::PenCapStyle style)
void setX(qreal x)
void setY(qreal y)
T & last()
This class provides with various symbols that can be embedded in AssociationLine. ...
Definition: associationline.h:32
Definition: associationline.h:45
QPointF bottomLeft() const
int count(const T &value) const
qreal widthF() const
QString fromLatin1(const char *str, int size)
Definition: widgetbase.h:54
bool isEndPointIndex(int index) const
Retval True If point at index is start or end.
Definition: associationline.cpp:235
qreal snappedY(qreal y)
Returns the input coordinate with possible grid-snap applied.
Definition: umlscene.cpp:3420
bool setPoint(int index, const QPointF &point)
Sets the point value at given index to point.
Definition: associationline.cpp:79
QString tagName() const
Definition: associationline.h:114
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Reset active indicies and updates.
Definition: associationline.cpp:1138
QPointF bottomRight() const
QDomElement createElement(const QString &tagName)
void quadTo(const QPointF &c, const QPointF &endPoint)
QBrush brush() const
Returns the type of brush to use depending on the type of Association.
Definition: associationline.cpp:375
int size() const
UMLWidget * widgetForRole(Uml::RoleType::Enum role) const
Gets the given role widget.
Definition: associationwidget.cpp:1254
void setColor(const QColor &color)
void setP1(const QPointF &p1)
void setP2(const QPointF &p2)
LayoutType layout() const
Return the layout type of the association line.
Definition: associationline.cpp:770
void rotate(qreal angle)
Uml::AssociationType::Enum associationType() const
Gets the association's type.
Definition: associationwidget.cpp:1448
void moveTo(qreal x, qreal y)
void setLength(qreal length)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.