umbrello 2.39.2 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
UMLScene Class Reference

`#include <umlscene.h>`

Inheritance diagram for UMLScene:

## Public Slots
void | slotToolBarChanged (int c)
void | slotObjectCreated (UMLObject *o)
void | slotObjectRemoved (UMLObject *o)
void | slotMenuSelection (QAction *action)
void | slotActivate ()
void | slotCutSuccessful ()
void | slotShowView ()
void | alignLeft ()
void | alignRight ()
void | alignTop ()
void | alignBottom ()
void | alignVerticalMiddle ()
void | alignHorizontalMiddle ()
void | alignVerticalDistribute ()
void | alignHorizontalDistribute ()

## Signals
void | sigResetToolBar ()
void | sigFillColorChanged (Uml::ID::Type)
void | sigGridColorChanged (Uml::ID::Type)
void | sigLineColorChanged (Uml::ID::Type)
void | sigTextColorChanged (Uml::ID::Type)
void | sigLineWidthChanged (Uml::ID::Type)
void | sigSnapToGridToggled (bool)
void | sigSnapComponentSizeToGridToggled (bool)
void | sigShowGridToggled (bool)
void | sigAssociationRemoved (AssociationWidget *)
void | sigWidgetRemoved (UMLWidget *)

## Public Member Functions
| UMLScene (UMLFolder *parentFolder, UMLView *view=0)
virtual | ~UMLScene ()
UMLView * | activeView () const
UMLFolder * | folder () const
void | setFolder (UMLFolder *folder)
QString | documentation () const
void | setDocumentation (const QString &doc)
bool | autoIncrementSequence () const
void | setAutoIncrementSequence (bool state)
QString | autoIncrementSequenceValue ()
QString | name () const
void | setName (const QString &name)
Uml::DiagramType::Enum | type () const
void | setType (Uml::DiagramType::Enum type)
Uml::ID::Type | ID () const
void | setID (Uml::ID::Type id)
QPointF | pos () const
void | setPos (const QPointF &pos)
const QColor & | fillColor () const
void | setFillColor (const QColor &color)
const QColor & | lineColor () const
void | setLineColor (const QColor &color)
uint | lineWidth () const
void | setLineWidth (uint width)
const QColor & | textColor () const
void | setTextColor (const QColor &color)
const QColor & | gridDotColor () const
void | setGridDotColor (const QColor &color)
const QColor & | backgroundColor () const
bool | snapToGrid () const
void | setSnapToGrid (bool bSnap)
bool | snapComponentSizeToGrid () const
void | setSnapComponentSizeToGrid (bool bSnap)
int | snapX () const
int | snapY () const
void | setSnapSpacing (int x, int y)
qreal | snappedX (qreal x)
qreal | snappedY (qreal y)
bool | isSnapGridVisible () const
void | setSnapGridVisible (bool bShow)
bool | isShowDocumentationIndicator () const
void | setShowDocumentationIndicator (bool bShow)
bool | useFillColor () const
void | setUseFillColor (bool ufc)
QFont | font () const
void | setFont (QFont font, bool changeAllWidgets=false)
bool | showOpSig () const
void | setShowOpSig (bool bShowOpSig)
Settings::OptionState & | optionState ()
void | setOptionState (const Settings::OptionState &options)
AssociationWidgetList | associationList () const
MessageWidgetList | messageList () const
UMLWidgetList | widgetList () const
void | addWidgetCmd (UMLWidget *widget)
void | addWidgetCmd (AssociationWidget *widget)
bool | isOpen () const
void | setIsOpen (bool isOpen)
void | print (QPrinter *pPrinter, QPainter &pPainter)
void | hideEvent (QHideEvent *he)
void | showEvent (QShowEvent *se)
void | checkMessages (ObjectWidget *w)
UMLWidget * | findWidget (Uml::ID::Type id)
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)
void | removeWidget (UMLWidget *o)
void | removeWidget (AssociationWidget *w)
void | removeWidgetCmd (UMLWidget *o)
UMLWidgetList | selectedWidgets () const
AssociationWidgetList | selectedAssociationWidgets () const
UMLWidgetList | selectedMessageWidgets () const
void | clearSelected ()
void | moveSelectedBy (qreal dX, qreal dY)
int | selectedCount (bool filterText=false) const
void | selectionUseFillColor (bool useFC)
void | selectionSetFont (const QFont &font)
void | selectionSetLineColor (const QColor &color)
void | selectionSetLineWidth (uint width)
void | selectionSetFillColor (const QColor &color)
void | selectionSetVisualProperty (ClassifierWidget::VisualProperty property, bool value)
void | deleteSelection ()
void | resizeSelection ()
void | selectAll ()
UMLWidget * | widgetOnDiagram (Uml::ID::Type id)
UMLWidget * | widgetOnDiagram (WidgetBase::WidgetType type)
bool | isSavedInSeparateFile ()
void | setMenu (const QPoint &pos)
void | resetToolbar ()
void | triggerToolbarButton (WorkToolBar::ToolBar_Buttons button)
bool | getPaste () const
void | setPaste (bool paste)
void | activate ()
AssociationWidgetList | selectedAssocs ()
UMLWidgetList | selectedWidgetsExt (bool filterText=true)
void | activateAfterLoad (bool bUseLog=false)
void | endPartialWidgetPaste ()
void | beginPartialWidgetPaste ()
void | removeWidgetCmd (AssociationWidget *pAssoc)
void | removeAssociations (UMLWidget *pWidget)
void | selectAssociations (bool bSelect)
void | getWidgetAssocs (UMLObject *Obj, AssociationWidgetList &Associations)
void | removeAllAssociations ()
void | removeAllWidgets ()
void | getDiagram (QPixmap &diagram, const QRectF &rect)
void | getDiagram (QPainter &painter, const QRectF &source, const QRectF &target=QRectF())
void | copyAsImage (QPixmap *&pix)
UMLViewImageExporter * | getImageExporter ()
bool | addAssociation (AssociationWidget *pAssoc, bool isPasteOperation=false)
void | removeAssocInViewAndDoc (AssociationWidget *assoc)
void | addFloatingTextWidget (FloatingTextWidget *pWidget)
QPointF | getPastePoint ()
void | resetPastePoint ()
void | setStartedCut ()
void | createAutoAssociations (UMLWidget *widget)
void | createAutoAttributeAssociations (UMLWidget *widget)
void | createAutoConstraintAssociations (UMLWidget *widget)
void | createAutoAttributeAssociations2 (UMLWidget *widget)
void | updateContainment (UMLCanvasObject *self)
void | setClassWidgetOptions (ClassOptionsPage *page)
WidgetBase::WidgetType | getUniqueSelectionType ()
void | clearDiagram ()
void | applyLayout (const QString &actionText)
void | toggleSnapToGrid ()
void | toggleSnapComponentSizeToGrid ()
void | toggleShowGrid ()
void | fileLoaded ()
virtual void | saveToXMI (QXmlStreamWriter &writer)
virtual bool | loadFromXMI (QDomElement &qElement)
bool | loadUISDiagram (QDomElement &qElement)
UMLWidget * | loadWidgetFromXMI (QDomElement &widgetElement)
void | addObject (UMLObject *object)
void | selectWidgets (qreal px, qreal py, qreal qx, qreal qy)
void | selectWidgets (UMLWidgetList &widgets)
void | selectWidget (UMLWidget *widget, QRectF *rect=0)
void | selectWidgetsOfAssoc (AssociationWidget *a)
ObjectWidget * | onWidgetLine (const QPointF &point) const
ObjectWidget * | onWidgetDestructionBox (const QPointF &point) const
UMLWidget * | getFirstMultiSelectedWidget () const
UMLWidget * | widgetAt (const QPointF &p)
AssociationWidget * | associationAt (const QPointF &p)
MessageWidget * | messageAt (const QPointF &p)
void | setupNewWidget (UMLWidget *w, bool setPosition=true)
bool | getCreateObject () const
void | setCreateObject (bool bCreate)
int | generateCollaborationId ()
UMLSceneItemList | collisions (const QPointF &p, int delta=3)
bool | isClassDiagram () const
bool | isUseCaseDiagram () const
bool | isSequenceDiagram () const
bool | isCollaborationDiagram () const
bool | isStateDiagram () const
bool | isActivityDiagram () const
bool | isComponentDiagram () const
bool | isDeploymentDiagram () const
bool | isEntityRelationshipDiagram () const
bool | isObjectDiagram () const
void | setWidgetLink (WidgetBase *w)
WidgetBase * | widgetLink ()
void | updateCanvasSizeEstimate (qreal x, qreal y, qreal w, qreal h)
void | updateSceneRect ()
qreal | fixX () const
qreal | fixY () const

