LinePath Class Reference
#include <linepath.h>
Public Types | |
| enum | Region { TopBottom, LeftRight } |
| Enum to tell whether the line docks top/bottom or left/right. More... | |
Public Slots | |
| void | slotLineColorChanged (Uml::IDType viewID) |
| Sets the line color used by the line. | |
| void | slotLineWidthChanged (Uml::IDType viewID) |
| Sets the line width used by the line. | |
Public Member Functions | |
| LinePath () | |
| Constructor. | |
| ~LinePath () | |
| Deconstructor. | |
| bool | operator== (LinePath &rhs) |
| equal to (==) operator | |
| LinePath & | operator= (LinePath &rhs) |
| copy ( = ) operator | |
| void | setDockRegion (Region region) |
| Tell the line where the line docks. | |
| bool | hasPoints () |
| void | dumpPoints () |
| QPoint | getPoint (int pointIndex) |
| Returns the point at the point index. | |
| bool | setPoint (int pointIndex, const QPoint &point) |
| Sets the position of an already set point. | |
| bool | isPoint (int pointIndex, const QPoint &point, unsigned short delta=0) |
| Checks, if we are at an end of the segment or somewhere in the middle. | |
| bool | insertPoint (int pointIndex, const QPoint &point) |
| Inserts a point at the given index. | |
| bool | removePoint (int pointIndex, const QPoint &point, unsigned short delta=0) |
| Removes the point on the line given by the index, at the coordinates given by point with a fuzzy of delta. | |
| bool | setStartEndPoints (const QPoint &start, const QPoint &end) |
| Sets the start and end points. | |
| int | count () |
| Returns the amount of POINTS on the line. | |
| int | onLinePath (const QPoint &position) |
| Returns -1 if the given point is not on the line. | |
| void | setCanvas (QCanvas *canvas) |
| Sets the canvas to be used. | |
| void | setAssocType (Uml::Association_Type type) |
| Sets the Association type. | |
| void | update () |
| Calls a group of methods to update the line. | |
| void | setAssociation (AssociationWidget *association) |
| This will setup the class ready to display the line correctly. | |
| AssociationWidget * | getAssociation () |
| Returns the Association this class is linked to. | |
| void | setSelected (bool select) |
| Sets the status of whether the line is selected or not. | |
| void | saveToXMI (QDomDocument &qDoc, QDomElement &qElement) |
| bool | loadFromXMI (QDomElement &qElement) |
| void | activate () |
| Activates the line list. | |
| void | cleanup () |
| Removes and item created that are no longer needed. | |
| QPen | getPen () |
| Returns the type of pen to use depending on the type of Association. | |
| void | setLineColor (const QColor &color) |
| Sets the line color used by the line. | |
| void | setLineWidth (uint width) |
| Sets the line width used by the line. | |
Protected Member Functions | |
| QCanvas * | getCanvas () |
| Returns the canvas being used. | |
| Uml::Association_Type | getAssocType () |
| Returns the Association type. | |
| QColor | getLineColor () |
| Returns the Line Color to use. | |
| uint | getLineWidth () |
| Returns the Line Width to use. | |
| void | moveSelected (int pointIndex) |
| Moves the selected canvas widgets. | |
| void | setupSelected () |
| Sets up the selected canvases needed. | |
| void | calculateHead () |
| Calculates the head points. | |
| void | createHeadLines () |
| Creates the head lines to display the head. | |
| void | growList (LineList &list, int by) |
| Create a number of new lines and append them to the given list. | |
| void | updateHead () |
| Updates the head lines. | |
| void | setupParallelLine () |
| Creates the line objects to display the parallel line. | |
| void | calculateParallelLine () |
| Calculates the position of the parallel line. | |
| void | updateParallelLine () |
| Updates the parallel line. | |
Protected Attributes | |
| AssociationWidget * | m_pAssociation |
| The association we are representing. | |
| LineList | m_LineList |
| Contains all the lines of the association. | |
| RectList | m_RectList |
| Selected boxes list. | |
| LineList | m_HeadList |
| Head lines. | |
| LineList | m_ParallelList |
| The parallel line. | |
| bool | m_bSelected |
| Selected status. | |
| QPointArray | m_PointArray |
| Contains calculated points used to draw the line head. | |
| QPoint | m_ArrowPointA |
| Contains calculated points used to draw the line head. | |
| QPoint | m_ArrowPointB |
| Contains calculated points used to draw the line head. | |
| QPoint | m_MidPoint |
| Contains calculated points used to draw the line head. | |
| QPoint | m_EgdePoint |
| Contains calculated points used to draw the line head. | |
| QCanvasPolygon * | m_pClearPoly |
| A polygon object to blank out any lines we don't want to see. | |
| Circle * | m_pCircle |
| The transparent circle required by containment associations. | |
| QPointArray | m_ParallelLines |
| Contains the calculated points for the parallel line on a collaboration message to use. | |
| Region | m_DockRegion |
| Region where the line docks. | |
| bool | m_bHeadCreated |
| bool | m_bParallelLineCreated |
Classes | |
| class | Circle |
| Draw a (hollow) circle. More... | |
Detailed Description
- Author:
- Paul Hensgen Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
Definition at line 45 of file linepath.h.
Member Enumeration Documentation
|
|
Enum to tell whether the line docks top/bottom or left/right.
Definition at line 71 of file linepath.h. |
Constructor & Destructor Documentation
|
|
Constructor.
Definition at line 61 of file linepath.cpp. References m_bSelected, m_DockRegion, m_HeadList, m_LineList, m_ParallelLines, m_ParallelList, m_pAssociation, m_pCircle, m_pClearPoly, m_PointArray, and m_RectList. |
|
|
Deconstructor.
Definition at line 77 of file linepath.cpp. |
Member Function Documentation
|
|
equal to (==) operator
Definition at line 767 of file linepath.cpp. References getPoint(), and m_LineList. |
|
|
copy ( = ) operator
Definition at line 779 of file linepath.cpp. References count(), insertPoint(), m_HeadList, m_LineList, m_ParallelList, m_RectList, setAssocType(), and setStartEndPoints(). |
|
|
Tell the line where the line docks.
Definition at line 855 of file linepath.cpp. References m_DockRegion. |
|
|
Returns the point at the point index.
Definition at line 92 of file linepath.cpp. References count(), and m_LineList. Referenced by AssociationWidget::calculateEndingPoints(), calculateHead(), AssociationWidget::calculateNameTextSegment(), calculateParallelLine(), AssociationWidget::computeAssocClassLine(), AssociationWidget::constrainTextPos(), AssociationWidget::getAssocLineRectangle(), AssociationWidget::loadFromXMI(), AssociationWidget::mouseDoubleClickEvent(), AssociationWidget::mouseMoveEvent(), AssociationWidget::mouseReleaseEvent(), AssociationWidget::moveMidPointsBy(), operator==(), and AssociationWidget::widgetMoved(). |
|
||||||||||||
|
Sets the position of an already set point.
Definition at line 105 of file linepath.cpp. References count(), m_LineList, moveSelected(), and update(). Referenced by AssociationWidget::moveMidPointsBy(), setStartEndPoints(), and AssociationWidget::widgetMoved(). |
|
||||||||||||||||
|
Checks, if we are at an end of the segment or somewhere in the middle. We use the delta, because with the mouse it is hard to find the exactly point. Definition at line 137 of file linepath.cpp. References count(), and m_LineList. Referenced by AssociationWidget::mouseDoubleClickEvent(). |
|
||||||||||||
|
Inserts a point at the given index.
Definition at line 160 of file linepath.cpp. References count(), getCanvas(), UMLApp::getDocument(), getPen(), UMLDoc::loading(), m_LineList, and setupSelected(). Referenced by AssociationWidget::calculateEndingPoints(), AssociationWidget::mouseDoubleClickEvent(), AssociationWidget::mouseMoveEvent(), and operator=(). |
|
||||||||||||||||
|
Removes the point on the line given by the index, at the coordinates given by point with a fuzzy of delta.
Definition at line 211 of file linepath.cpp. References count(), and m_LineList. Referenced by AssociationWidget::mouseDoubleClickEvent(), and AssociationWidget::mouseReleaseEvent(). |
|
||||||||||||
|
Sets the start and end points.
Definition at line 268 of file linepath.cpp. References count(), getCanvas(), getPen(), m_LineList, and setPoint(). Referenced by AssociationWidget::calculateEndingPoints(), and operator=(). |
|
|
Returns the amount of POINTS on the line. Includes start and end points. Definition at line 286 of file linepath.cpp. References m_LineList. Referenced by AssociationWidget::calculateEndingPoints(), AssociationWidget::calculateNameTextSegment(), calculateParallelLine(), AssociationWidget::constrainTextPos(), AssociationWidget::getAssocLineRectangle(), getPoint(), insertPoint(), isPoint(), AssociationWidget::mouseDoubleClickEvent(), AssociationWidget::mouseReleaseEvent(), AssociationWidget::moveMidPointsBy(), operator=(), removePoint(), setPoint(), setStartEndPoints(), updateHead(), and AssociationWidget::widgetMoved(). |
|
|
Returns -1 if the given point is not on the line. else returns the line segment the point is on. Use the value to insert points at the point position. Definition at line 290 of file linepath.cpp. References getCanvas(), and m_LineList. Referenced by AssociationWidget::mouseDoubleClickEvent(), AssociationWidget::mouseMoveEvent(), and AssociationWidget::onAssociation(). |
|
|
Sets the canvas to be used.
Referenced by activate(). |
|
|
Sets the Association type.
Definition at line 309 of file linepath.cpp. References createHeadLines(), getPen(), m_LineList, m_pClearPoly, setupParallelLine(), and update(). Referenced by AssociationWidget::activate(), operator=(), and AssociationWidget::setAssocType(). |
|
|
Calls a group of methods to update the line. Used to save you calling multiple methods. Definition at line 327 of file linepath.cpp. References calculateHead(), calculateParallelLine(), createHeadLines(), getAssocType(), setupParallelLine(), updateHead(), and updateParallelLine(). Referenced by AssociationWidget::mouseDoubleClickEvent(), setAssocType(), setPoint(), and setupSelected(). |
|
|
This will setup the class ready to display the line correctly. This MUST be called before you can use this class. Definition at line 79 of file linepath.cpp. References cleanup(), createHeadLines(), getAssocType(), m_pAssociation, setupParallelLine(), slotLineColorChanged(), and slotLineWidthChanged(). |
|
|
Returns the Association this class is linked to.
Definition at line 153 of file linepath.h. References m_pAssociation. |
|
|
Sets the status of whether the line is selected or not.
Definition at line 302 of file linepath.cpp. References m_RectList, and setupSelected(). Referenced by AssociationWidget::mouseDoubleClickEvent(), and AssociationWidget::setSelected(). |
|
|
Activates the line list. This is needed because the m_pAssociation does not yet exist at the time of the LinePath::loadFromXMI call. However, this means that the points in the m_LineList do not have a parent when they are loaded. They need to be reparented by calling LinePath::activate() once the m_pAssociation exists. Definition at line 937 of file linepath.cpp. References getCanvas(), getPen(), m_LineList, and setCanvas(). Referenced by AssociationWidget::activate(). |
|
|
Removes and item created that are no longer needed.
Definition at line 831 of file linepath.cpp. References m_HeadList, m_LineList, m_ParallelList, m_pAssociation, m_pCircle, m_pClearPoly, m_RectList, slotLineColorChanged(), and slotLineWidthChanged(). Referenced by AssociationWidget::cleanup(), and setAssociation(). |
|
|
Returns the type of pen to use depending on the type of Association.
Definition at line 463 of file linepath.cpp. References getAssocType(), getLineColor(), and getLineWidth(). Referenced by activate(), AssociationWidget::getAssocLineRectangle(), insertPoint(), setAssocType(), and setStartEndPoints(). |
|
|
Sets the line color used by the line.
Definition at line 350 of file linepath.cpp. References getAssocType(), m_HeadList, m_LineList, m_ParallelList, m_pCircle, and m_pClearPoly. Referenced by AssociationWidget::setLineColor(), and slotLineColorChanged(). |
|
|
Sets the line width used by the line.
Definition at line 390 of file linepath.cpp. References m_HeadList, m_LineList, m_ParallelList, and m_pCircle. Referenced by AssociationWidget::setLineWidth(), and slotLineWidthChanged(). |
|
|
Returns the canvas being used. Will return zero if the Association hasn't been set. This class doesn't hold this information but is a wrapper method to stop calls to undefined variable like m_pAssociation. Definition at line 799 of file linepath.cpp. References WidgetBase::getUMLView(), and m_pAssociation. Referenced by activate(), createHeadLines(), growList(), insertPoint(), onLinePath(), and setStartEndPoints(). |
|
|
Returns the Association type. Returns Uml::at_Association if association hasn't been set. This class doesn't hold this information but is a wrapper method to stop calls to undefined variable like m_pAssociation. Definition at line 806 of file linepath.cpp. References m_pAssociation. Referenced by calculateHead(), createHeadLines(), getPen(), setAssociation(), setLineColor(), update(), and updateHead(). |
|
|
Returns the Line Color to use. Returns black if association not set. This class doesn't hold this information but is a wrapper method to stop calls to undefined variable like m_pAssociation. Definition at line 812 of file linepath.cpp. References m_pAssociation. Referenced by createHeadLines(), getPen(), and growList(). |
|
|
Returns the Line Width to use. Returns 0 if association not set. This class doesn't hold this information but is a wrapper method to stop calls to undefined variable like m_pAssociation. Definition at line 818 of file linepath.cpp. References m_pAssociation. Referenced by createHeadLines(), getPen(), and growList(). |
|
|
Moves the selected canvas widgets.
Definition at line 418 of file linepath.cpp. References m_bSelected, m_LineList, m_RectList, and setupSelected(). Referenced by setPoint(). |
|
|
Sets up the selected canvases needed.
Definition at line 445 of file linepath.cpp. References m_LineList, m_RectList, and update(). Referenced by insertPoint(), moveSelected(), and setSelected(). |
|
|
Calculates the head points.
Definition at line 470 of file linepath.cpp. References getAssocType(), getPoint(), m_ArrowPointA, m_ArrowPointB, m_EgdePoint, m_LineList, m_MidPoint, m_PointArray, LinePath::Circle::setX(), and LinePath::Circle::setY(). Referenced by update(). |
|
|
Creates the head lines to display the head.
Definition at line 648 of file linepath.cpp. References getAssocType(), getCanvas(), getLineColor(), getLineWidth(), growList(), m_HeadList, m_pCircle, and m_pClearPoly. Referenced by setAssociation(), setAssocType(), and update(). |
|
||||||||||||
|
Create a number of new lines and append them to the given list.
Definition at line 637 of file linepath.cpp. References getCanvas(), getLineColor(), and getLineWidth(). Referenced by createHeadLines(), and setupParallelLine(). |
|
|
Updates the head lines. Call after calculating the new points. Definition at line 552 of file linepath.cpp. References count(), getAssocType(), m_ArrowPointA, m_ArrowPointB, m_DockRegion, m_EgdePoint, m_HeadList, m_MidPoint, m_pCircle, m_pClearPoly, and m_PointArray. Referenced by update(). |
|
|
Creates the line objects to display the parallel line.
Definition at line 743 of file linepath.cpp. References growList(), and m_ParallelList. Referenced by setAssociation(), setAssocType(), and update(). |
|
|
Calculates the position of the parallel line.
Definition at line 695 of file linepath.cpp. References count(), getPoint(), and m_ParallelLines. Referenced by update(). |
|
|
Updates the parallel line. Call after calculating the new position. Definition at line 749 of file linepath.cpp. References m_ParallelLines, and m_ParallelList. Referenced by update(). |
|
|
Sets the line color used by the line.
Definition at line 342 of file linepath.cpp. References UMLView::getID(), UMLView::getLineColor(), WidgetBase::getUMLView(), m_pAssociation, and setLineColor(). Referenced by cleanup(), and setAssociation(). |
|
|
Sets the line width used by the line.
Definition at line 383 of file linepath.cpp. References UMLView::getID(), UMLView::getLineWidth(), WidgetBase::getUMLView(), m_pAssociation, and setLineWidth(). Referenced by cleanup(), and setAssociation(). |
Member Data Documentation
|
|
The association we are representing.
Definition at line 305 of file linepath.h. Referenced by cleanup(), getAssociation(), getAssocType(), getCanvas(), getLineColor(), getLineWidth(), LinePath(), setAssociation(), slotLineColorChanged(), and slotLineWidthChanged(). |
|
|
Contains all the lines of the association.
Definition at line 310 of file linepath.h. Referenced by activate(), calculateHead(), cleanup(), count(), getPoint(), insertPoint(), isPoint(), LinePath(), moveSelected(), onLinePath(), operator=(), operator==(), removePoint(), setAssocType(), setLineColor(), setLineWidth(), setPoint(), setStartEndPoints(), and setupSelected(). |
|
|
Selected boxes list.
Definition at line 315 of file linepath.h. Referenced by cleanup(), LinePath(), moveSelected(), operator=(), setSelected(), and setupSelected(). |
|
|
Head lines.
Definition at line 320 of file linepath.h. Referenced by cleanup(), createHeadLines(), LinePath(), operator=(), setLineColor(), setLineWidth(), and updateHead(). |
|
|
The parallel line.
Definition at line 325 of file linepath.h. Referenced by cleanup(), LinePath(), operator=(), setLineColor(), setLineWidth(), setupParallelLine(), and updateParallelLine(). |
|
|
Selected status.
Definition at line 330 of file linepath.h. Referenced by LinePath(), and moveSelected(). |
|
|
Contains calculated points used to draw the line head.
Definition at line 335 of file linepath.h. Referenced by calculateHead(), LinePath(), and updateHead(). |
|
|
Contains calculated points used to draw the line head.
Definition at line 340 of file linepath.h. Referenced by calculateHead(), and updateHead(). |
|
|
Contains calculated points used to draw the line head.
Definition at line 340 of file linepath.h. Referenced by calculateHead(), and updateHead(). |
|
|
Contains calculated points used to draw the line head.
Definition at line 340 of file linepath.h. Referenced by calculateHead(), and updateHead(). |
|
|
Contains calculated points used to draw the line head.
Definition at line 340 of file linepath.h. Referenced by calculateHead(), and updateHead(). |
|
|
A polygon object to blank out any lines we don't want to see.
Definition at line 345 of file linepath.h. Referenced by cleanup(), createHeadLines(), LinePath(), setAssocType(), setLineColor(), and updateHead(). |
|
|
The transparent circle required by containment associations.
Definition at line 350 of file linepath.h. Referenced by cleanup(), createHeadLines(), LinePath(), setLineColor(), setLineWidth(), and updateHead(). |
|
|
Contains the calculated points for the parallel line on a collaboration message to use.
Definition at line 356 of file linepath.h. Referenced by calculateParallelLine(), LinePath(), and updateParallelLine(). |
|
|
Region where the line docks.
Definition at line 361 of file linepath.h. Referenced by LinePath(), setDockRegion(), and updateHead(). |
The documentation for this class was generated from the following files:
