umbrello/umbrello
#include <umlscene.h>
Public Slots | |
void | alignBottom () |
void | alignHorizontalDistribute () |
void | alignHorizontalMiddle () |
void | alignLeft () |
void | alignRight () |
void | alignTop () |
void | alignVerticalDistribute () |
void | alignVerticalMiddle () |
void | slotActivate () |
void | slotCutSuccessful () |
void | slotMenuSelection (QAction *action) |
void | slotObjectCreated (UMLObject *o) |
void | slotObjectRemoved (UMLObject *o) |
void | slotShowView () |
void | slotToolBarChanged (int c) |
Signals | |
void | sigAssociationRemoved (AssociationWidget *) |
void | sigClearAllSelected () |
void | sigFillColorChanged (Uml::ID::Type) |
void | sigGridColorChanged (Uml::ID::Type) |
void | sigLineColorChanged (Uml::ID::Type) |
void | sigLineWidthChanged (Uml::ID::Type) |
void | sigResetToolBar () |
void | sigShowGridToggled (bool) |
void | sigSnapComponentSizeToGridToggled (bool) |
void | sigSnapToGridToggled (bool) |
void | sigTextColorChanged (Uml::ID::Type) |
void | sigWidgetRemoved (UMLWidget *) |
Public Member Functions | |
UMLScene (UMLFolder *parentFolder, UMLView *view=0) | |
virtual | ~UMLScene () |
void | activate () |
void | activateAfterLoad (bool bUseLog=false) |
UMLView * | activeView () const |
bool | addAssociation (AssociationWidget *pAssoc, bool isPasteOperation=false) |
void | addObject (UMLObject *object) |
bool | addWidget (UMLWidget *pWidget, bool isPasteOperation=false) |
void | applyLayout (const QString &actionText) |
AssociationWidget * | associationAt (const QPointF &p) |
AssociationWidgetList & | associationList () |
bool | autoIncrementSequence () const |
QString | autoIncrementSequenceValue (int increment=0) const |
void | beginPartialWidgetPaste () |
void | checkMessages (ObjectWidget *w) |
void | checkSelections () |
bool | checkUniqueSelection () |
void | clearDiagram () |
void | clearSelected () |
UMLSceneItemList | collisions (const QPointF &p, int delta=3) |
void | copyAsImage (QPixmap *&pix) |
void | createAutoAssociations (UMLWidget *widget) |
void | createAutoAttributeAssociations (UMLWidget *widget) |
void | createAutoConstraintAssociations (UMLWidget *widget) |
void | deleteSelection () |
QString | documentation () const |
void | endPartialWidgetPaste () |
void | fileLoaded () |
const QColor & | fillColor () const |
AssociationWidget * | findAssocWidget (Uml::ID::Type id) |
AssociationWidget * | findAssocWidget (Uml::AssociationType::Enum at, UMLWidget *pWidgetA, UMLWidget *pWidgetB) |
AssociationWidget * | findAssocWidget (UMLWidget *pWidgetA, UMLWidget *pWidgetB, const QString &roleNameB) |
UMLWidget * | findWidget (Uml::ID::Type id) |
UMLFolder * | folder () const |
QFont | font () const |
int | generateCollaborationId () |
bool | getCreateObject () const |
void | getDiagram (QPixmap &diagram, const QRectF &rect) |
void | getDiagram (QPainter &painter, const QRectF &source, const QRectF &target=QRectF()) |
UMLWidget * | getFirstMultiSelectedWidget () const |
UMLViewImageExporter * | getImageExporter () |
bool | getPaste () const |
QPointF | getPastePoint () |
void | getWidgetAssocs (UMLObject *Obj, AssociationWidgetList &Associations) |
const QColor & | gridDotColor () const |
void | hideEvent (QHideEvent *he) |
Uml::ID::Type | ID () const |
bool | isOpen () const |
bool | isSavedInSeparateFile () |
bool | isShowDocumentationIndicator () const |
bool | isSnapGridVisible () const |
const QColor & | lineColor () const |
uint | lineWidth () const |
virtual bool | loadFromXMI (QDomElement &qElement) |
bool | loadUISDiagram (QDomElement &qElement) |
UMLWidget * | loadWidgetFromXMI (QDomElement &widgetElement) |
Uml::ID::Type | localID () |
MessageWidget * | messageAt (const QPointF &p) |
MessageWidgetList & | messageList () |
void | moveSelectedBy (qreal dX, qreal dY) |
QString | name () const |
ObjectWidget * | onWidgetDestructionBox (const QPointF &point) const |
ObjectWidget * | onWidgetLine (const QPointF &point) const |
const Settings::OptionState & | optionState () const |
QPointF | pos () const |
void | print (QPrinter *pPrinter, QPainter &pPainter) |
void | removeAllAssociations () |
void | removeAllWidgets () |
void | removeAssoc (AssociationWidget *pAssoc) |
void | removeAssociations (UMLWidget *pWidget) |
void | removeAssocInViewAndDoc (AssociationWidget *assoc) |
void | removeWidget (UMLWidget *o) |
void | resetPastePoint () |
void | resetToolbar () |
void | resizeSceneToItems () |
void | resizeSelection () |
virtual void | saveToXMI (QDomDocument &qDoc, QDomElement &qElement) |
void | selectAll () |
void | selectAssociations (bool bSelect) |
AssociationWidgetList | selectedAssocs () |
int | selectedCount (bool filterText=false) const |
UMLWidgetList | selectedWidgets () const |
UMLWidgetList | selectedWidgetsExt (bool filterText=true) |
void | selectionSetFillColor (const QColor &color) |
void | selectionSetFont (const QFont &font) |
void | selectionSetLineColor (const QColor &color) |
void | selectionSetLineWidth (uint width) |
void | selectionToggleShow (int sel) |
void | selectionUseFillColor (bool useFC) |
void | selectWidgets (qreal px, qreal py, qreal qx, qreal qy) |
void | selectWidgets (UMLWidgetList &widgets) |
void | selectWidgetsOfAssoc (AssociationWidget *a) |
void | setAutoIncrementSequence (bool state) |
void | setAutoIncrementSequenceValue (const QString &value) |
void | setClassWidgetOptions (ClassOptionsPage *page) |
void | setCreateObject (bool bCreate) |
void | setDocumentation (const QString &doc) |
void | setFillColor (const QColor &color) |
void | setFolder (UMLFolder *folder) |
void | setFont (QFont font, bool changeAllWidgets=false) |
void | setGridDotColor (const QColor &color) |
void | setID (Uml::ID::Type id) |
void | setIsOpen (bool isOpen) |
void | setLineColor (const QColor &color) |
void | setLineWidth (uint width) |
void | setMenu (const QPoint &pos) |
void | setName (const QString &name) |
void | setOptionState (const Settings::OptionState &options) |
void | setPaste (bool paste) |
void | setPos (const QPointF &pos) |
void | setSelected (UMLWidget *w, QGraphicsSceneMouseEvent *me) |
void | setShowDocumentationIndicator (bool bShow) |
void | setShowOpSig (bool bShowOpSig) |
void | setSnapComponentSizeToGrid (bool bSnap) |
void | setSnapGridVisible (bool bShow) |
void | setSnapSpacing (int x, int y) |
void | setSnapToGrid (bool bSnap) |
void | setStartedCut () |
void | setTextColor (const QColor &color) |
void | setType (Uml::DiagramType::Enum type) |
void | setupNewWidget (UMLWidget *w) |
void | setUseFillColor (bool ufc) |
void | showEvent (QShowEvent *se) |
bool | showOpSig () const |
bool | snapComponentSizeToGrid () const |
qreal | snappedX (qreal x) |
qreal | snappedY (qreal y) |
bool | snapToGrid () const |
int | snapX () const |
int | snapY () const |
const QColor & | textColor () const |
void | toggleShowGrid () |
void | toggleSnapComponentSizeToGrid () |
void | toggleSnapToGrid () |
Uml::DiagramType::Enum | type () const |
UMLObjectList | umlObjects () |
void | updateContainment (UMLCanvasObject *self) |
bool | useFillColor () const |
UMLWidget * | widgetAt (const QPointF &p) |
UMLWidgetList & | widgetList () |
bool | widgetOnDiagram (Uml::ID::Type id) |
Protected Member Functions | |
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *contextMenuEvent) |
QRectF | diagramRect () |
void | dragEnterEvent (QGraphicsSceneDragDropEvent *enterEvent) |
void | dragMoveEvent (QGraphicsSceneDragDropEvent *moveEvent) |
virtual void | drawBackground (QPainter *painter, const QRectF &rect) |
void | dropEvent (QGraphicsSceneDragDropEvent *dropEvent) |
void | findMaxBoundingRectangle (const FloatingTextWidget *ft, qreal &px, qreal &py, qreal &qx, qreal &qy) |
void | forceUpdateWidgetFontMetrics (QPainter *painter) |
bool | loadAssociationsFromXMI (QDomElement &qElement) |
bool | loadMessagesFromXMI (QDomElement &qElement) |
bool | loadUisDiagramPresentation (QDomElement &qElement) |
bool | loadWidgetsFromXMI (QDomElement &qElement) |
void | makeSelected (UMLWidget *uw) |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *mouseEvent) |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *mouseEvent) |
void | mousePressEvent (QGraphicsSceneMouseEvent *mouseEvent) |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *mouseEvent) |
void | updateComponentSizes () |
Protected Attributes | |
AssociationWidgetList | m_AssociationList |
bool | m_bCreateObject |
bool | m_bDrawSelectedOnly |
bool | m_bPaste |
bool | m_bStartedCut |
bool | m_bUseSnapComponentSizeToGrid |
bool | m_bUseSnapToGrid |
QString | m_Documentation |
bool | m_isOpen |
MessageWidgetList | m_MessageList |
QString | m_Name |
int | m_nCollaborationId |
Uml::ID::Type | m_nID |
Uml::ID::Type | m_nLocalID |
Settings::OptionState | m_Options |
QPointF | m_Pos |
UMLWidgetList | m_selectedList |
Uml::DiagramType::Enum | m_Type |
UMLWidgetList | m_WidgetList |
Detailed Description
UMLScene instances represent diagrams.
The UMLScene class inherits from QGraphicsScene and it owns the objects displayed (see m_WidgetList.)
Definition at line 70 of file umlscene.h.
Constructor & Destructor Documentation
Constructor.
Definition at line 103 of file umlscene.cpp.
|
virtual |
Destructor.
Definition at line 153 of file umlscene.cpp.
Member Function Documentation
void UMLScene::activate | ( | ) |
Activate all the objects and associations after a load from the clipboard.
Definition at line 1779 of file umlscene.cpp.
void UMLScene::activateAfterLoad | ( | bool | bUseLog = false | ) |
Activate the view after a load a new file.
Definition at line 2210 of file umlscene.cpp.
UMLView * UMLScene::activeView | ( | ) | const |
Returns the active view associated with this scene.
Definition at line 193 of file umlscene.cpp.
bool UMLScene::addAssociation | ( | AssociationWidget * | pAssoc, |
bool | isPasteOperation = false |
||
) |
Adds an association to the view from the given data.
Use this method when pasting.
Definition at line 2119 of file umlscene.cpp.
void UMLScene::addObject | ( | UMLObject * | object | ) |
Add an object to the application, and update the view.
Definition at line 4032 of file umlscene.cpp.
bool UMLScene::addWidget | ( | UMLWidget * | pWidget, |
bool | isPasteOperation = false |
||
) |
Adds a widget to the view from the given data.
Use this method when pasting.
Definition at line 1890 of file umlscene.cpp.
|
slot |
Bottom Alignment.
Definition at line 4231 of file umlscene.cpp.
|
slot |
Horizontal Distribute Alignment.
Definition at line 4335 of file umlscene.cpp.
|
slot |
Horizontal Middle Alignment.
Definition at line 4276 of file umlscene.cpp.
|
slot |
Left Alignment.
Definition at line 4178 of file umlscene.cpp.
|
slot |
Right Alignment.
Definition at line 4196 of file umlscene.cpp.
|
slot |
Top Alignment.
Definition at line 4213 of file umlscene.cpp.
|
slot |
Vertical Distribute Alignment.
Definition at line 4304 of file umlscene.cpp.
|
slot |
Vertical Middle Alignment.
Definition at line 4248 of file umlscene.cpp.
void UMLScene::applyLayout | ( | const QString & | actionText | ) |
Apply an automatic layout.
Definition at line 3507 of file umlscene.cpp.
AssociationWidget * UMLScene::associationAt | ( | const QPointF & | p | ) |
Tests the given point against all associations and returns the association widget for which the point is on the line.
Returns NULL if the point is not inside any association. CHECK: This is the same method as in ToolBarState.
Definition at line 990 of file umlscene.cpp.
AssociationWidgetList & UMLScene::associationList | ( | ) |
Returns a reference to the association list.
Definition at line 416 of file umlscene.cpp.
bool UMLScene::autoIncrementSequence | ( | ) | const |
Return the state of the auto increment sequence.
Definition at line 217 of file umlscene.cpp.
QString UMLScene::autoIncrementSequenceValue | ( | int | increment = 0 | ) | const |
Definition at line 227 of file umlscene.cpp.
void UMLScene::beginPartialWidgetPaste | ( | ) |
Definition at line 2229 of file umlscene.cpp.
void UMLScene::checkMessages | ( | ObjectWidget * | w | ) |
Sees if a message is relevant to the given widget.
If it does delete it.
- Parameters
-
w The widget to check messages against.
Definition at line 1019 of file umlscene.cpp.
void UMLScene::checkSelections | ( | ) |
Call before copying/cutting selected widgets.
This will make sure any associations/message selected will make sure both the widgets widgets they are connected to are selected.
Definition at line 3427 of file umlscene.cpp.
bool UMLScene::checkUniqueSelection | ( | ) |
This function checks if the currently selected items have all the same type (class, interface, ...).
If true, the selection is unique and true will be returned. If there are no items selected, the function will return always true.
Definition at line 3470 of file umlscene.cpp.
void UMLScene::clearDiagram | ( | ) |
Asks for confirmation and clears everything on the diagram.
Called from menus.
Definition at line 3494 of file umlscene.cpp.
void UMLScene::clearSelected | ( | ) |
Clear the selected widgets list.
Definition at line 1291 of file umlscene.cpp.
UMLSceneItemList UMLScene::collisions | ( | const QPointF & | p, |
int | delta = 3 |
||
) |
Definition at line 1551 of file umlscene.cpp.
|
protectedvirtual |
Event handler for context menu events.
Definition at line 2957 of file umlscene.cpp.
void UMLScene::copyAsImage | ( | QPixmap *& | pix | ) |
Returns the PNG picture of the paste operation.
Definition at line 2875 of file umlscene.cpp.
void UMLScene::createAutoAssociations | ( | UMLWidget * | widget | ) |
Creates automatically any Associations that the given UMLWidget may have on any diagram.
This method is used when you just add the UMLWidget to a diagram.
Definition at line 2441 of file umlscene.cpp.
void UMLScene::createAutoAttributeAssociations | ( | UMLWidget * | widget | ) |
If the m_Type of the given widget is WidgetBase::wt_Class then iterate through the class' attributes and create an association to each attribute type widget that is present on the current diagram.
Definition at line 2624 of file umlscene.cpp.
void UMLScene::createAutoConstraintAssociations | ( | UMLWidget * | widget | ) |
Definition at line 2755 of file umlscene.cpp.
void UMLScene::deleteSelection | ( | ) |
Delete the selected widgets list and the widgets in it.
Definition at line 1442 of file umlscene.cpp.
|
protected |
Gets the smallest area to print.
- Returns
- Returns the smallest area to print.
Definition at line 1221 of file umlscene.cpp.
QString UMLScene::documentation | ( | ) | const |
Return the documentation of the diagram.
Definition at line 201 of file umlscene.cpp.
|
protected |
Override standard method.
Definition at line 668 of file umlscene.cpp.
|
protected |
Override standard method.
Definition at line 772 of file umlscene.cpp.
|
protectedvirtual |
Overrides standard method from QGraphicsScene drawing the background.
Definition at line 3736 of file umlscene.cpp.
|
protected |
Override standard method.
Definition at line 780 of file umlscene.cpp.
void UMLScene::endPartialWidgetPaste | ( | ) |
Definition at line 2238 of file umlscene.cpp.
void UMLScene::fileLoaded | ( | ) |
Changes the zoom to the currently set level (now loaded from file) Called from UMLApp::slotUpdateViews()
Definition at line 3691 of file umlscene.cpp.
const QColor & UMLScene::fillColor | ( | ) | const |
Returns the fill color to use.
Definition at line 304 of file umlscene.cpp.
AssociationWidget * UMLScene::findAssocWidget | ( | Uml::ID::Type | id | ) |
Finds an association widget with the given ID.
- Parameters
-
id The ID of the widget to find.
- Returns
- Returns the widget found, returns 0 if no widget found.
Definition at line 1096 of file umlscene.cpp.
AssociationWidget * UMLScene::findAssocWidget | ( | Uml::AssociationType::Enum | at, |
UMLWidget * | pWidgetA, | ||
UMLWidget * | pWidgetB | ||
) |
Finds an association widget with the given type and widgets.
- Parameters
-
at The AssociationType of the widget to find. pWidgetA Pointer to the UMLWidget of role A. pWidgetB Pointer to the UMLWidget of role B.
- Returns
- Returns the widget found, returns 0 if no widget found.
Definition at line 1150 of file umlscene.cpp.
AssociationWidget * UMLScene::findAssocWidget | ( | UMLWidget * | pWidgetA, |
UMLWidget * | pWidgetB, | ||
const QString & | roleNameB | ||
) |
Finds an association widget with the given widgets and the given role B name.
Considers the following association types: at_Association, at_UniAssociation, at_Composition, at_Aggregation This is used for seeking an attribute association.
- Parameters
-
pWidgetA Pointer to the UMLWidget of role A. pWidgetB Pointer to the UMLWidget of role B. roleNameB Name at the B side of the association (the attribute name)
- Returns
- Returns the widget found, returns 0 if no widget found.
Definition at line 1119 of file umlscene.cpp.
|
protected |
Find the maximum bounding rectangle of FloatingTextWidget widgets.
Auxiliary to copyAsImage().
- Parameters
-
ft Pointer to the FloatingTextWidget widget to consider. px X coordinate of lower left corner. This value will be updated if the X coordinate of the lower left corner of ft is smaller than the px value passed in. py Y coordinate of lower left corner. This value will be updated if the Y coordinate of the lower left corner of ft is smaller than the py value passed in. qx X coordinate of upper right corner. This value will be updated if the X coordinate of the upper right corner of ft is larger than the qx value passed in. qy Y coordinate of upper right corner. This value will be updated if the Y coordinate of the upper right corner of ft is larger than the qy value passed in.
Definition at line 2852 of file umlscene.cpp.
UMLWidget * UMLScene::findWidget | ( | Uml::ID::Type | id | ) |
Finds a widget with the given ID.
Search both our UMLWidget AND MessageWidget lists.
- Parameters
-
id The ID of the widget to find.
- Returns
- Returns the widget found, returns 0 if no widget found.
Definition at line 1069 of file umlscene.cpp.
UMLFolder * UMLScene::folder | ( | ) | const |
Return the UMLFolder in which this diagram lives.
Definition at line 177 of file umlscene.cpp.
QFont UMLScene::font | ( | ) | const |
Returns the font to use.
Definition at line 3390 of file umlscene.cpp.
|
protected |
Force the widget font metrics to be updated next time the widgets are drawn.
This is necessary because the widget size might depend on the font metrics and the font metrics might change for different QPainter, i.e. font metrics for Display font and Printer font are usually different. Call this when you change the QPainter.
Definition at line 3726 of file umlscene.cpp.
int UMLScene::generateCollaborationId | ( | ) |
Used for creating unique name of collaboration messages.
Definition at line 440 of file umlscene.cpp.
bool UMLScene::getCreateObject | ( | ) | const |
Return whether we are currently creating an object.
Definition at line 532 of file umlscene.cpp.
void UMLScene::getDiagram | ( | QPixmap & | diagram, |
const QRectF & | rect | ||
) |
Returns the PNG picture of the paste operation.
- Parameters
-
diagram the class to store PNG picture of the paste operation. rect the area of the diagram to copy
Definition at line 1677 of file umlscene.cpp.
void UMLScene::getDiagram | ( | QPainter & | painter, |
const QRectF & | source, | ||
const QRectF & | target = QRectF() |
||
) |
Paint diagram to the paint device.
- Parameters
-
source the area of the diagram to copy target the rect where to paint into
Definition at line 1690 of file umlscene.cpp.
UMLWidget * UMLScene::getFirstMultiSelectedWidget | ( | ) | const |
Return pointer to the first selected widget (for multi-selection)
Definition at line 954 of file umlscene.cpp.
UMLViewImageExporter * UMLScene::getImageExporter | ( | ) |
Returns the imageExporter used to export the view.
- Returns
- The imageExporter used to export the view.
Definition at line 1736 of file umlscene.cpp.
bool UMLScene::getPaste | ( | ) | const |
Returns the status on whether in a paste state.
- Returns
- Returns the status on whether in a paste state.
Definition at line 3033 of file umlscene.cpp.
QPointF UMLScene::getPastePoint | ( | ) |
Returns the offset point at which to place the paste from clipboard.
Just add the amount to your co-ords. Only call this straight after the event, the value won't stay valid. Should only be called by Assoc widgets at the moment. no one else needs it.
Definition at line 3362 of file umlscene.cpp.
void UMLScene::getWidgetAssocs | ( | UMLObject * | Obj, |
AssociationWidgetList & | Associations | ||
) |
Fills Associations with all the associations that includes a widget related to object.
Definition at line 2335 of file umlscene.cpp.
const QColor & UMLScene::gridDotColor | ( | ) | const |
void UMLScene::hideEvent | ( | QHideEvent * | he | ) |
Overrides the standard operation.
Definition at line 561 of file umlscene.cpp.
Uml::ID::Type UMLScene::ID | ( | ) | const |
Returns the ID of the diagram.
Definition at line 272 of file umlscene.cpp.
bool UMLScene::isOpen | ( | ) | const |
Returns the open state.
- Returns
- when true diagram is shown to the user
Definition at line 449 of file umlscene.cpp.
bool UMLScene::isSavedInSeparateFile | ( | ) |
Returns true if this diagram resides in an externalized folder.
CHECK: It is probably cleaner to move this to the UMLListViewItem.
Definition at line 1517 of file umlscene.cpp.
bool UMLScene::isShowDocumentationIndicator | ( | ) | const |
Returns whether to show documentation indicator.
Definition at line 3658 of file umlscene.cpp.
bool UMLScene::isSnapGridVisible | ( | ) | const |
Returns whether to show snap grid or not.
Definition at line 3641 of file umlscene.cpp.
const QColor & UMLScene::lineColor | ( | ) | const |
Returns the line color to use.
Definition at line 323 of file umlscene.cpp.
uint UMLScene::lineWidth | ( | ) | const |
Returns the line width to use.
Definition at line 342 of file umlscene.cpp.
|
protected |
Definition at line 3995 of file umlscene.cpp.
|
virtual |
Loads the "diagram" tag.
Definition at line 3813 of file umlscene.cpp.
|
protected |
Definition at line 3966 of file umlscene.cpp.
bool UMLScene::loadUISDiagram | ( | QDomElement & | qElement | ) |
Loads the "UISDiagram" tag of Unisys.IntegratePlus.2 generated files.
Definition at line 4139 of file umlscene.cpp.
|
protected |
Definition at line 4041 of file umlscene.cpp.
UMLWidget * UMLScene::loadWidgetFromXMI | ( | QDomElement & | widgetElement | ) |
Loads a "widget" element from XMI, used by loadFromXMI() and the clipboard.
Definition at line 3945 of file umlscene.cpp.
|
protected |
Definition at line 3919 of file umlscene.cpp.
Uml::ID::Type UMLScene::localID | ( | ) |
Return a unique ID for the diagram.
Used by the ObjectWidget class.
- Returns
- Return a unique ID for the diagram.
Definition at line 1507 of file umlscene.cpp.
|
protected |
Calls setSelected on the given UMLWidget and enters it into the m_selectedList while making sure it is there only once.
Definition at line 1564 of file umlscene.cpp.
MessageWidget * UMLScene::messageAt | ( | const QPointF & | p | ) |
Tests the given point against all associations and returns the association widget for which the point is on the line.
Returns NULL if the point is not inside any association.
Definition at line 1005 of file umlscene.cpp.
MessageWidgetList & UMLScene::messageList | ( | ) |
Returns a reference to the message list.
Definition at line 432 of file umlscene.cpp.
|
protected |
Override standard method.
Calls the same method in the current tool bar state.
Definition at line 879 of file umlscene.cpp.
|
protected |
Overrides the standard operation.
Calls the same method in the current tool bar state.
Definition at line 828 of file umlscene.cpp.
|
protected |
Override standard method.
Calls the same method in the current tool bar state.
Definition at line 837 of file umlscene.cpp.
|
protected |
Overrides the standard operation.
Calls the same method in the current tool bar state.
Definition at line 896 of file umlscene.cpp.
void UMLScene::moveSelectedBy | ( | qreal | dX, |
qreal | dY | ||
) |
Move all the selected widgets by a relative X and Y offset.
TODO: Only used in UMLApp::handleCursorKeyReleaseEvent
- Parameters
-
dX The distance to move horizontally. dY The distance to move vertically.
Definition at line 1305 of file umlscene.cpp.
QString UMLScene::name | ( | ) | const |
Return the name of the diagram.
Definition at line 240 of file umlscene.cpp.
ObjectWidget * UMLScene::onWidgetDestructionBox | ( | const QPointF & | point | ) | const |
Determine whether on a sequence diagram we have clicked on the destruction box of an Object.
- Returns
- The widget thats destruction box was clicked on. Returns 0 if no destruction box was clicked on.
Definition at line 933 of file umlscene.cpp.
ObjectWidget * UMLScene::onWidgetLine | ( | const QPointF & | point | ) | const |
Determine whether on a sequence diagram we have clicked on a line of an Object.
- Returns
- The widget thats line was clicked on. Returns 0 if no line was clicked on.
Definition at line 908 of file umlscene.cpp.
const Settings::OptionState & UMLScene::optionState | ( | ) | const |
Returns the options being used.
Definition at line 400 of file umlscene.cpp.
QPointF UMLScene::pos | ( | ) | const |
Returns the position of the diagram.
Definition at line 288 of file umlscene.cpp.
void UMLScene::print | ( | QPrinter * | pPrinter, |
QPainter & | pPainter | ||
) |
Contains the implementation for printing functionality.
Definition at line 466 of file umlscene.cpp.
void UMLScene::removeAllAssociations | ( | ) |
Removes All the associations of the diagram.
Definition at line 2351 of file umlscene.cpp.
void UMLScene::removeAllWidgets | ( | ) |
Removes All the widgets of the diagram.
Definition at line 2365 of file umlscene.cpp.
void UMLScene::removeAssoc | ( | AssociationWidget * | pAssoc | ) |
Removes a AssociationWidget from a diagram Physically deletes the AssociationWidget passed in.
- Parameters
-
pAssoc Pointer to the AssociationWidget.
Definition at line 2252 of file umlscene.cpp.
void UMLScene::removeAssociations | ( | UMLWidget * | widget | ) |
Removes all the associations related to Widget.
- Parameters
-
widget Pointer to the widget to remove.
Definition at line 2303 of file umlscene.cpp.
void UMLScene::removeAssocInViewAndDoc | ( | AssociationWidget * | assoc | ) |
Removes an AssociationWidget from the association list and removes the corresponding UMLAssociation from the current UMLDoc.
Definition at line 2269 of file umlscene.cpp.
void UMLScene::removeWidget | ( | UMLWidget * | o | ) |
Remove a widget from view.
- Parameters
-
o The widget to remove.
Definition at line 1172 of file umlscene.cpp.
void UMLScene::resetPastePoint | ( | ) |
Reset the paste point.
Definition at line 3373 of file umlscene.cpp.
void UMLScene::resetToolbar | ( | ) |
Reset the toolbar.
Definition at line 2949 of file umlscene.cpp.
void UMLScene::resizeSceneToItems | ( | ) |
Sets the size of the scene to just fit on all the items.
Definition at line 3700 of file umlscene.cpp.
void UMLScene::resizeSelection | ( | ) |
resize selected widgets
Definition at line 1484 of file umlscene.cpp.
|
virtual |
Creates the "diagram" tag and fills it with the contents of the diagram.
Definition at line 3744 of file umlscene.cpp.
void UMLScene::selectAll | ( | ) |
Selects all widgets.
Definition at line 1497 of file umlscene.cpp.
void UMLScene::selectAssociations | ( | bool | bSelect | ) |
Sets each association as selected if the widgets it associates are selected.
- Parameters
-
bSelect True to select, false for unselect
Definition at line 2317 of file umlscene.cpp.
AssociationWidgetList UMLScene::selectedAssocs | ( | ) |
Returns a list with all the selected associations from the diagram.
Definition at line 1875 of file umlscene.cpp.
int UMLScene::selectedCount | ( | bool | filterText = false | ) | const |
Return the amount of widgets selected.
- Parameters
-
filterText When true, do NOT count floating text widgets that belong to other widgets (i.e. only count TextRole::Floating.) Default: Count all widgets.
- Returns
- Number of widgets selected.
Definition at line 1831 of file umlscene.cpp.
UMLWidgetList UMLScene::selectedWidgets | ( | ) | const |
Returns a list of selected widgets.
Definition at line 1283 of file umlscene.cpp.
UMLWidgetList UMLScene::selectedWidgetsExt | ( | bool | filterText = true | ) |
Fills the List with all the selected widgets from the diagram The list can be filled with all the selected widgets, or be filtered to prevent text widgets other than tr_Floating to be append.
- Parameters
-
filterText Don't append the text, unless their role is tr_Floating
- Returns
- The UMLWidgetList to fill.
Definition at line 1856 of file umlscene.cpp.
void UMLScene::selectionSetFillColor | ( | const QColor & | color | ) |
Set the fill color for all the currently selected items.
Definition at line 1372 of file umlscene.cpp.
void UMLScene::selectionSetFont | ( | const QFont & | font | ) |
Set the font for all the currently selected items.
Definition at line 1328 of file umlscene.cpp.
void UMLScene::selectionSetLineColor | ( | const QColor & | color | ) |
Set the line color for all the currently selected items.
Definition at line 1338 of file umlscene.cpp.
void UMLScene::selectionSetLineWidth | ( | uint | width | ) |
Set the line width for all the currently selected items.
Definition at line 1356 of file umlscene.cpp.
void UMLScene::selectionToggleShow | ( | int | sel | ) |
Toggles the show setting sel of all selected items.
Definition at line 1386 of file umlscene.cpp.
void UMLScene::selectionUseFillColor | ( | bool | useFC | ) |
Set the useFillColor variable to all selected widgets.
- Parameters
-
useFC The state to set the widget to.
Definition at line 1318 of file umlscene.cpp.
void UMLScene::selectWidgets | ( | qreal | px, |
qreal | py, | ||
qreal | qx, | ||
qreal | qy | ||
) |
Selects all the widgets within an internally kept rectangle.
Definition at line 1596 of file umlscene.cpp.
void UMLScene::selectWidgets | ( | UMLWidgetList & | widgets | ) |
Selects all the widgets from a list.
Definition at line 1666 of file umlscene.cpp.
void UMLScene::selectWidgetsOfAssoc | ( | AssociationWidget * | a | ) |
Selects all the widgets of the given association widget.
Definition at line 1576 of file umlscene.cpp.
void UMLScene::setAutoIncrementSequence | ( | bool | state | ) |
Definition at line 222 of file umlscene.cpp.
void UMLScene::setAutoIncrementSequenceValue | ( | const QString & | value | ) |
Definition at line 232 of file umlscene.cpp.
void UMLScene::setClassWidgetOptions | ( | ClassOptionsPage * | page | ) |
Sets some options for all the ClassifierWidget on the view.
Definition at line 3411 of file umlscene.cpp.
void UMLScene::setCreateObject | ( | bool | bCreate | ) |
Set whether we are currently creating an object.
Definition at line 540 of file umlscene.cpp.
void UMLScene::setDocumentation | ( | const QString & | doc | ) |
Set the documentation of the diagram.
Definition at line 209 of file umlscene.cpp.
void UMLScene::setFillColor | ( | const QColor & | color | ) |
Set the background color.
- Parameters
-
color The color to use.
Definition at line 314 of file umlscene.cpp.
void UMLScene::setFolder | ( | UMLFolder * | folder | ) |
Set the UMLFolder in which this diagram lives.
Definition at line 185 of file umlscene.cpp.
void UMLScene::setFont | ( | QFont | font, |
bool | changeAllWidgets = false |
||
) |
Sets the font for the view and optionally all the widgets on the view.
Definition at line 3398 of file umlscene.cpp.
void UMLScene::setGridDotColor | ( | const QColor & | color | ) |
void UMLScene::setID | ( | Uml::ID::Type | id | ) |
Sets the ID of the diagram.
Definition at line 280 of file umlscene.cpp.
void UMLScene::setIsOpen | ( | bool | isOpen | ) |
Sets the flag 'isOpen'.
- Parameters
-
isOpen flag indicating that the diagram is shown to the user
Definition at line 458 of file umlscene.cpp.
void UMLScene::setLineColor | ( | const QColor & | color | ) |
void UMLScene::setLineWidth | ( | uint | width | ) |
void UMLScene::setMenu | ( | const QPoint & | pos | ) |
Sets the popup menu to use when clicking on a diagram background (rather than a widget or listView).
Definition at line 2975 of file umlscene.cpp.
void UMLScene::setName | ( | const QString & | name | ) |
Set the name of the diagram.
Definition at line 248 of file umlscene.cpp.
void UMLScene::setOptionState | ( | const Settings::OptionState & | options | ) |
Sets the options to be used.
Definition at line 408 of file umlscene.cpp.
void UMLScene::setPaste | ( | bool | paste | ) |
Sets the status on whether in a paste state.
Definition at line 3041 of file umlscene.cpp.
void UMLScene::setPos | ( | const QPointF & | pos | ) |
Sets the position of the diagram.
Definition at line 296 of file umlscene.cpp.
void UMLScene::setSelected | ( | UMLWidget * | w, |
QGraphicsSceneMouseEvent * | me | ||
) |
Sets a widget to a selected state and adds it to a list of selected widgets.
This method also sets the state of the cut and copy menu entries.
- Parameters
-
w The widget to set to selected. me The mouse event containing the information about the selection.
Definition at line 1262 of file umlscene.cpp.
void UMLScene::setShowDocumentationIndicator | ( | bool | bShow | ) |
sets whether to show documentation indicator.
Definition at line 3666 of file umlscene.cpp.
void UMLScene::setShowOpSig | ( | bool | bShowOpSig | ) |
Sets whether to show operation signatures.
Definition at line 3682 of file umlscene.cpp.
void UMLScene::setSnapComponentSizeToGrid | ( | bool | bSnap | ) |
Sets whether to snap to grid for component size.
Definition at line 3571 of file umlscene.cpp.
void UMLScene::setSnapGridVisible | ( | bool | bShow | ) |
Sets whether to show snap grid.
Definition at line 3649 of file umlscene.cpp.
void UMLScene::setSnapSpacing | ( | int | x, |
int | y | ||
) |
Sets the grid size in x and y.
Definition at line 3597 of file umlscene.cpp.
void UMLScene::setSnapToGrid | ( | bool | bSnap | ) |
Sets whether to snap to grid.
Definition at line 3554 of file umlscene.cpp.
void UMLScene::setStartedCut | ( | ) |
Called by the view or any of its children when they start a cut operation.
Definition at line 3382 of file umlscene.cpp.
void UMLScene::setTextColor | ( | const QColor & | color | ) |
void UMLScene::setType | ( | Uml::DiagramType::Enum | type | ) |
Set the type of diagram.
Definition at line 264 of file umlscene.cpp.
void UMLScene::setupNewWidget | ( | UMLWidget * | w | ) |
Initialize and announce a newly created widget.
Auxiliary to contentsMouseReleaseEvent().
Definition at line 512 of file umlscene.cpp.
void UMLScene::setUseFillColor | ( | bool | ufc | ) |
Sets whether to use the fill/background color.
Definition at line 1211 of file umlscene.cpp.
void UMLScene::showEvent | ( | QShowEvent * | se | ) |
Overrides the standard operation.
Definition at line 548 of file umlscene.cpp.
bool UMLScene::showOpSig | ( | ) | const |
Returns whether to show operation signatures.
Definition at line 3674 of file umlscene.cpp.
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
slot |
makes this view the active view by asking the document to show us
Definition at line 1744 of file umlscene.cpp.
|
slot |
Connects to the signal that UMLApp emits when a cut operation is successful.
If the view or a child started the operation the flag m_bStartedCut will be set and we can carry out any operation that is needed, like deleting the selected widgets for the cut operation.
Definition at line 3340 of file umlscene.cpp.
|
slot |
When a menu selection has been made on the menu that this view created, this method gets called.
Definition at line 3050 of file umlscene.cpp.
|
slot |
Slot called when an object is created.
- Parameters
-
o created UML object
Definition at line 587 of file umlscene.cpp.
|
slot |
Slot called when an object is removed.
- Parameters
-
o removed UML object
Definition at line 652 of file umlscene.cpp.
|
slot |
Called by menu when to show the instance of the view.
Definition at line 3351 of file umlscene.cpp.
|
slot |
Changes the current tool to the selected tool.
The current tool is cleaned and the selected tool initialized.
Definition at line 574 of file umlscene.cpp.
bool UMLScene::snapComponentSizeToGrid | ( | ) | const |
Return whether to use snap to grid for component size.
Definition at line 3563 of file umlscene.cpp.
qreal UMLScene::snappedX | ( | qreal | x | ) |
Returns the input coordinate with possible grid-snap applied.
Definition at line 3605 of file umlscene.cpp.
qreal UMLScene::snappedY | ( | qreal | y | ) |
Returns the input coordinate with possible grid-snap applied.
Definition at line 3623 of file umlscene.cpp.
bool UMLScene::snapToGrid | ( | ) | const |
Return whether to use snap to grid.
Definition at line 3546 of file umlscene.cpp.
int UMLScene::snapX | ( | ) | const |
Returns the x grid size.
Definition at line 3581 of file umlscene.cpp.
int UMLScene::snapY | ( | ) | const |
Returns the y grid size.
Definition at line 3589 of file umlscene.cpp.
const QColor & UMLScene::textColor | ( | ) | const |
Returns the text color to use.
Definition at line 361 of file umlscene.cpp.
void UMLScene::toggleShowGrid | ( | ) |
void UMLScene::toggleSnapComponentSizeToGrid | ( | ) |
Changes snap to grid for component size boolean.
Called from menus.
Definition at line 3529 of file umlscene.cpp.
void UMLScene::toggleSnapToGrid | ( | ) |
DiagramType::Enum UMLScene::type | ( | ) | const |
Returns the type of the diagram.
Definition at line 256 of file umlscene.cpp.
UMLObjectList UMLScene::umlObjects | ( | ) |
Returns a List of all the UMLObjects(Use Cases, Concepts and Actors) in the View.
Definition at line 1752 of file umlscene.cpp.
|
protected |
Updates the size of all components in this view.
Definition at line 3709 of file umlscene.cpp.
void UMLScene::updateContainment | ( | UMLCanvasObject * | self | ) |
Refreshes containment association, i.e.
removes possible old containment and adds new containment association if applicable.
- Parameters
-
self Pointer to the contained object for which the association to the containing object is recomputed.
Definition at line 2389 of file umlscene.cpp.
bool UMLScene::useFillColor | ( | ) | const |
Returns whether to use the fill/background color.
Definition at line 1203 of file umlscene.cpp.
UMLWidget * UMLScene::widgetAt | ( | const QPointF & | p | ) |
Tests the given point against all widgets and returns the widget for which the point is within its bounding rectangle.
In case of multiple matches, returns the smallest widget. Returns NULL if the point is not inside any widget. TODO: What about using QGraphicsScene::items(...)?
Definition at line 968 of file umlscene.cpp.
UMLWidgetList & UMLScene::widgetList | ( | ) |
Returns a reference to the widget list.
Definition at line 424 of file umlscene.cpp.
bool UMLScene::widgetOnDiagram | ( | Uml::ID::Type | id | ) |
Returns whether a widget is already on the diagram.
- Parameters
-
id The id of the widget to check for.
- Returns
- Returns true if the widget is already on the diagram, false if not.
Definition at line 1047 of file umlscene.cpp.
Member Data Documentation
|
protected |
All the AssociationWidgets on the diagram.
Definition at line 329 of file umlscene.h.
|
protected |
Definition at line 362 of file umlscene.h.
|
protected |
Definition at line 363 of file umlscene.h.
|
protected |
Definition at line 364 of file umlscene.h.
|
protected |
Flag if view/children started cut operation.
Definition at line 365 of file umlscene.h.
|
protected |
Flag to use snap to grid for component size. The default is off.
Definition at line 332 of file umlscene.h.
|
protected |
Flag to use snap to grid. The default is off.
Definition at line 331 of file umlscene.h.
|
protected |
The documentation of the diagram.
Definition at line 324 of file umlscene.h.
|
protected |
Flag is set to true when diagram is open, i.e. shown to the user.
Definition at line 333 of file umlscene.h.
|
protected |
All the message widgets on the diagram.
Definition at line 327 of file umlscene.h.
|
protected |
The name of the diagram.
Definition at line 323 of file umlscene.h.
|
protected |
Used for creating unique name of collaboration messages.
Definition at line 360 of file umlscene.h.
|
protected |
The ID of the view. Allocated by UMLDoc.
Definition at line 321 of file umlscene.h.
|
protected |
Contains the unique ID to allocate to a widget that needs an ID for the view.
ObjectWidget is an example of this.
Definition at line 319 of file umlscene.h.
|
protected |
Options used by view.
Definition at line 325 of file umlscene.h.
|
protected |
Definition at line 361 of file umlscene.h.
|
protected |
list of selected items TODO: migrate to QGraphicsScenes selection list
Definition at line 366 of file umlscene.h.
|
protected |
The type of diagram to represent.
Definition at line 322 of file umlscene.h.
|
protected |
All the UMLWidgets on the diagram.
Definition at line 328 of file umlscene.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.