## Static Public Member Functions
static qreal | maxCanvasSize ()

## Protected Member Functions
bool | loadWidgetsFromXMI (QDomElement &qElement)
bool | loadMessagesFromXMI (QDomElement &qElement)
bool | loadAssociationsFromXMI (QDomElement &qElement)
bool | loadUisDiagramPresentation (QDomElement &qElement)
void | dragEnterEvent (QGraphicsSceneDragDropEvent *enterEvent)
void | dragMoveEvent (QGraphicsSceneDragDropEvent *moveEvent)
void | dropEvent (QGraphicsSceneDragDropEvent *dropEvent)
void | mouseMoveEvent (QGraphicsSceneMouseEvent *mouseEvent)
void | mousePressEvent (QGraphicsSceneMouseEvent *mouseEvent)
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *mouseEvent)
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *mouseEvent)
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
QRectF | diagramRect ()
void | makeSelected (UMLWidget *uw)
void | updateComponentSizes ()
void | findMaxBoundingRectangle (const FloatingTextWidget *ft, qreal &px, qreal &py, qreal &qx, qreal &qy)
void | forceUpdateWidgetFontMetrics (QPainter *painter)
virtual void | drawBackground (QPainter *painter, const QRectF &rect)
QGraphicsItem * | itemAt (const QPointF &position) const

## Protected Attributes
Uml::ID::Type | m_nLocalID
Uml::ID::Type | m_nID
| The ID of the view. Allocated by UMLDoc.
Uml::DiagramType::Enum | m_Type
| The type of diagram to represent.
QString | m_Name
| The name of the diagram.
QString | m_Documentation
| The documentation of the diagram.
Settings::OptionState | m_Options
| Options used by view.
bool | m_bUseSnapToGrid
| Flag to use snap to grid. The default is off.
bool | m_bUseSnapComponentSizeToGrid
| Flag to use snap to grid for component size. The default is off.
bool | m_isOpen
| Flag is set to true when diagram is open, i.e. shown to the user.
int | m_nCollaborationId
| Used for creating unique name of collaboration messages.
QPointF | m_pos
bool | m_bCreateObject
bool | m_bDrawSelectedOnly
bool | m_bPaste
bool | m_bStartedCut
| Flag if view/children started cut operation.

## Private Member Functions
void | removeOwnedWidgets (UMLWidget *o)
void | unselectChildrenOfSelectedWidgets ()
void | createAutoAttributeAssociation (UMLClassifier *type, UMLAttribute *attr, UMLWidget *widget)
void | createAutoConstraintAssociation (UMLEntity *refEntity, UMLForeignKeyConstraint *fkConstraint, UMLWidget *widget)

## Private Attributes
UMLScenePrivate * | m_d
UMLView * | m_view
| The view to which this scene is related.
UMLFolder * | m_pFolder
| The folder in which this UMLView is contained.
IDChangeLog * | m_pIDChangesLog
| LocalID Changes Log for paste actions.
bool | m_isActivated
| True if the view was activated after the deserialization(load).
bool | m_bPopupShowing
| Status of a popupmenu on view. True - a popup is on view.
QPointF | m_PastePoint
| The offset at which to paste the clipboard.
UMLDoc * | m_doc
| Pointer to the UMLDoc.
UMLViewImageExporter * | m_pImageExporter
| Used to export the view.
LayoutGrid * | m_layoutGrid
| layout grid in the background
bool | m_autoIncrementSequence
| state of auto increment sequence
qreal | m_minX
qreal | m_minY
| Gather data for estimating required canvas size (used during loadFromXMI)
qreal | m_maxX
qreal | m_maxY
| Gather data for estimating required canvas size (used during loadFromXMI)
qreal | m_fixX
| Compensate for QGraphicsScene offsets, https://bugs.kde.org/show_bug.cgi?id=449622.
qreal | m_fixY
| Compensate for QGraphicsScene offsets, https://bugs.kde.org/show_bug.cgi?id=449622.

## Static Private Attributes
static const qreal | s_defaultCanvasWidth = 1100
| The default width of a diagram in pixels.
static const qreal | s_defaultCanvasHeight = 800
| The default height of a diagram in pixels.
static const qreal | s_maxCanvasSize = 100000.0
| The maximum supported canvas size.
static const qreal | s_sceneBorder = 5.0
| A border around the bounding rectangle of the elements in the scene.
static bool | s_showDocumentationIndicator = false
| Status of documentation indicator.

## Friends
class | UMLViewImageExporterModel
class | DiagramProxyWidget

## Detailed Description

UMLScene instances represent diagrams. The UMLScene class inherits from QGraphicsScene and it owns the objects displayed (see m_WidgetList.)

## Constructor & Destructor Documentation

## ◆ UMLScene()

UMLScene::UMLScene | ( | UMLFolder * | parentFolder,
|  | UMLView * | view = 0 )
| explicit

Constructor.

## ◆ ~UMLScene()

UMLScene::~UMLScene | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ activate()

void UMLScene::activate | ( |  | ) |

Activate all the objects and associations after a load from the clipboard

## ◆ activateAfterLoad()

void UMLScene::activateAfterLoad | ( | bool | bUseLog = false | ) |

Activate the view after a load a new file

## ◆ activeView()

UMLView * UMLScene::activeView | ( |  | ) | const

Returns the active view associated with this scene.

## ◆ addAssociation()

bool UMLScene::addAssociation | ( | AssociationWidget * | pAssoc,
|  | bool | isPasteOperation = false )

Adds an association to the view from the given data. Use this method when pasting.

## ◆ addFloatingTextWidget()

void UMLScene::addFloatingTextWidget | ( | FloatingTextWidget * | pWidget | ) |

Adds a floating text widget to the view

## ◆ addObject()

void UMLScene::addObject | ( | UMLObject * | object | ) |

Add an object to the application, and update the view.

## ◆ addWidgetCmd() [1/2]

void UMLScene::addWidgetCmd | ( | AssociationWidget * | widget | ) |

## ◆ addWidgetCmd() [2/2]

void UMLScene::addWidgetCmd | ( | UMLWidget * | widget | ) |

## ◆ alignBottom

void UMLScene::alignBottom | ( |  | ) |
| slot

Bottom Alignment

## ◆ alignHorizontalDistribute

void UMLScene::alignHorizontalDistribute | ( |  | ) |
| slot

Horizontal Distribute Alignment

## ◆ alignHorizontalMiddle

void UMLScene::alignHorizontalMiddle | ( |  | ) |
| slot

Horizontal Middle Alignment

## ◆ alignLeft

void UMLScene::alignLeft | ( |  | ) |
| slot

Left Alignment

## ◆ alignRight

void UMLScene::alignRight | ( |  | ) |
| slot

Right Alignment

## ◆ alignTop

void UMLScene::alignTop | ( |  | ) |
| slot

Top Alignment

## ◆ alignVerticalDistribute

void UMLScene::alignVerticalDistribute | ( |  | ) |
| slot

Vertical Distribute Alignment

## ◆ alignVerticalMiddle

void UMLScene::alignVerticalMiddle | ( |  | ) |
| slot

Vertical Middle Alignment

## ◆ applyLayout()

void UMLScene::applyLayout | ( | const QString & | variant | ) |

Apply an automatic layout.

## ◆ associationAt()

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.

## ◆ associationList()

AssociationWidgetList UMLScene::associationList | ( |  | ) | const

Returns the association list.

## ◆ autoIncrementSequence()

bool UMLScene::autoIncrementSequence | ( |  | ) | const

Return the state of the auto increment sequence

## ◆ autoIncrementSequenceValue()

QString UMLScene::autoIncrementSequenceValue | ( |  | ) |

Return the next auto increment sequence value

## ◆ backgroundColor()

const QColor & UMLScene::backgroundColor | ( |  | ) | const

Returns background color

## ◆ beginPartialWidgetPaste()

void UMLScene::beginPartialWidgetPaste | ( |  | ) |

## ◆ checkMessages()

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.

## ◆ clearDiagram()

void UMLScene::clearDiagram | ( |  | ) |

Asks for confirmation and clears everything on the diagram. Called from menus.

## ◆ clearSelected()

void UMLScene::clearSelected | ( |  | ) |

Clear the selected widgets list.

## ◆ collisions()

UMLSceneItemList UMLScene::collisions | ( | const QPointF & | p,
|  | int | delta = 3 )

## ◆ contextMenuEvent()

void UMLScene::contextMenuEvent | ( | QGraphicsSceneContextMenuEvent * | event | ) |
| protected virtual

Event handler for context menu events.

## ◆ copyAsImage()

void UMLScene::copyAsImage | ( | QPixmap *& | pix | ) |

Returns the PNG picture of the paste operation.

## ◆ createAutoAssociations()

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.

## ◆ createAutoAttributeAssociation()

void UMLScene::createAutoAttributeAssociation | ( | UMLClassifier * | type,
|  | UMLAttribute * | attr,
|  | UMLWidget * | widget )
| private

Create an association with the attribute attr associated with the UMLWidget widget if the UMLClassifier type is present on the current diagram.

## ◆ createAutoAttributeAssociations()

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.

## ◆ createAutoAttributeAssociations2()

void UMLScene::createAutoAttributeAssociations2 | ( | UMLWidget * | widget | ) |

## ◆ createAutoConstraintAssociation()

void UMLScene::createAutoConstraintAssociation | ( | UMLEntity * | refEntity,
|  | UMLForeignKeyConstraint * | fkConstraint,
|  | UMLWidget * | widget )
| private

## ◆ createAutoConstraintAssociations()

void UMLScene::createAutoConstraintAssociations | ( | UMLWidget * | widget | ) |

## ◆ deleteSelection()

void UMLScene::deleteSelection | ( |  | ) |

Delete the selected widgets list and the widgets in it.

## ◆ diagramRect()

QRectF UMLScene::diagramRect | ( |  | ) |
| protected

Gets the smallest area to print.

Returns
  Returns the smallest area to print.

## ◆ documentation()

QString UMLScene::documentation | ( |  | ) | const

Return the documentation of the diagram.

## ◆ dragEnterEvent()

void UMLScene::dragEnterEvent | ( | QGraphicsSceneDragDropEvent * | e | ) |
| protected

Override standard method.

## ◆ dragMoveEvent()

void UMLScene::dragMoveEvent | ( | QGraphicsSceneDragDropEvent * | e | ) |
| protected

Override standard method.

## ◆ drawBackground()

void UMLScene::drawBackground | ( | QPainter * | painter,
|  | const QRectF & | rect )
| protected virtual

Overrides standard method from QGraphicsScene drawing the background.

## ◆ dropEvent()

void UMLScene::dropEvent | ( | QGraphicsSceneDragDropEvent * | e | ) |
| protected

Override standard method.

## ◆ endPartialWidgetPaste()

void UMLScene::endPartialWidgetPaste | ( |  | ) |

## ◆ fileLoaded()

void UMLScene::fileLoaded | ( |  | ) |

Changes the zoom to the currently set level (now loaded from file) Called from UMLApp::slotUpdateViews()

## ◆ fillColor()

const QColor & UMLScene::fillColor | ( |  | ) | const

Returns the fill color to use.

## ◆ findAssocWidget() [1/3]

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.

## ◆ findAssocWidget() [2/3]

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.

## ◆ findAssocWidget() [3/3]

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.

## ◆ findMaxBoundingRectangle()

void UMLScene::findMaxBoundingRectangle | ( | const FloatingTextWidget * | ft,
|  | qreal & | px,
|  | qreal & | py,
|  | qreal & | qx,
|  | qreal & | qy )
| 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.

## ◆ findWidget()

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.

## ◆ fixX()

qreal UMLScene::fixX | ( |  | ) | const

Compensate for QGraphicsScene offsets, https://bugs.kde.org/show_bug.cgi?id=449622

## ◆ fixY()

qreal UMLScene::fixY | ( |  | ) | const

Compensate for QGraphicsScene offsets, https://bugs.kde.org/show_bug.cgi?id=449622

## ◆ folder()

UMLFolder * UMLScene::folder | ( |  | ) | const

Return the UMLFolder in which this diagram lives.

## ◆ font()

QFont UMLScene::font | ( |  | ) | const

Returns the font to use

## ◆ forceUpdateWidgetFontMetrics()

void UMLScene::forceUpdateWidgetFontMetrics | ( | QPainter * | painter | ) |
| 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.

## ◆ generateCollaborationId()

int UMLScene::generateCollaborationId | ( |  | ) |

Used for creating unique name of collaboration messages.

## ◆ getCreateObject()

bool UMLScene::getCreateObject | ( |  | ) | const

Return whether we are currently creating an object.

## ◆ getDiagram() [1/2]

void UMLScene::getDiagram | ( | QPainter & | painter,
|  | const QRectF & | source,
|  | const QRectF & | target = QRectF() )

Paint diagram to the paint device

Parameters

  painter | the QPainter to which the diagram is painted
  source | the area of the diagram to copy
  target | the rect where to paint into

## ◆ getDiagram() [2/2]

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

## ◆ getFirstMultiSelectedWidget()

UMLWidget * UMLScene::getFirstMultiSelectedWidget | ( |  | ) | const

Return pointer to the first selected widget (for multi-selection)

## ◆ getImageExporter()

UMLViewImageExporter * UMLScene::getImageExporter | ( |  | ) |

Returns the imageExporter used to export the view.

Returns
  The imageExporter used to export the view.

## ◆ getPaste()

bool UMLScene::getPaste | ( |  | ) | const

Returns the status on whether in a paste state.

Returns
  Returns the status on whether in a paste state.

## ◆ getPastePoint()

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.

## ◆ getUniqueSelectionType()

WidgetBase::WidgetType UMLScene::getUniqueSelectionType | ( |  | ) |

Returns the type of the selected widget or widgets.

If multiple widgets of different types are selected then WidgetType wt_UMLWidget is returned.

## ◆ getWidgetAssocs()

void UMLScene::getWidgetAssocs | ( | UMLObject * | Obj,
|  | AssociationWidgetList & | Associations )

Fills Associations with all the associations that includes a widget related to object

## ◆ gridDotColor()

const QColor & UMLScene::gridDotColor | ( |  | ) | const

return grid dot color

Returns
  Color

## ◆ hideEvent()

void UMLScene::hideEvent | ( | QHideEvent * | he | ) |

Overrides the standard operation.

## ◆ ID()

Uml::ID::Type UMLScene::ID | ( |  | ) | const

Returns the ID of the diagram.

## ◆ isActivityDiagram()

bool UMLScene::isActivityDiagram | ( |  | ) | const
| inline

## ◆ isClassDiagram()

bool UMLScene::isClassDiagram | ( |  | ) | const
| inline

## ◆ isCollaborationDiagram()

bool UMLScene::isCollaborationDiagram | ( |  | ) | const
| inline

## ◆ isComponentDiagram()

bool UMLScene::isComponentDiagram | ( |  | ) | const
| inline

## ◆ isDeploymentDiagram()

bool UMLScene::isDeploymentDiagram | ( |  | ) | const
| inline

## ◆ isEntityRelationshipDiagram()

bool UMLScene::isEntityRelationshipDiagram | ( |  | ) | const
| inline

## ◆ isObjectDiagram()

bool UMLScene::isObjectDiagram | ( |  | ) | const
| inline

## ◆ isOpen()

bool UMLScene::isOpen | ( |  | ) | const

Returns the open state.

Returns
  when true diagram is shown to the user

## ◆ isSavedInSeparateFile()

bool UMLScene::isSavedInSeparateFile | ( |  | ) |

Returns true if this diagram resides in an externalized folder. CHECK: It is probably cleaner to move this to the UMLListViewItem.

## ◆ isSequenceDiagram()

bool UMLScene::isSequenceDiagram | ( |  | ) | const
| inline

## ◆ isShowDocumentationIndicator()

bool UMLScene::isShowDocumentationIndicator | ( |  | ) | const

Returns whether to show documentation indicator.

## ◆ isSnapGridVisible()

bool UMLScene::isSnapGridVisible | ( |  | ) | const

Returns whether to show snap grid or not.

## ◆ isStateDiagram()

bool UMLScene::isStateDiagram | ( |  | ) | const
| inline

## ◆ isUseCaseDiagram()

bool UMLScene::isUseCaseDiagram | ( |  | ) | const
| inline

## ◆ itemAt()

QGraphicsItem * UMLScene::itemAt | ( | const QPointF & | position | ) | const
| inline protected

## ◆ lineColor()

const QColor & UMLScene::lineColor | ( |  | ) | const

Returns the line color to use.

## ◆ lineWidth()

uint UMLScene::lineWidth | ( |  | ) | const

Returns the line width to use.

## ◆ loadAssociationsFromXMI()

bool UMLScene::loadAssociationsFromXMI | ( | QDomElement & | qElement | ) |
| protected

## ◆ loadFromXMI()

bool UMLScene::loadFromXMI | ( | QDomElement & | qElement | ) |
| virtual

Loads the "diagram" tag.

## ◆ loadMessagesFromXMI()

bool UMLScene::loadMessagesFromXMI | ( | QDomElement & | qElement | ) |
| protected

## ◆ loadUISDiagram()

bool UMLScene::loadUISDiagram | ( | QDomElement & | qElement | ) |

Loads the "UISDiagram" tag of Unisys.IntegratePlus.2 generated files.

## ◆ loadUisDiagramPresentation()

bool UMLScene::loadUisDiagramPresentation | ( | QDomElement & | qElement | ) |
| protected

## ◆ loadWidgetFromXMI()

UMLWidget * UMLScene::loadWidgetFromXMI | ( | QDomElement & | widgetElement | ) |

Loads a "widget" element from XMI, used by loadFromXMI() and the clipboard.

## ◆ loadWidgetsFromXMI()

bool UMLScene::loadWidgetsFromXMI | ( | QDomElement & | qElement | ) |
| protected

## ◆ makeSelected()

void UMLScene::makeSelected | ( | UMLWidget * | uw | ) |
| protected

Calls setSelected on the given UMLWidget and enters it into the m_selectedList while making sure it is there only once.

## ◆ maxCanvasSize()

qreal UMLScene::maxCanvasSize | ( |  | ) |
| static

The size returned is large enough to account for possible bogus widget coordinate offsets as described in https://bugs.kde.org/show_bug.cgi?id=449622 Coordinate values below -maxCanvasSize() or above maxCanvasSize() are deemed unrecoverable.

Returns
  the maximum possible canvas size

## ◆ messageAt()

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.

## ◆ messageList()

MessageWidgetList UMLScene::messageList | ( |  | ) | const

Returns the message list.

## ◆ mouseDoubleClickEvent()

void UMLScene::mouseDoubleClickEvent | ( | QGraphicsSceneMouseEvent * | event | ) |
| protected

Override standard method. Calls the same method in the current tool bar state.

## ◆ mouseMoveEvent()

void UMLScene::mouseMoveEvent | ( | QGraphicsSceneMouseEvent * | ome | ) |
| protected

Overrides the standard operation. Calls the same method in the current tool bar state.

## ◆ mousePressEvent()

void UMLScene::mousePressEvent | ( | QGraphicsSceneMouseEvent * | event | ) |
| protected

Override standard method. Calls the same method in the current tool bar state.

## ◆ mouseReleaseEvent()

void UMLScene::mouseReleaseEvent | ( | QGraphicsSceneMouseEvent * | ome | ) |
| protected

Overrides the standard operation. Calls the same method in the current tool bar state.

## ◆ moveSelectedBy()

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.

## ◆ name()

QString UMLScene::name | ( |  | ) | const

Return the name of the diagram.

## ◆ onWidgetDestructionBox()

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 owning the destruction box which was clicked. Returns 0 if no destruction box was clicked on.

## ◆ onWidgetLine()

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 owning the line which was clicked. Returns 0 if no line was clicked on.

## ◆ optionState()

Settings::OptionState & UMLScene::optionState | ( |  | ) |

Returns the options being used.

## ◆ pos()

QPointF UMLScene::pos | ( |  | ) | const

Returns the position of the diagram.

## ◆ print()

void UMLScene::print | ( | QPrinter * | pPrinter,
|  | QPainter & | pPainter )

Contains the implementation for printing functionality.

## ◆ removeAllAssociations()

void UMLScene::removeAllAssociations | ( |  | ) |

Removes All the associations of the diagram

## ◆ removeAllWidgets()

void UMLScene::removeAllWidgets | ( |  | ) |

Removes All the widgets of the diagram

## ◆ removeAssociations()

void UMLScene::removeAssociations | ( | UMLWidget * | widget | ) |

Removes all the associations related to Widget.

Parameters

  widget | Pointer to the widget to remove.

## ◆ removeAssocInViewAndDoc()

void UMLScene::removeAssocInViewAndDoc | ( | AssociationWidget * | a | ) |

Removes an AssociationWidget from the association list and removes the corresponding UMLAssociation from the current UMLDoc.

## ◆ removeOwnedWidgets()

void UMLScene::removeOwnedWidgets | ( | UMLWidget * | o | ) |
| private

Remove all widgets that have given widget as owner.

Parameters

  o | The owner widget that will be removed.

## ◆ removeWidget() [1/2]

void UMLScene::removeWidget | ( | AssociationWidget * | w | ) |

Remove an associationwidget from view (undo command)

Parameters

  w | The associationwidget to remove.

## ◆ removeWidget() [2/2]

void UMLScene::removeWidget | ( | UMLWidget * | o | ) |

Remove a widget from view (undo command)

Parameters

  o | The widget to remove.

## ◆ removeWidgetCmd() [1/2]

void UMLScene::removeWidgetCmd | ( | AssociationWidget * | pAssoc | ) |

Removes an AssociationWidget from a diagram Physically deletes the AssociationWidget passed in.

Parameters

  pAssoc | Pointer to the AssociationWidget.

## ◆ removeWidgetCmd() [2/2]

void UMLScene::removeWidgetCmd | ( | UMLWidget * | o | ) |

Remove a widget from view.

Parameters

  o | The widget to remove.

## ◆ resetPastePoint()

void UMLScene::resetPastePoint | ( |  | ) |

Reset the paste point.

## ◆ resetToolbar()

void UMLScene::resetToolbar | ( |  | ) |

Reset the toolbar.

## ◆ resizeSelection()

void UMLScene::resizeSelection | ( |  | ) |

resize selected widgets

## ◆ saveToXMI()

void UMLScene::saveToXMI | ( | QXmlStreamWriter & | writer | ) |
| virtual

Creates the "diagram" tag and fills it with the contents of the diagram.

## ◆ selectAll()

void UMLScene::selectAll | ( |  | ) |

Selects all widgets

## ◆ selectAssociations()

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

## ◆ selectedAssociationWidgets()

AssociationWidgetList UMLScene::selectedAssociationWidgets | ( |  | ) | const

Returns a list of selected association widgets

Returns
  list of selected widgets based on class AssociationWidget

## ◆ selectedAssocs()

AssociationWidgetList UMLScene::selectedAssocs | ( |  | ) |

Returns a list with all the selected associations from the diagram

## ◆ selectedCount()

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.

## ◆ selectedMessageWidgets()

UMLWidgetList UMLScene::selectedMessageWidgets | ( |  | ) | const

Returns a list of selected message widgets

Returns
  list of selected widgets based on class MessageWidget

## ◆ selectedWidgets()

UMLWidgetList UMLScene::selectedWidgets | ( |  | ) | const

Returns a list of selected widgets

Returns
  list of selected widgets based on class UMLWidget

Note
  This method returns widgets including message widgets, but no association widgets

## ◆ selectedWidgetsExt()

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 TextRole::Floating

Returns
  The UMLWidgetList to fill.

## ◆ selectionSetFillColor()

void UMLScene::selectionSetFillColor | ( | const QColor & | color | ) |

Set the fill color for all the currently selected items.

## ◆ selectionSetFont()

void UMLScene::selectionSetFont | ( | const QFont & | font | ) |

Set the font for all the currently selected items.

## ◆ selectionSetLineColor()

void UMLScene::selectionSetLineColor | ( | const QColor & | color | ) |

Set the line color for all the currently selected items.

## ◆ selectionSetLineWidth()

void UMLScene::selectionSetLineWidth | ( | uint | width | ) |

Set the line width for all the currently selected items.

## ◆ selectionSetVisualProperty()

void UMLScene::selectionSetVisualProperty | ( | ClassifierWidget::VisualProperty | property,
|  | bool | value )

Set or unset the visual property (show ..) setting of all selected items.

## ◆ selectionUseFillColor()

void UMLScene::selectionUseFillColor | ( | bool | useFC | ) |

Set the useFillColor variable to all selected widgets

Parameters

  useFC | The state to set the widget to.

## ◆ selectWidget()

void UMLScene::selectWidget | ( | UMLWidget * | widget,
|  | QRectF * | rect = 0 )

Select a single widget

If QRectF* rect is provided, the selection is only made if the widget is visible within the rectangle.

## ◆ selectWidgets() [1/2]

void UMLScene::selectWidgets | ( | qreal | px,
|  | qreal | py,
|  | qreal | qx,
|  | qreal | qy )

Selects all the widgets within an internally kept rectangle.

## ◆ selectWidgets() [2/2]

void UMLScene::selectWidgets | ( | UMLWidgetList & | widgets | ) |

Selects all the widgets from a list.

## ◆ selectWidgetsOfAssoc()

void UMLScene::selectWidgetsOfAssoc | ( | AssociationWidget * | a | ) |

Selects all the widgets of the given association widget.

## ◆ setAutoIncrementSequence()

void UMLScene::setAutoIncrementSequence | ( | bool | state | ) |

## ◆ setClassWidgetOptions()

void UMLScene::setClassWidgetOptions | ( | ClassOptionsPage * | page | ) |

Sets some options for all the ClassifierWidget on the view.

## ◆ setCreateObject()

void UMLScene::setCreateObject | ( | bool | bCreate | ) |

Set whether we are currently creating an object.

## ◆ setDocumentation()

void UMLScene::setDocumentation | ( | const QString & | doc | ) |

Set the documentation of the diagram.

## ◆ setFillColor()

void UMLScene::setFillColor | ( | const QColor & | color | ) |

Set the background color.

Parameters

  color | The color to use.

## ◆ setFolder()

void UMLScene::setFolder | ( | UMLFolder * | folder | ) |

Set the UMLFolder in which this diagram lives.

## ◆ setFont()

void UMLScene::setFont | ( | QFont | font,
|  | bool | changeAllWidgets = false )

Sets the font for the view and optionally all the widgets on the view.

## ◆ setGridDotColor()

void UMLScene::setGridDotColor | ( | const QColor & | color | ) |

set grid dot color

Parameters

  color | grid dot color

## ◆ setID()

void UMLScene::setID | ( | Uml::ID::Type | id | ) |

Sets the ID of the diagram.

## ◆ setIsOpen()

void UMLScene::setIsOpen | ( | bool | isOpen | ) |

Sets the flag 'isOpen'.

Parameters

  isOpen | flag indicating that the diagram is shown to the user

## ◆ setLineColor()

void UMLScene::setLineColor | ( | const QColor & | color | ) |

Sets the line color.

Parameters

  color | The color to use.

## ◆ setLineWidth()

void UMLScene::setLineWidth | ( | uint | width | ) |

Sets the line width.

Parameters

  width | The width to use.

## ◆ setMenu()

void UMLScene::setMenu | ( | const QPoint & | pos | ) |

## ◆ setName()

void UMLScene::setName | ( | const QString & | name | ) |

Set the name of the diagram.

## ◆ setOptionState()

void UMLScene::setOptionState | ( | const Settings::OptionState & | options | ) |

Sets the options to be used.

## ◆ setPaste()

void UMLScene::setPaste | ( | bool | paste | ) |

Sets the status on whether in a paste state.

## ◆ setPos()

void UMLScene::setPos | ( | const QPointF & | pos | ) |

Sets the position of the diagram.

## ◆ setShowDocumentationIndicator()

void UMLScene::setShowDocumentationIndicator | ( | bool | bShow | ) |

sets whether to show documentation indicator.

## ◆ setShowOpSig()

void UMLScene::setShowOpSig | ( | bool | bShowOpSig | ) |

Sets whether to show operation signatures.

## ◆ setSnapComponentSizeToGrid()

void UMLScene::setSnapComponentSizeToGrid | ( | bool | bSnap | ) |

Sets whether to snap to grid for component size.

## ◆ setSnapGridVisible()

void UMLScene::setSnapGridVisible | ( | bool | bShow | ) |

Sets whether to show snap grid.

## ◆ setSnapSpacing()

void UMLScene::setSnapSpacing | ( | int | x,
|  | int | y )

Sets the grid size in x and y.

## ◆ setSnapToGrid()

void UMLScene::setSnapToGrid | ( | bool | bSnap | ) |

Sets whether to snap to grid.

## ◆ setStartedCut()

void UMLScene::setStartedCut | ( |  | ) |

Called by the view or any of its children when they start a cut operation.

## ◆ setTextColor()

void UMLScene::setTextColor | ( | const QColor & | color | ) |

Sets the text color.

Parameters

  color | The color to use.

## ◆ setType()

void UMLScene::setType | ( | Uml::DiagramType::Enum | type | ) |

Set the type of diagram.

## ◆ setupNewWidget()

void UMLScene::setupNewWidget | ( | UMLWidget * | w,
|  | bool | setPosition = true )

Initialize and announce a newly created widget. Auxiliary to contentsMouseReleaseEvent().

## ◆ setUseFillColor()

void UMLScene::setUseFillColor | ( | bool | ufc | ) |

Sets whether to use the fill/background color

## ◆ setWidgetLink()

void UMLScene::setWidgetLink | ( | WidgetBase * | w | ) |

## ◆ showEvent()

void UMLScene::showEvent | ( | QShowEvent * | se | ) |

Overrides the standard operation.

## ◆ showOpSig()

bool UMLScene::showOpSig | ( |  | ) | const

Returns whether to show operation signatures.

## ◆ sigAssociationRemoved

void UMLScene::sigAssociationRemoved | ( | AssociationWidget * |  | ) |
| signal

## ◆ sigFillColorChanged

void UMLScene::sigFillColorChanged | ( | Uml::ID::Type |  | ) |
| signal

## ◆ sigGridColorChanged

void UMLScene::sigGridColorChanged | ( | Uml::ID::Type |  | ) |
| signal

## ◆ sigLineColorChanged

void UMLScene::sigLineColorChanged | ( | Uml::ID::Type |  | ) |
| signal

## ◆ sigLineWidthChanged

void UMLScene::sigLineWidthChanged | ( | Uml::ID::Type |  | ) |
| signal

## ◆ sigResetToolBar

void UMLScene::sigResetToolBar | ( |  | ) |
| signal

## ◆ sigShowGridToggled

void UMLScene::sigShowGridToggled | ( | bool |  | ) |
| signal

## ◆ sigSnapComponentSizeToGridToggled

void UMLScene::sigSnapComponentSizeToGridToggled | ( | bool |  | ) |
| signal

## ◆ sigSnapToGridToggled

void UMLScene::sigSnapToGridToggled | ( | bool |  | ) |
| signal

## ◆ sigTextColorChanged

void UMLScene::sigTextColorChanged | ( | Uml::ID::Type |  | ) |
| signal

## ◆ sigWidgetRemoved

void UMLScene::sigWidgetRemoved | ( | UMLWidget * |  | ) |
| signal

## ◆ slotActivate

void UMLScene::slotActivate | ( |  | ) |
| slot

makes this view the active view by asking the document to show us

## ◆ slotCutSuccessful

void UMLScene::slotCutSuccessful | ( |  | ) |
| 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.

## ◆ slotMenuSelection

void UMLScene::slotMenuSelection | ( | QAction * | action | ) |
| slot

When a menu selection has been made on the menu that this view created, this method gets called.

## ◆ slotObjectCreated

void UMLScene::slotObjectCreated | ( | UMLObject * | o | ) |
| slot

Slot called when an object is created.

Parameters

  o | created UML object

## ◆ slotObjectRemoved

void UMLScene::slotObjectRemoved | ( | UMLObject * | o | ) |
| slot

Slot called when an object is removed.

Parameters

  o | removed UML object

## ◆ slotShowView

void UMLScene::slotShowView | ( |  | ) |
| slot

Called by menu when to show the instance of the view.

## ◆ slotToolBarChanged

void UMLScene::slotToolBarChanged | ( | int | c | ) |
| slot

Changes the current tool to the selected tool. The current tool is cleaned and the selected tool initialized.

## ◆ snapComponentSizeToGrid()

bool UMLScene::snapComponentSizeToGrid | ( |  | ) | const

Return whether to use snap to grid for component size.

## ◆ snappedX()

qreal UMLScene::snappedX | ( | qreal | _x | ) |

Returns the input coordinate with possible grid-snap applied.

## ◆ snappedY()

qreal UMLScene::snappedY | ( | qreal | _y | ) |

Returns the input coordinate with possible grid-snap applied.

## ◆ snapToGrid()

bool UMLScene::snapToGrid | ( |  | ) | const

Return whether to use snap to grid.

## ◆ snapX()

int UMLScene::snapX | ( |  | ) | const

Returns the x grid size.

## ◆ snapY()

int UMLScene::snapY | ( |  | ) | const

Returns the y grid size.

## ◆ textColor()

const QColor & UMLScene::textColor | ( |  | ) | const

Returns the text color to use.

## ◆ toggleShowGrid()

void UMLScene::toggleShowGrid | ( |  | ) |

Changes show grid boolean. Called from menus.

## ◆ toggleSnapComponentSizeToGrid()

void UMLScene::toggleSnapComponentSizeToGrid | ( |  | ) |

Changes snap to grid for component size boolean. Called from menus.

## ◆ toggleSnapToGrid()

void UMLScene::toggleSnapToGrid | ( |  | ) |

Changes snap to grid boolean. Called from menus.

## ◆ triggerToolbarButton()

void UMLScene::triggerToolbarButton | ( | WorkToolBar::ToolBar_Buttons | button | ) |

## ◆ type()

DiagramType::Enum UMLScene::type | ( |  | ) | const

Returns the type of the diagram.

## ◆ unselectChildrenOfSelectedWidgets()

void UMLScene::unselectChildrenOfSelectedWidgets | ( |  | ) |
| private

Unselect child widgets when their owner is already selected.

## ◆ updateCanvasSizeEstimate()

void UMLScene::updateCanvasSizeEstimate | ( | qreal | x,
|  | qreal | y,
|  | qreal | w,
|  | qreal | h )

Unfortunately the XMI attributes "canvaswidth" and "canvasheight" cannot be relied on, in versions before 2.34 they sometimes contain bogus values. We work around this problem by gathering the minimum and maximum values of the widgets x, x+width, y, y+height into the variables m_minX, m_maxX, m_minY, m_maxY. These values are gathered, and the new scene rectangle is set if required, during loadFromXMI().

Parameters

  x | If value is less than m_minX then m_minX is set to this value.
  y | If value is less than m_minY then m_minY is set to this value.
  w | If `x` plus this value is greater than m_maxX then m_maxX is set to their sum.
  h | If `y` plus this value is greater than m_maxY then m_maxY is set to their sum.

## ◆ updateComponentSizes()

void UMLScene::updateComponentSizes | ( |  | ) |
| protected

Updates the size of all components in this view.

## ◆ updateContainment()

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.

## ◆ updateSceneRect()

void UMLScene::updateSceneRect | ( |  | ) |

Adjust scene rect to cover all contained items

## ◆ useFillColor()

bool UMLScene::useFillColor | ( |  | ) | const

Returns whether to use the fill/background color

## ◆ widgetAt()

UMLWidget * UMLScene::widgetAt | ( | const QPointF & | p | ) |

Checks the specified point against all widgets and returns the widget for which the point is within its bounding box.

Parameters

  p | Point in scene coordinates to search for

Returns
  Returns the first widget of type UMLWidget returned by QGraphicsScene::items() for multiple matches
  Returns NULL if the point is not inside any widget.

## ◆ widgetLink()

WidgetBase * UMLScene::widgetLink | ( |  | ) |

## ◆ widgetList()

UMLWidgetList UMLScene::widgetList | ( |  | ) | const

Returns the widget list.

## ◆ widgetOnDiagram() [1/2]

UMLWidget * 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 pointer to the widget if it is on the diagram, NULL if not.

## ◆ widgetOnDiagram() [2/2]

UMLWidget * UMLScene::widgetOnDiagram | ( | WidgetBase::WidgetType | type | ) |

Returns whether a widget is already on the diagram.

Parameters

  type | The type of the widget to check for.

Returns
  Returns pointer to the widget if it is on the diagram, NULL if not.

## Friends And Related Symbol Documentation

## ◆ DiagramProxyWidget

friend class DiagramProxyWidget
| friend

## ◆ UMLViewImageExporterModel

friend class UMLViewImageExporterModel
| friend

## Member Data Documentation

## ◆ m_autoIncrementSequence

bool UMLScene::m_autoIncrementSequence
| private

state of auto increment sequence

## ◆ m_bCreateObject

bool UMLScene::m_bCreateObject
| protected

## ◆ m_bDrawSelectedOnly

bool UMLScene::m_bDrawSelectedOnly
| protected

## ◆ m_bPaste

bool UMLScene::m_bPaste
| protected

## ◆ m_bPopupShowing

bool UMLScene::m_bPopupShowing
| private

Status of a popupmenu on view. True - a popup is on view.

## ◆ m_bStartedCut

bool UMLScene::m_bStartedCut
| protected

Flag if view/children started cut operation.

## ◆ m_bUseSnapComponentSizeToGrid

bool UMLScene::m_bUseSnapComponentSizeToGrid
| protected

Flag to use snap to grid for component size. The default is off.

## ◆ m_bUseSnapToGrid

bool UMLScene::m_bUseSnapToGrid
| protected

Flag to use snap to grid. The default is off.

## ◆ m_d

UMLScenePrivate* UMLScene::m_d
| private

## ◆ m_doc

UMLDoc* UMLScene::m_doc
| private

Pointer to the UMLDoc.

## ◆ m_Documentation

QString UMLScene::m_Documentation
| protected

The documentation of the diagram.

## ◆ m_fixX

qreal UMLScene::m_fixX
| private

Compensate for QGraphicsScene offsets, https://bugs.kde.org/show_bug.cgi?id=449622.

## ◆ m_fixY

qreal UMLScene::m_fixY
| private

Compensate for QGraphicsScene offsets, https://bugs.kde.org/show_bug.cgi?id=449622.

## ◆ m_isActivated

bool UMLScene::m_isActivated
| private

True if the view was activated after the deserialization(load).

## ◆ m_isOpen

bool UMLScene::m_isOpen
| protected

Flag is set to true when diagram is open, i.e. shown to the user.

## ◆ m_layoutGrid

LayoutGrid* UMLScene::m_layoutGrid
| private

layout grid in the background

## ◆ m_maxX

qreal UMLScene::m_maxX
| private

## ◆ m_maxY

qreal UMLScene::m_maxY
| private

Gather data for estimating required canvas size (used during loadFromXMI)

## ◆ m_minX

qreal UMLScene::m_minX
| private

## ◆ m_minY

qreal UMLScene::m_minY
| private

Gather data for estimating required canvas size (used during loadFromXMI)

## ◆ m_Name

QString UMLScene::m_Name
| protected

The name of the diagram.

## ◆ m_nCollaborationId

int UMLScene::m_nCollaborationId
| protected

Used for creating unique name of collaboration messages.

## ◆ m_nID

Uml::ID::Type UMLScene::m_nID
| protected

The ID of the view. Allocated by UMLDoc.

## ◆ m_nLocalID

Uml::ID::Type UMLScene::m_nLocalID
| protected

Contains the unique ID to allocate to a widget that needs an ID for the view. ObjectWidget is an example of this.

## ◆ m_Options

Settings::OptionState UMLScene::m_Options
| protected

Options used by view.

## ◆ m_PastePoint

QPointF UMLScene::m_PastePoint
| private

The offset at which to paste the clipboard.

## ◆ m_pFolder

UMLFolder* UMLScene::m_pFolder
| private

The folder in which this UMLView is contained.

## ◆ m_pIDChangesLog

IDChangeLog* UMLScene::m_pIDChangesLog
| private

LocalID Changes Log for paste actions.

## ◆ m_pImageExporter

UMLViewImageExporter* UMLScene::m_pImageExporter
| private

Used to export the view.

## ◆ m_pos

QPointF UMLScene::m_pos
| protected

## ◆ m_Type

Uml::DiagramType::Enum UMLScene::m_Type
| protected

The type of diagram to represent.

## ◆ m_view

UMLView* UMLScene::m_view
| private

The view to which this scene is related.

## ◆ s_defaultCanvasHeight

const qreal UMLScene::s_defaultCanvasHeight = 800
| static private

The default height of a diagram in pixels.

## ◆ s_defaultCanvasWidth

const qreal UMLScene::s_defaultCanvasWidth = 1100
| static private

The default width of a diagram in pixels.

## ◆ s_maxCanvasSize

const qreal UMLScene::s_maxCanvasSize = 100000.0
| static private

The maximum supported canvas size.

## ◆ s_sceneBorder

const qreal UMLScene::s_sceneBorder = 5.0
| static private

A border around the bounding rectangle of the elements in the scene.

## ◆ s_showDocumentationIndicator

bool UMLScene::s_showDocumentationIndicator = false
| static private

Status of documentation indicator.

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

- umbrello/umlscene.h
- umbrello/umlscene.cpp