umbrello API Documentation

UMLView Class Reference

UMLView instances represent diagrams. More...

#include <umlview.h>

List of all members.

Public Slots

void zoomIn ()
void zoomOut ()
void slotToolBarChanged (int c)
 Changes the current tool to the selected tool.
void slotObjectCreated (UMLObject *o)
void slotObjectRemoved (UMLObject *o)
void slotMenuSelection (int sel)
 When a menu selection has been made on the menu that this view created, this method gets called.
void slotRemovePopupMenu ()
 This slot is entered when an event has occurred on the views display, most likely a mouse event.
void slotActivate ()
 makes this view the active view by asking the document to show us
void slotCutSuccessful ()
 Connects to the signal that UMLApp emits when a cut operation is successful.
void slotShowView ()
 Called by menu when to show the instance of the view.
void show ()
 Overrides standard method from QWidget to resize canvas when it's shown.

Signals

void sigResetToolBar ()
void sigColorChanged (Uml::IDType)
void sigRemovePopupMenu ()
void sigClearAllSelected ()
void sigLineWidthChanged (Uml::IDType)
void sigSnapToGridToggled (bool)
void sigSnapComponentSizeToGridToggled (bool)
void sigShowGridToggled (bool)
void sigAssociationRemoved (AssociationWidget *)
 Emitted when an association is removed.
void sigWidgetRemoved (UMLWidget *)
 Emitted when a widget is removed.

Public Member Functions

 UMLView (UMLFolder *parentFolder)
 Constructor.
virtual ~UMLView ()
 Destructor.
UMLFoldergetFolder ()
 Return the UMLFolder in which this diagram lives.
void setFolder (UMLFolder *folder)
 Set the UMLFolder in which this diagram lives.
QString getDoc () const
 Return the documentation of the diagram.
void setDoc (const QString &doc)
 Set the documentation of the diagram.
QString getName () const
 Return the name of the diagram.
void setName (const QString &name)
 Set the name of the diagram.
Uml::Diagram_Type getType () const
 Returns the type of the diagram.
void setType (Uml::Diagram_Type type)
 Set the type of diagram.
QColor getFillColor () const
 Returns the fill color to use.
void setFillColor (const QColor &color)
 Set the background color.
QColor getLineColor () const
 Returns the line color to use.
void setLineColor (const QColor &color)
 Sets the line color.
uint getLineWidth () const
 Returns the line width to use.
void setLineWidth (uint width)
 Sets the line width.
Uml::IDType getID () const
 Returns the ID of the diagram.
void setID (Uml::IDType id)
 Sets the ID of the diagram.
int getZoom () const
 Returns the zoom of the diagram.
void setZoom (int zoom)
 Sets the zoom of the diagram.
int getCanvasHeight () const
 Returns the height of the diagram.
void setCanvasHeight (int height)
 Sets the height of the diagram.
int getCanvasWidth () const
 Returns the width of the diagram.
void setCanvasWidth (int width)
 Sets the height of the diagram.
bool getSnapToGrid () const
 Return whether to use snap to grid.
void setSnapToGrid (bool bSnap)
 Sets whether to snap to grid.
bool getSnapComponentSizeToGrid () const
 Return whether to use snap to grid for component size.
int getSnapX () const
 Returns the x grid size.
int getSnapY () const
 Returns the y grid size.
int snappedX (int x)
 Returns the input coordinate with possible grid-snap applied.
int snappedY (int y)
 Returns the input coordinate with possible grid-snap applied.
bool getShowSnapGrid () const
 Returns whether to show snap grid or not.
void setShowSnapGrid (bool bShow)
 Sets whether to show snap grid.
void setSnapComponentSizeToGrid (bool bSnap)
 Sets whether to snap to grid for component size.
bool getUseFillColor () const
 Returns whether to use the fill/background color.
void setUseFillColor (bool ufc)
 Sets whether to use the fill/background color.
QFont getFont () const
 Returns the font to use.
void setFont (QFont font, bool changeAllWidgets=false)
 Sets the font for the view and optionally all the widgets on the view.
bool getShowOpSig () const
 Returns whether to show operation signatures.
void setShowOpSig (bool bShowOpSig)
 Sets whether to show operation signatures.
const Settings::OptionState & getOptionState () const
 Returns the options being used.
void setOptionState (const Settings::OptionState &options)
 Sets the options to be used.
AssociationWidgetList & getAssociationList ()
 Returns a reference to the association list.
UMLWidgetList & getWidgetList ()
 Returns a reference to the widget list.
MessageWidgetList & getMessageList ()
 Returns a reference to the message list.
int currentZoom ()
 return the current zoom factor
void print (KPrinter *pPrinter, QPainter &pPainter)
 contains the implementation for printing functionality
void hideEvent (QHideEvent *he)
 Overrides the standard operation.
void showEvent (QShowEvent *se)
 Overrides the standard operation.
void checkMessages (ObjectWidget *w)
 Sees if a message is relevant to the given widget.
UMLWidgetfindWidget (Uml::IDType id)
 Finds a widget with the given ID.
AssociationWidgetfindAssocWidget (Uml::IDType id)
 Finds an association widget with the given ID.
AssociationWidgetfindAssocWidget (Uml::Association_Type at, UMLWidget *pWidgetA, UMLWidget *pWidgetB)
 Finds an association widget with the given type and widgets.
AssociationWidgetfindAssocWidget (UMLWidget *pWidgetA, UMLWidget *pWidgetB, const QString &roleNameB)
 Finds an association widget with the given widgets and the given role B name.
void removeWidget (UMLWidget *o)
 Remove a widget from view.
void setSelected (UMLWidget *w, QMouseEvent *me)
 Sets a widget to a selected state and adds it to a list of selected widgets.
void clearSelected ()
 Clear the selected widgets list.
void moveSelectedBy (int dX, int dY)
 Move all the selected widgets by a relative X and Y offset.
int getSelectCount (bool filterText=false) const
 Return the amount of widgets selected.
void selectionUseFillColor (bool useFC)
 Set the useFillColor variable to all selected widgets.
void selectionSetFont (const QFont &font)
 Set the font for all the currently selected items.
void selectionSetLineColor (const QColor &color)
 Set the line color for all the currently selected items.
void selectionSetLineWidth (uint width)
 Set the line width for all the currently selected items.
void selectionSetFillColor (const QColor &color)
 Set the fill color for all the currently selected items.
void selectionToggleShow (int sel)
 Toggles the show setting sel of all selected items.
void deleteSelection ()
 Delete the selected widgets list and the widgets in it.
void selectAll ()
 Selects all widgets.
Uml::IDType getLocalID ()
 Return a unique ID for the diagram.
bool widgetOnDiagram (Uml::IDType id)
 Returns whether a widget is already on the diagram.
bool isSavedInSeparateFile ()
 Returns true if this diagram resides in an externalized folder.
QPoint & getPos ()
 Get the pos variable.
void setPos (const QPoint &_pos)
 Set the pos variable.
void setMenu ()
 Sets the popup menu to use when clicking on a diagram background (rather than a widget or listView).
void resetToolbar ()
 Reset the toolbar.
bool getPaste () const
 Returns the status on whether in a paste state.
void setPaste (bool paste)
 Sets the status on whether in a paste state.
UMLObjectList getUMLObjects ()
 Returns a List of all the UMLObjects(Use Cases, Concepts and Actors) in the View.
void activate ()
 Activate all the objects and associations after a load from the clipboard.
AssociationWidgetList getSelectedAssocs ()
 Returns a list with all the selected associations from the diagram.
bool getSelectedWidgets (UMLWidgetList &WidgetList, 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.
void activateAfterLoad (bool bUseLog=false)
 Activate the view after a load a new file.
void endPartialWidgetPaste ()
void beginPartialWidgetPaste ()
void removeAssoc (AssociationWidget *pAssoc)
 Removes a AssociationWidget from a diagram.
void removeAssociations (UMLWidget *pWidget)
 Removes all the associations related to Widget.
void selectAssociations (bool bSelect)
 Sets each association as selected if the widgets it associates are selected.
void getWidgetAssocs (UMLObject *Obj, AssociationWidgetList &Associations)
 Fills Associations with all the associations that includes a widget related to object.
void removeAllAssociations ()
 Removes All the associations of the diagram.
void removeAllWidgets ()
 Removes All the widgets of the diagram.
void showDocumentation (UMLObject *object, bool overwrite)
 Calls the same method in the DocWindow.
void showDocumentation (UMLWidget *widget, bool overwrite)
 Calls the same method in the DocWindow.
void showDocumentation (AssociationWidget *widget, bool overwrite)
 Calls the same method in the DocWindow.
void updateDocumentation (bool clear)
 Calls the same method in the DocWindow.
void getDiagram (const QRect &rect, QPixmap &diagram)
 Returns the PNG picture of the paste operation.
void getDiagram (const QRect &area, QPainter &painter)
 Paint diagram to the paint device.
void copyAsImage (QPixmap *&pix)
 Returns the PNG picture of the paste operation.
UMLViewImageExportergetImageExporter ()
 Returns the imageExporter used to export the view.
bool addAssociation (AssociationWidget *pAssoc, bool isPasteOperation=false)
 Adds an association to the view from the given data.
void removeAssocInViewAndDoc (AssociationWidget *assoc)
 Removes an AssociationWidget from the association list and removes the corresponding UMLAssociation from the current UMLDoc.
bool addWidget (UMLWidget *pWidget, bool isPasteOperation=false)
 Adds a widget to the view from the given data.
QPoint getPastePoint ()
 Returns the offset point at which to place the paste from clipboard.
void resetPastePoint ()
 Reset the paste point.
void setStartedCut ()
 Called by the view or any of its children when they start a cut operation.
void createAutoAssociations (UMLWidget *widget)
 Creates automatically any Associations that the given UMLWidget may have on any diagram.
void createAutoAttributeAssociations (UMLWidget *widget)
 If the m_Type of the given widget is Uml::wt_Class then iterate through the class' attributes and create an association to each attribute type widget that is present on the current diagram.
void updateContainment (UMLCanvasObject *self)
 Refreshes containment association, i.e.
void setSnapX (int x)
 Sets the x grid size.
void setSnapY (int y)
 Sets the y grid size.
bool showPropDialog ()
 Shows the properties dialog for the view.
void setClassWidgetOptions (ClassOptionsPage *page)
 Sets some options for all the ClassWidget on the view.
void checkSelections ()
 Call before copying/cutting selected widgets.
bool checkUniqueSelection ()
 This function checks if the currently selected items have all the same type (class, interface, ...).
void clearDiagram ()
 Asks for confirmation and clears everything on the diagram.
void toggleSnapToGrid ()
 Changes snap to grid boolean.
void toggleSnapComponentSizeToGrid ()
 Changes snap to grid for component size boolean.
void toggleShowGrid ()
 Changes show grid boolean.
void fileLoaded ()
 Changes the zoom to the currently set level (now loaded from file) Called from UMLApp::slotUpdateViews().
void setCanvasSize (int width, int height)
 Sets the diagram width and height in pixels.
void resizeCanvasToItems ()
 Sets the size of the canvas to just fit on all the items.
virtual void saveToXMI (QDomDocument &qDoc, QDomElement &qElement)
 Creates the <diagram> tag and fills it with the contents of the diagram.
virtual bool loadFromXMI (QDomElement &qElement)
 Loads the <diagram> tag.
bool loadUISDiagram (QDomElement &qElement)
 Loads the <uisdiagram> tag of Unisys.IntegratePlus.2 generated files.
UMLWidgetloadWidgetFromXMI (QDomElement &widgetElement)
 Loads a <widget> element such as <UML:Class>, used by loadFromXMI() and the clipboard.
void addObject (UMLObject *object)
 Add an object to the application, and update the view.
void selectWidgets (int px, int py, int qx, int qy)
 Selects all the widgets within an internally kept rectangle.
ObjectWidgetonWidgetLine (const QPoint &point)
 Determine whether on a sequence diagram we have clicked on a line of an Object.
UMLWidgetgetFirstMultiSelectedWidget ()
 Return pointer to the first selected widget (for multi-selection).
UMLWidgetgetWidgetAt (QPoint p)
 Tests the given point against all widgets and returns the widget for which the point is within its bounding rectangle.
void setupNewWidget (UMLWidget *w)
 Initialize and announce a newly created widget.
bool getCreateObject () const
 Return whether we are currently creating an object.
void setCreateObject (bool bCreate)
 Set whether we are currently creating an object.
void emitRemovePopupMenu ()
 Emit the sigRemovePopupMenu Qt signal.
int generateCollaborationId ()
 Used for creating unique name of collaboration messages.

Static Public Attributes

static const int defaultCanvasSize = 1300
 The width and height of a diagram canvas in pixels.

Protected Member Functions

bool loadWidgetsFromXMI (QDomElement &qElement)
bool loadMessagesFromXMI (QDomElement &qElement)
bool loadAssociationsFromXMI (QDomElement &qElement)
bool loadUisDiagramPresentation (QDomElement &qElement)
void closeEvent (QCloseEvent *e)
 Override standard method.
void contentsDragEnterEvent (QDragEnterEvent *mouseEvent)
 Override standard method.
void contentsDropEvent (QDropEvent *mouseEvent)
 Override standard method.
QRect getDiagramRect ()
 Gets the smallest area to print.
void init ()
 Initializes key variables.
void contentsMouseReleaseEvent (QMouseEvent *mouseEvent)
 Overrides the standard operation.
void contentsMouseMoveEvent (QMouseEvent *mouseEvent)
 Overrides the standard operation.
void contentsMouseDoubleClickEvent (QMouseEvent *mouseEvent)
 Override standard method.
void contentsMousePressEvent (QMouseEvent *mouseEvent)
 Override standard method.
void selectWidgetsOfAssoc (AssociationWidget *a)
 Selects all the widgets of the given association widget.
void makeSelected (UMLWidget *uw)
 Calls setSelected on the given UMLWidget and enters it into the m_SelectedList while making sure it is there only once.
void updateComponentSizes ()
 Updates the size of all components in this view.
void findMaxBoundingRectangle (const FloatingTextWidget *ft, int &px, int &py, int &qx, int &qy)
 Find the maximum bounding rectangle of FloatingTextWidget widgets.
void forceUpdateWidgetFontMetrics (QPainter *painter)
 Force the widget font metrics to be updated next time the widgets are drawn.

Protected Attributes

Uml::IDType m_nLocalID
 Contains the unique ID to allocate to a widget that needs an ID for the view.
Uml::IDType m_nID
 The ID of the view.
Uml::Diagram_Type 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.
MessageWidgetList m_MessageList
 Contains all the data items for MessageWidgets on the diagram.
UMLWidgetList m_WidgetList
 Contains all the data for UMLWidgets on the diagram.
AssociationWidgetList m_AssociationList
 Contains all the data for AssociationWidgets on the diagram.
int m_nSnapX
 The snap to grid x size.
int m_nSnapY
 The snap to grid y size.
bool m_bUseSnapToGrid
 Determines whether to use snap to grid.
bool m_bUseSnapComponentSizeToGrid
 Determines whether to use snap to grid for component size.
bool m_bShowSnapGrid
 Determines whether to show the snap grid.
int m_nZoom
 The zoom level in percent, default 100.
int m_nCanvasWidth
 Width of canvas in pixels.
int m_nCanvasHeight
 Height of canvas in pixels.
int m_nCollaborationId
 Used for creating unique name of collaboration messages.
QPoint m_Pos
bool m_bCreateObject
bool m_bDrawSelectedOnly
bool m_bPaste
ListPopupMenum_pMenu
UMLWidgetList m_SelectedList
bool m_bStartedCut
 Flag if view/children started cut operation.

Friends

class UMLViewImageExporterModel


Detailed Description

UMLView instances represent diagrams.

The UMLApp instance manages a QWidgetStack of UMLView instances. The visible diagram is at the top of stack. The UMLView class inherits from QCanvasView and it owns the objects displayed on its related QCanvas (see m_WidgetList.)

Author:
Paul Hensgen <phensgen@techie.com> Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org

Definition at line 60 of file umlview.h.


Constructor & Destructor Documentation

UMLView::UMLView UMLFolder parentFolder  ) 
 

Constructor.

Definition at line 110 of file umlview.cpp.

References UMLApp::getDocument(), and init().

UMLView::~UMLView  )  [virtual]
 

Destructor.

Definition at line 180 of file umlview.cpp.

References removeAllWidgets().


Member Function Documentation

UMLFolder* UMLView::getFolder  )  [inline]
 

Return the UMLFolder in which this diagram lives.

Definition at line 80 of file umlview.h.

Referenced by UMLDoc::currentRoot().

void UMLView::setFolder UMLFolder folder  )  [inline]
 

Set the UMLFolder in which this diagram lives.

Definition at line 87 of file umlview.h.

Referenced by UMLDoc::loadDiagramsFromXMI().

QString UMLView::getDoc  )  const [inline]
 

Return the documentation of the diagram.

Definition at line 94 of file umlview.h.

References m_Documentation.

void UMLView::setDoc const QString &  doc  )  [inline]
 

Set the documentation of the diagram.

Definition at line 101 of file umlview.h.

References m_Documentation.

Referenced by UMLViewDialog::applyPage().

QString UMLView::getName  )  const
 

Return the name of the diagram.

Definition at line 207 of file umlview.cpp.

References m_Name.

Referenced by UMLViewDialog::checkName(), UMLListView::createItem(), UMLViewImageExporterModel::exportAllViews(), UMLFolder::findView(), isSavedInSeparateFile(), loadUISDiagram(), print(), UMLDoc::removeDiagram(), UMLDoc::renameChildUMLObject(), UMLDoc::renameDiagram(), UMLDoc::renameUMLObject(), saveToXMI(), NoteWidget::setDiagramLink(), UMLViewDialog::setupDiagramPropertiesPage(), UMLListView::slotDiagramCreated(), UMLListView::slotDiagramRenamed(), slotMenuSelection(), and UMLApp::slotUpdateViews().

void UMLView::setName const QString &  name  ) 
 

Set the name of the diagram.

Definition at line 211 of file umlview.cpp.

References m_Name.

Referenced by UMLViewDialog::checkName(), UMLListView::createDiagram(), UMLDoc::createDiagram(), loadFromXMI(), loadUISDiagram(), UMLListViewItem::okRename(), UMLDoc::renameChildUMLObject(), UMLDoc::renameDiagram(), UMLDoc::renameUMLObject(), and slotMenuSelection().

Uml::Diagram_Type UMLView::getType  )  const [inline]
 

Returns the type of the diagram.

Definition at line 118 of file umlview.h.

References m_Type.

Referenced by AssociationWidget::activate(), addAssociation(), AssocRules::allowAssociation(), UMLViewDialog::applyPage(), UMLDoc::changeCurrentView(), checkMessages(), contentsDragEnterEvent(), UMLClipboard::copy(), UMLListView::createItem(), UMLFolder::findView(), getDiagramRect(), ListPopupMenu::ListPopupMenu(), UMLDoc::loadDiagramsFromXMI(), UMLListViewItem::okRename(), removeWidget(), UMLDoc::renameDiagram(), setMenu(), UMLListView::slotDiagramCreated(), and UMLDoc::slotDiagramPopupMenu().

void UMLView::setType Uml::Diagram_Type  type  )  [inline]
 

Set the type of diagram.

Definition at line 125 of file umlview.h.

References m_Type.

Referenced by UMLListView::createDiagram(), and UMLDoc::createDiagram().

QColor UMLView::getFillColor  )  const
 

Returns the fill color to use.

Definition at line 837 of file umlview.cpp.

References m_Options.

Referenced by UMLWidget::slotColorChanged(), and ObjectWidget::slotColorChanged().

void UMLView::setFillColor const QColor &  color  ) 
 

Set the background color.

Parameters:
color The color to use.

Definition at line 841 of file umlview.cpp.

References getID(), and m_Options.

Referenced by UMLViewDialog::applyPage().

QColor UMLView::getLineColor  )  const
 

Returns the line color to use.

Definition at line 847 of file umlview.cpp.

References m_Options.

Referenced by ToolBarStateMessages::setFirstWidget(), UMLWidget::slotColorChanged(), ObjectWidget::slotColorChanged(), and LinePath::slotLineColorChanged().

void UMLView::setLineColor const QColor &  color  ) 
 

Sets the line color.

Parameters:
color The color to use.

Definition at line 851 of file umlview.cpp.

References getID(), and m_Options.

Referenced by UMLViewDialog::applyPage().

uint UMLView::getLineWidth  )  const
 

Returns the line width to use.

Definition at line 857 of file umlview.cpp.

References m_Options.

Referenced by ToolBarStateMessages::setFirstWidget(), UMLWidget::slotLineWidthChanged(), and LinePath::slotLineWidthChanged().

void UMLView::setLineWidth uint  width  ) 
 

Sets the line width.

Parameters:
width The width to use.

Definition at line 861 of file umlview.cpp.

References getID(), and m_Options.

Referenced by UMLViewDialog::applyPage(), and UMLApp::initStatusBar().

Uml::IDType UMLView::getID  )  const [inline]
 

Returns the ID of the diagram.

Definition at line 168 of file umlview.h.

References m_nID.

Referenced by UMLFolder::activateViews(), addWidget(), UMLDoc::createDiagram(), UMLFolder::findView(), findWidget(), UMLDoc::loadRedoData(), UMLDoc::loadUndoData(), UMLDoc::removeView(), UMLDoc::saveToXMI(), setFillColor(), setLineColor(), setLineWidth(), setupNewWidget(), slotActivate(), UMLWidget::slotColorChanged(), LinePath::slotLineColorChanged(), UMLWidget::slotLineWidthChanged(), LinePath::slotLineWidthChanged(), slotMenuSelection(), slotShowView(), UMLApp::slotTabChanged(), and widgetOnDiagram().

void UMLView::setID Uml::IDType  id  )  [inline]
 

Sets the ID of the diagram.

Definition at line 175 of file umlview.h.

References m_nID.

Referenced by addWidget(), UMLListView::createDiagram(), and UMLDoc::createDiagram().

int UMLView::getZoom  )  const [inline]
 

Returns the zoom of the diagram.

Definition at line 182 of file umlview.h.

References m_nZoom.

Referenced by activateAfterLoad(), and fileLoaded().

void UMLView::setZoom int  zoom  ) 
 

Sets the zoom of the diagram.

Definition at line 2786 of file umlview.cpp.

References currentZoom(), m_nZoom, and resizeCanvasToItems().

Referenced by activateAfterLoad(), UMLViewDialog::applyPage(), fileLoaded(), UMLApp::setZoom(), and UMLApp::slotZoomSliderMoved().

int UMLView::getCanvasHeight  )  const [inline]
 

Returns the height of the diagram.

Definition at line 194 of file umlview.h.

References m_nCanvasHeight.

void UMLView::setCanvasHeight int  height  )  [inline]
 

Sets the height of the diagram.

Definition at line 201 of file umlview.h.

References m_nCanvasHeight.

Referenced by setCanvasSize().

int UMLView::getCanvasWidth  )  const [inline]
 

Returns the width of the diagram.

Definition at line 208 of file umlview.h.

References m_nCanvasWidth.

void UMLView::setCanvasWidth int  width  )  [inline]
 

Sets the height of the diagram.

Definition at line 215 of file umlview.h.

References m_nCanvasWidth.

Referenced by setCanvasSize().

bool UMLView::getSnapToGrid  )  const [inline]
 

Return whether to use snap to grid.

Definition at line 222 of file umlview.h.

References m_bUseSnapToGrid.

Referenced by setSnapToGrid(), snappedX(), snappedY(), and toggleSnapToGrid().

void UMLView::setSnapToGrid bool  bSnap  ) 
 

Sets whether to snap to grid.

Definition at line 2757 of file umlview.cpp.

References getSnapToGrid(), and m_bUseSnapToGrid.

Referenced by UMLViewDialog::applyPage(), and toggleSnapToGrid().

bool UMLView::getSnapComponentSizeToGrid  )  const [inline]
 

Return whether to use snap to grid for component size.

Definition at line 234 of file umlview.h.

References m_bUseSnapComponentSizeToGrid.

Referenced by setSnapComponentSizeToGrid(), and toggleSnapComponentSizeToGrid().

int UMLView::getSnapX  )  const [inline]
 

Returns the x grid size.

Definition at line 241 of file umlview.h.

References m_nSnapX.

Referenced by UMLWidget::setSize(), and snappedX().

int UMLView::getSnapY  )  const [inline]
 

Returns the y grid size.

Definition at line 248 of file umlview.h.

References m_nSnapY.

Referenced by UMLWidget::setSize(), and snappedY().

int UMLView::snappedX int  x  ) 
 

Returns the input coordinate with possible grid-snap applied.

Definition at line 2617 of file umlview.cpp.

References getSnapToGrid(), and getSnapX().

Referenced by AssociationWidget::mouseMoveEvent(), UMLWidget::setX(), and UMLWidget::setY().

int UMLView::snappedY int  y  ) 
 

Returns the input coordinate with possible grid-snap applied.

Definition at line 2628 of file umlview.cpp.

References getSnapToGrid(), and getSnapY().

Referenced by AssociationWidget::mouseMoveEvent().

bool UMLView::getShowSnapGrid  )  const
 

Returns whether to show snap grid or not.

Definition at line 2768 of file umlview.cpp.

References m_bShowSnapGrid.

Referenced by getDiagram(), setShowSnapGrid(), and toggleShowGrid().

void UMLView::setShowSnapGrid bool  bShow  ) 
 

Sets whether to show snap grid.

Definition at line 2772 of file umlview.cpp.

References getShowSnapGrid(), and m_bShowSnapGrid.

Referenced by UMLViewDialog::applyPage(), getDiagram(), and toggleShowGrid().

void UMLView::setSnapComponentSizeToGrid bool  bSnap  ) 
 

Sets whether to snap to grid for component size.

Definition at line 2762 of file umlview.cpp.

References getSnapComponentSizeToGrid(), m_bUseSnapComponentSizeToGrid, and updateComponentSizes().

Referenced by UMLViewDialog::applyPage(), and toggleSnapComponentSizeToGrid().

bool UMLView::getUseFillColor  )  const
 

Returns whether to use the fill/background color.

Definition at line 829 of file umlview.cpp.

References m_Options.

Referenced by UMLWidget::slotColorChanged().

void UMLView::setUseFillColor bool  ufc  ) 
 

Sets whether to use the fill/background color.

Definition at line 833 of file umlview.cpp.

References m_Options.

Referenced by UMLViewDialog::applyPage().

QFont UMLView::getFont  )  const
 

Returns the font to use.

Definition at line 2648 of file umlview.cpp.

References m_Options.

Referenced by setupNewWidget().

void UMLView::setFont QFont  font,
bool  changeAllWidgets = false
 

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

Definition at line 2652 of file umlview.cpp.

References m_Options, m_WidgetList, and UMLWidget::setFont().

Referenced by UMLViewDialog::applyPage(), PackageWidget::draw(), EntityWidget::draw(), selectionSetFont(), and NoteWidget::setFont().

bool UMLView::getShowOpSig  )  const
 

Returns whether to show operation signatures.

Definition at line 2778 of file umlview.cpp.

References m_Options.

Referenced by FloatingTextWidget::setText(), and UMLViewDialog::setupDiagramPropertiesPage().

void UMLView::setShowOpSig bool  bShowOpSig  ) 
 

Sets whether to show operation signatures.

Definition at line 2782 of file umlview.cpp.

References m_Options.

Referenced by UMLViewDialog::applyPage().

const Settings::OptionState& UMLView::getOptionState  )  const [inline]
 

Returns the options being used.

Definition at line 310 of file umlview.h.

References m_Options.

Referenced by ClassifierWidget::changeToClass(), WidgetBase::init(), UMLWidget::init(), EnumWidget::init(), EntityWidget::init(), ClassifierWidget::init(), and isSavedInSeparateFile().

void UMLView::setOptionState const Settings::OptionState &  options  )  [inline]
 

Sets the options to be used.

Definition at line 317 of file umlview.h.

References m_Options.

Referenced by UMLViewDialog::applyPage(), UMLFolder::loadDiagramsFromXMI(), and UMLFolder::setViewOptions().

AssociationWidgetList& UMLView::getAssociationList  )  [inline]
 

Returns a reference to the association list.

Definition at line 324 of file umlview.h.

References m_AssociationList.

Referenced by ToolBarState::getAssociationAt().

UMLWidgetList& UMLView::getWidgetList  )  [inline]
 

Returns a reference to the widget list.

Definition at line 331 of file umlview.h.

References m_WidgetList.

Referenced by AssociationWidget::loadFromXMI(), ToolBarStateMessages::setSecondWidget(), and MessageWidget::slotMenuSelection().

MessageWidgetList& UMLView::getMessageList  )  [inline]
 

Returns a reference to the message list.

Definition at line 338 of file umlview.h.

References m_MessageList.

Referenced by ToolBarState::getMessageAt(), AssociationWidget::loadFromXMI(), and ToolBarStateMessages::setSecondWidget().

int UMLView::currentZoom  ) 
 

return the current zoom factor

Definition at line 2801 of file umlview.cpp.

Referenced by UMLViewDialog::setupDiagramPropertiesPage(), UMLApp::setupZoomMenu(), and setZoom().

void UMLView::print KPrinter *  pPrinter,
QPainter &  pPainter
 

contains the implementation for printing functionality

Definition at line 219 of file umlview.cpp.

References forceUpdateWidgetFontMetrics(), getDiagram(), getDiagramRect(), and getName().

Referenced by UMLDoc::print().

void UMLView::hideEvent QHideEvent *  he  ) 
 

Overrides the standard operation.

Definition at line 421 of file umlview.cpp.

References UMLApp::getWorkToolBar(), sigAssociationRemoved(), sigWidgetRemoved(), and slotToolBarChanged().

void UMLView::showEvent QShowEvent *  se  ) 
 

Overrides the standard operation.

Definition at line 396 of file umlview.cpp.

References UMLApp::getWorkToolBar(), resetToolbar(), sigAssociationRemoved(), sigWidgetRemoved(), and slotToolBarChanged().

void UMLView::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 682 of file umlview.cpp.

References getType(), m_MessageList, and removeAssociations().

Referenced by removeWidget().

UMLWidget * UMLView::findWidget Uml::IDType  id  ) 
 

Finds a 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 727 of file umlview.cpp.

References getID(), getLocalID(), m_MessageList, and m_WidgetList.

Referenced by MessageWidget::activate(), AssociationWidget::activate(), addAssociation(), and addWidget().

AssociationWidget * UMLView::findAssocWidget Uml::IDType  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 754 of file umlview.cpp.

References UMLObject::getID(), and m_AssociationList.

Referenced by createAutoAssociations().

AssociationWidget * UMLView::findAssocWidget Uml::Association_Type  at,
UMLWidget pWidgetA,
UMLWidget pWidgetB
 

Finds an association widget with the given type and widgets.

Parameters:
at The Association_Type 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 788 of file umlview.cpp.

References AssociationWidget::getAssocType(), WidgetBase::getID(), AssociationWidget::getWidgetID(), and m_AssociationList.

AssociationWidget * UMLView::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 767 of file umlview.cpp.

References AssociationWidget::getAssocType(), WidgetBase::getID(), AssociationWidget::getRoleName(), AssociationWidget::getWidgetID(), and m_AssociationList.

void UMLView::removeWidget UMLWidget o  ) 
 

Remove a widget from view.

Parameters:
o The widget to remove.

Definition at line 804 of file umlview.cpp.

References checkMessages(), WidgetBase::getBaseType(), getType(), m_MessageList, m_WidgetList, removeAssociations(), UMLDoc::setModified(), sigWidgetRemoved(), and slotRemovePopupMenu().

Referenced by MessageWidget::cleanup(), AssociationWidget::cleanup(), deleteSelection(), FloatingTextWidget::handleRename(), removeAllWidgets(), AssociationWidget::setName(), and AssociationWidget::slotMenuSelection().

void UMLView::setSelected UMLWidget w,
QMouseEvent *  me
 

Sets a widget to a selected state and adds it to a list of selected widgets.

Parameters:
w The widget to set to selected.
me The mouse event containing the information about the selection.

Definition at line 939 of file umlview.cpp.

References UMLApp::slotCopyChanged(), and updateDocumentation().

Referenced by UMLWidgetController::deselect(), makeSelected(), UMLWidgetController::selectMultiple(), and selectWidgetsOfAssoc().

void UMLView::clearSelected  ) 
 

Clear the selected widgets list.

Definition at line 955 of file umlview.cpp.

Referenced by ToolBarState::mouseDoubleClickEmpty(), ToolBarState::mousePressEmpty(), UMLWidgetController::resetSelection(), UMLWidgetController::selectSingle(), and selectWidgets().

void UMLView::moveSelectedBy int  dX,
int  dY
 

Move all the selected widgets by a relative X and Y offset.

Parameters:
dX The distance to move horizontally.
dY The distance to move vertically.

Definition at line 962 of file umlview.cpp.

Referenced by UMLApp::handleCursorKeyReleaseEvent().

int UMLView::getSelectCount 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 tr_Floating.) Default: Count all widgets.
Returns:
Number of widgets selected.

Definition at line 1401 of file umlview.cpp.

References WidgetBase::getBaseType(), and FloatingTextWidget::getRole().

Referenced by UMLApp::handleCursorKeyReleaseEvent(), UMLWidgetController::mousePressEvent(), UMLWidgetController::mouseReleaseEvent(), UMLWidgetController::setSelectionBounds(), UMLApp::slotEditCopy(), UMLApp::slotEditCut(), MessageWidget::slotWidgetMoved(), and UMLWidget::startPopupMenu().

void UMLView::selectionUseFillColor bool  useFC  ) 
 

Set the useFillColor variable to all selected widgets.

Parameters:
useFC The state to set the widget to.

Definition at line 967 of file umlview.cpp.

Referenced by UMLWidget::slotMenuSelection().

void UMLView::selectionSetFont const QFont &  font  ) 
 

Set the font for all the currently selected items.

Definition at line 973 of file umlview.cpp.

References setFont().

void UMLView::selectionSetLineColor const QColor &  color  ) 
 

Set the line color for all the currently selected items.

Definition at line 980 of file umlview.cpp.

References getSelectedAssocs(), UMLWidget::setLineColor(), and WidgetBase::setUsesDiagramLineColour().

Referenced by AssociationWidget::slotMenuSelection().

void UMLView::selectionSetLineWidth uint  width  ) 
 

Set the line width for all the currently selected items.

Definition at line 994 of file umlview.cpp.

References getSelectedAssocs(), UMLWidget::setLineWidth(), and WidgetBase::setUsesDiagramLineWidth().

void UMLView::selectionSetFillColor const QColor &  color  ) 
 

Set the fill color for all the currently selected items.

Definition at line 1008 of file umlview.cpp.

void UMLView::selectionToggleShow int  sel  ) 
 

Toggles the show setting sel of all selected items.

Definition at line 1019 of file umlview.cpp.

References WidgetBase::getBaseType().

Referenced by UMLWidget::slotMenuSelection().

void UMLView::deleteSelection  ) 
 

Delete the selected widgets list and the widgets in it.

Definition at line 1074 of file umlview.cpp.

References UMLWidget::getSelected(), m_AssociationList, m_MessageList, removeAssoc(), and removeWidget().

Referenced by slotCutSuccessful(), UMLApp::slotDeleteSelectedWidget(), and slotMenuSelection().

void UMLView::selectAll  ) 
 

Selects all widgets.

Definition at line 1128 of file umlview.cpp.

References selectWidgets().

Referenced by UMLApp::slotSelectAll().

Uml::IDType UMLView::getLocalID  ) 
 

Return a unique ID for the diagram.

Used by the ObjectWidget class.

Returns:
Return a unique ID for the diagram.

Definition at line 1133 of file umlview.cpp.

References m_nLocalID.

Referenced by addWidget(), and findWidget().

bool UMLView::widgetOnDiagram Uml::IDType  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 702 of file umlview.cpp.

References getID(), m_MessageList, and m_WidgetList.

Referenced by contentsDragEnterEvent().

bool UMLView::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 1138 of file umlview.cpp.

References UMLListView::findItem(), UMLFolder::getFolderFile(), UMLApp::getListView(), getName(), getOptionState(), UMLListViewItem::getType(), UMLListViewItem::getUMLObject(), and m_nID.

QPoint& UMLView::getPos  )  [inline]
 

Get the pos variable.

Used internally to keep track of the cursor.

Definition at line 521 of file umlview.h.

void UMLView::setPos const QPoint &  _pos  )  [inline]
 

Set the pos variable.

Used internally to keep track of the cursor.

Parameters:
_pos The position to set to.

Definition at line 530 of file umlview.h.

Referenced by ToolBarState::mousePress(), and ToolBarState::mouseRelease().

void UMLView::setMenu  ) 
 

Sets the popup menu to use when clicking on a diagram background (rather than a widget or listView).

Definition at line 2322 of file umlview.cpp.

References getType(), slotMenuSelection(), and slotRemovePopupMenu().

Referenced by ToolBarStateArrow::mouseReleaseEmpty().

void UMLView::resetToolbar  )  [inline]
 

Reset the toolbar.

Definition at line 543 of file umlview.h.

Referenced by UMLWidgetController::resetSelection(), and showEvent().

bool UMLView::getPaste  )  const [inline]
 

Returns the status on whether in a paste state.

Returns:
Returns the status on whether in a paste state.

Definition at line 552 of file umlview.h.

Referenced by UMLWidget::activate().

void UMLView::setPaste bool  paste  )  [inline]
 

Sets the status on whether in a paste state.

Definition at line 559 of file umlview.h.

Referenced by ToolBarState::mousePress().

UMLObjectList UMLView::getUMLObjects  ) 
 

Returns a List of all the UMLObjects(Use Cases, Concepts and Actors) in the View.

Definition at line 1329 of file umlview.cpp.

References WidgetBase::getBaseType(), WidgetBase::getUMLObject(), and m_WidgetList.

Referenced by UMLClipboard::copy().

void UMLView::activate  ) 
 

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

Definition at line 1353 of file umlview.cpp.

References AssociationWidget::activate(), UMLWidget::activate(), WidgetBase::getBaseType(), UMLDoc::getChangeLog(), UMLWidget::isActivated(), m_AssociationList, m_MessageList, m_WidgetList, and AssociationWidget::moveEntireAssoc().

Referenced by activateAfterLoad(), and UMLListView::createDiagram().

AssociationWidgetList UMLView::getSelectedAssocs  ) 
 

Returns a list with all the selected associations from the diagram.

Definition at line 1433 of file umlview.cpp.

References m_AssociationList.

Referenced by UMLClipboard::copy(), getDiagram(), UMLWidgetController::mouseMoveEvent(), selectionSetLineColor(), and selectionSetLineWidth().

bool UMLView::getSelectedWidgets UMLWidgetList &  WidgetList,
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:
WidgetList The UMLWidgetList to fill.
filterText Don't append the text, unless their role is tr_Floating

Definition at line 1419 of file umlview.cpp.

References WidgetBase::getBaseType(), and FloatingTextWidget::getRole().

Referenced by UMLClipboard::copy(), and UMLWidgetController::setSelectionBounds().

void UMLView::activateAfterLoad bool  bUseLog = false  ) 
 

Activate the view after a load a new file.

Definition at line 1716 of file umlview.cpp.

References activate(), getZoom(), resizeCanvasToItems(), and setZoom().

Referenced by UMLFolder::activateViews().

void UMLView::removeAssoc AssociationWidget pAssoc  ) 
 

Removes a AssociationWidget from a diagram.

Parameters:
pAssoc Pointer to the AssociationWidget.

Definition at line 1749 of file umlview.cpp.

References m_AssociationList, UMLDoc::setModified(), and sigAssociationRemoved().

Referenced by deleteSelection(), removeAllAssociations(), removeAssociations(), removeAssocInViewAndDoc(), AssociationWidget::slotAttributeRemoved(), and updateContainment().

void UMLView::removeAssociations UMLWidget pWidget  ) 
 

Removes all the associations related to Widget.

Parameters:
pWidget Pointer to the widget to remove.

Definition at line 1789 of file umlview.cpp.

References AssociationWidget::contains(), m_AssociationList, and removeAssoc().

Referenced by checkMessages(), and removeWidget().

void UMLView::selectAssociations bool  bSelect  ) 
 

Sets each association as selected if the widgets it associates are selected.

Definition at line 1800 of file umlview.cpp.

References UMLWidget::getSelected(), AssociationWidget::getWidget(), m_AssociationList, and AssociationWidget::setSelected().

Referenced by copyAsImage(), and selectWidgets().

void UMLView::getWidgetAssocs UMLObject Obj,
AssociationWidgetList &  Associations
 

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

Definition at line 1815 of file umlview.cpp.

References WidgetBase::getUMLObject(), AssociationWidget::getWidget(), and m_AssociationList.

void UMLView::removeAllAssociations  ) 
 

Removes All the associations of the diagram.

Definition at line 1833 of file umlview.cpp.

References m_AssociationList, and removeAssoc().

Referenced by UMLFolder::removeAllViews().

void UMLView::removeAllWidgets  ) 
 

Removes All the widgets of the diagram.

Definition at line 1846 of file umlview.cpp.

References m_WidgetList, and removeWidget().

Referenced by clearDiagram(), and ~UMLView().

void UMLView::showDocumentation UMLObject object,
bool  overwrite
 

Calls the same method in the DocWindow.

Definition at line 1862 of file umlview.cpp.

Referenced by contentsMousePressEvent(), UMLWidget::setSelected(), and showDocumentation().

void UMLView::showDocumentation UMLWidget widget,
bool  overwrite
 

Calls the same method in the DocWindow.

Definition at line 1867 of file umlview.cpp.

References showDocumentation().

void UMLView::showDocumentation AssociationWidget widget,
bool  overwrite
 

Calls the same method in the DocWindow.

Definition at line 1872 of file umlview.cpp.

References showDocumentation().

void UMLView::updateDocumentation bool  clear  ) 
 

Calls the same method in the DocWindow.

Definition at line 1877 of file umlview.cpp.

Referenced by setSelected().

void UMLView::getDiagram const QRect &  rect,
QPixmap &  diagram
 

Returns the PNG picture of the paste operation.

Parameters:
rect the area of the diagram to copy
diagram the class to store PNG picture of the paste operation.

Definition at line 1277 of file umlview.cpp.

Referenced by copyAsImage(), and print().

void UMLView::getDiagram const QRect &  area,
QPainter &  painter
 

Paint diagram to the paint device.

Definition at line 1284 of file umlview.cpp.

References getSelectedAssocs(), getShowSnapGrid(), AssociationWidget::setSelected(), UMLWidget::setSelected(), and setShowSnapGrid().

void UMLView::copyAsImage QPixmap *&  pix  ) 
 

Returns the PNG picture of the paste operation.

Definition at line 2250 of file umlview.cpp.

References findMaxBoundingRectangle(), AssociationWidget::getChangeWidget(), getDiagram(), getDiagramRect(), AssociationWidget::getMultiWidget(), AssociationWidget::getRoleWidget(), AssociationWidget::getSelected(), m_AssociationList, and selectAssociations().

Referenced by UMLClipboard::copy().

UMLViewImageExporter * UMLView::getImageExporter  ) 
 

Returns the imageExporter used to export the view.

Returns:
The imageExporter used to export the view.

Definition at line 1321 of file umlview.cpp.

Referenced by UMLListView::popupMenuSel(), and UMLApp::slotCurrentViewExportImage().

bool UMLView::addAssociation AssociationWidget pAssoc,
bool  isPasteOperation = false
 

Adds an association to the view from the given data.

Use this method when pasting.

Definition at line 1621 of file umlview.cpp.

References addWidget(), AssocRules::allowAssociation(), IDChangeLog::findNewID(), findWidget(), getType(), UMLDoc::loading(), m_AssociationList, and UMLWidget::updateComponentSize().

Referenced by createAutoAssociations().

void UMLView::removeAssocInViewAndDoc AssociationWidget assoc  ) 
 

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

Definition at line 1760 of file umlview.cpp.

References Model_Utils::convert_OT_LVT(), UMLObject::getID(), UMLApp::getListView(), UMLListView::moveObject(), removeAssoc(), UMLDoc::removeAssociation(), and UMLListView::theLogicalView().

Referenced by AssociationWidget::slotMenuSelection().

bool UMLView::addWidget UMLWidget pWidget,
bool  isPasteOperation = false
 

Adds a widget to the view from the given data.

Use this method when pasting.

Definition at line 1445 of file umlview.cpp.

References IDChangeLog::addIDChange(), UMLDoc::assignNewID(), IDChangeLog::findNewID(), UMLDoc::findObjectById(), findWidget(), WidgetBase::getBaseType(), FloatingTextWidget::getDisplayText(), MessageWidget::getFloatingTextWidget(), WidgetBase::getID(), getID(), getLocalID(), UMLDoc::getName(), AssociationWidget::getName(), m_MessageList, m_WidgetList, WidgetBase::setID(), setID(), UMLWidget::setX(), and UMLWidget::setY().

Referenced by addAssociation(), UMLApp::initStatusBar(), UMLApp::setCurrentView(), and AssociationWidget::setName().

QPoint UMLView::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 2606 of file umlview.cpp.

void UMLView::resetPastePoint  ) 
 

Reset the paste point.

Definition at line 2613 of file umlview.cpp.

Referenced by MessageWidget::activate().

void UMLView::setStartedCut  )  [inline]
 

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

Definition at line 710 of file umlview.h.

References m_bStartedCut.

Referenced by AssociationWidget::slotMenuSelection().

void UMLView::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 1930 of file umlview.cpp.

References addAssociation(), AssociationWidget::calculateEndingPoints(), UMLPackage::containedObjects(), createAutoAttributeAssociations(), findAssocWidget(), UMLCanvasObject::getAssociations(), UMLAssociation::getAssocType(), UMLObject::getBaseType(), WidgetBase::getID(), UMLObject::getID(), UMLAssociation::getObject(), WidgetBase::getUMLObject(), UMLObject::getUMLPackage(), m_Type, m_WidgetList, AssociationWidget::setActivated(), AssociationWidget::setAssocType(), AssociationWidget::setUMLObject(), AssociationWidget::setWidget(), and AssociationWidget::syncToModel().

void UMLView::createAutoAttributeAssociations UMLWidget widget  ) 
 

If the m_Type of the given widget is Uml::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 2098 of file umlview.cpp.

References UMLClassifier::getAttributeList(), UMLObject::getBaseType(), UMLClassifierListItem::getType(), WidgetBase::getUMLObject(), m_Type, and UMLClassifier::originType().

Referenced by createAutoAssociations(), and UMLWidget::updateWidget().

void UMLView::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 1881 of file umlview.cpp.

References AssociationWidget::calculateEndingPoints(), AssociationWidget::getAssocType(), WidgetBase::getUMLObject(), AssociationWidget::getWidget(), m_AssociationList, m_WidgetList, removeAssoc(), and AssociationWidget::setActivated().

Referenced by UMLListView::addAtContainer(), and UMLListView::moveObject().

void UMLView::setSnapX int  x  )  [inline]
 

Sets the x grid size.

Definition at line 742 of file umlview.h.

References m_nSnapX.

Referenced by UMLViewDialog::applyPage().

void UMLView::setSnapY int  y  )  [inline]
 

Sets the y grid size.

Definition at line 750 of file umlview.h.

References m_nSnapY.

Referenced by UMLViewDialog::applyPage().

bool UMLView::showPropDialog  ) 
 

Shows the properties dialog for the view.

Definition at line 2639 of file umlview.cpp.

Referenced by UMLListView::popupMenuSel(), UMLApp::slotCurrentViewProperties(), and slotMenuSelection().

void UMLView::setClassWidgetOptions ClassOptionsPage page  ) 
 

Sets some options for all the ClassWidget on the view.

Definition at line 2662 of file umlview.cpp.

References WidgetBase::getBaseType(), and m_WidgetList.

Referenced by UMLViewDialog::applyPage().

void UMLView::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 2676 of file umlview.cpp.

References m_AssociationList.

Referenced by UMLClipboard::copy().

bool UMLView::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 2714 of file umlview.cpp.

References WidgetBase::getBaseType().

void UMLView::clearDiagram  ) 
 

Asks for confirmation and clears everything on the diagram.

Called from menus.

Definition at line 2737 of file umlview.cpp.

References removeAllWidgets().

Referenced by UMLApp::slotCurrentViewClearDiagram(), and slotMenuSelection().

void UMLView::toggleSnapToGrid  ) 
 

Changes snap to grid boolean.

Called from menus.

Definition at line 2745 of file umlview.cpp.

References getSnapToGrid(), and setSnapToGrid().

Referenced by UMLApp::slotCurrentViewToggleSnapToGrid(), and slotMenuSelection().

void UMLView::toggleSnapComponentSizeToGrid  ) 
 

Changes snap to grid for component size boolean.

Called from menus.

Definition at line 2749 of file umlview.cpp.

References getSnapComponentSizeToGrid(), and setSnapComponentSizeToGrid().

void UMLView::toggleShowGrid  ) 
 

Changes show grid boolean.

Called from menus.

Definition at line 2753 of file umlview.cpp.

References getShowSnapGrid(), and setShowSnapGrid().

Referenced by UMLApp::slotCurrentViewToggleShowGrid(), and slotMenuSelection().

void UMLView::fileLoaded  ) 
 

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

Definition at line 2817 of file umlview.cpp.

References getZoom(), resizeCanvasToItems(), and setZoom().

Referenced by UMLApp::slotUpdateViews().

void UMLView::setCanvasSize int  width,
int  height
 

Sets the diagram width and height in pixels.

Definition at line 2822 of file umlview.cpp.

References setCanvasHeight(), and setCanvasWidth().

Referenced by resizeCanvasToItems().

void UMLView::resizeCanvasToItems  ) 
 

Sets the size of the canvas to just fit on all the items.

Definition at line 2828 of file umlview.cpp.

References getDiagramRect(), and setCanvasSize().

Referenced by activateAfterLoad(), fileLoaded(), UMLDoc::loadRedoData(), UMLDoc::loadUndoData(), UMLWidgetController::mouseMoveEvent(), AssociationWidget::mouseMoveEvent(), UMLWidgetController::resize(), SeqLineWidget::setEndOfLine(), setupNewWidget(), setZoom(), and show().

void UMLView::saveToXMI QDomDocument &  qDoc,
QDomElement &  qElement
[virtual]
 

Creates the <diagram> tag and fills it with the contents of the diagram.

Definition at line 2884 of file umlview.cpp.

References WidgetBase::getBaseType(), getName(), m_AssociationList, m_bShowSnapGrid, m_bUseSnapComponentSizeToGrid, m_bUseSnapToGrid, m_Documentation, m_MessageList, m_nCanvasHeight, m_nCanvasWidth, m_nID, m_nLocalID, m_nSnapX, m_nSnapY, m_nZoom, m_Options, m_Type, m_WidgetList, and UMLWidget::saveToXMI().

Referenced by UMLFolder::saveContents(), and UMLDrag::setUMLDataClip2().

bool UMLView::loadFromXMI QDomElement &  qElement  )  [virtual]
 

Loads the <diagram> tag.

Definition at line 2965 of file umlview.cpp.

References defaultCanvasSize, m_bShowSnapGrid, m_bUseSnapComponentSizeToGrid, m_bUseSnapToGrid, m_Documentation, m_nCanvasHeight, m_nCanvasWidth, m_nID, m_nLocalID, m_nSnapX, m_nSnapY, m_nZoom, m_Options, m_Type, and setName().

Referenced by UMLDrag::decodeClip2(), UMLDoc::loadDiagramsFromXMI(), and UMLFolder::loadDiagramsFromXMI().

bool UMLView::loadUISDiagram QDomElement &  qElement  ) 
 

Loads the <uisdiagram> tag of Unisys.IntegratePlus.2 generated files.

Definition at line 3317 of file umlview.cpp.

References UMLApp::getListView(), getName(), m_nID, m_Type, UMLDoc::setMainViewID(), setName(), UMLListViewItem::setText(), and UMLListView::theLogicalView().

Referenced by UMLDoc::loadDiagramsFromXMI().

UMLWidget * UMLView::loadWidgetFromXMI QDomElement &  widgetElement  ) 
 

Loads a <widget> element such as <UML:Class>, used by loadFromXMI() and the clipboard.

Definition at line 3123 of file umlview.cpp.

References UMLWidget::cleanup(), UMLWidget::loadFromXMI(), and Widget_Factory::makeWidgetFromXMI().

Referenced by UMLDrag::decodeClip4().

void UMLView::addObject UMLObject object  ) 
 

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

Definition at line 3206 of file umlview.cpp.

References UMLDoc::addUMLObject(), and UMLDoc::signalUMLObjectCreated().

Referenced by UMLWidget::slotMenuSelection().

void UMLView::selectWidgets int  px,
int  py,
int  qx,
int  qy
 

Selects all the widgets within an internally kept rectangle.

Definition at line 1208 of file umlview.cpp.

References clearSelected(), FloatingTextWidget::getLink(), MessageWidget::getWidget(), m_MessageList, m_WidgetList, makeSelected(), selectAssociations(), and selectWidgetsOfAssoc().

Referenced by ToolBarStateArrow::mouseMoveEmpty(), and selectAll().

ObjectWidget * UMLView::onWidgetLine const QPoint &  point  ) 
 

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 648 of file umlview.cpp.

References ObjectWidget::getLocalID(), UMLWidget::getName(), ObjectWidget::getSeqLine(), m_WidgetList, and SeqLineWidget::onWidget().

Referenced by ToolBarStateMessages::setCurrentElement().

UMLWidget* UMLView::getFirstMultiSelectedWidget  )  [inline]
 

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

Definition at line 869 of file umlview.h.

Referenced by UMLWidget::slotMenuSelection().

UMLWidget * UMLView::getWidgetAt QPoint  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. Does not use or modify the m_pOnWidget member.

Definition at line 666 of file umlview.cpp.

References m_WidgetList, and UMLWidget::onWidget().

Referenced by ToolBarState::mouseDoubleClick(), AssociationWidget::mouseMoveEvent(), UMLWidgetController::mouseReleaseEvent(), ToolBarStateMessages::setCurrentElement(), and UMLWidget::setSelected().

void UMLView::setupNewWidget UMLWidget w  ) 
 

Initialize and announce a newly created widget.

Auxiliary to contentsMouseReleaseEvent().

Definition at line 371 of file umlview.cpp.

References getFont(), getID(), m_WidgetList, resizeCanvasToItems(), and UMLDoc::setModified().

Referenced by slotMenuSelection().

bool UMLView::getCreateObject  )  const [inline]
 

Return whether we are currently creating an object.

Definition at line 891 of file umlview.h.

void UMLView::setCreateObject bool  bCreate  )  [inline]
 

Set whether we are currently creating an object.

Definition at line 898 of file umlview.h.

void UMLView::emitRemovePopupMenu  )  [inline]
 

Emit the sigRemovePopupMenu Qt signal.

Definition at line 905 of file umlview.h.

Referenced by ToolBarState::mousePress().

int UMLView::generateCollaborationId  ) 
 

Used for creating unique name of collaboration messages.

Definition at line 215 of file umlview.cpp.

References m_nCollaborationId.

Referenced by AssociationWidget::AssociationWidget().

void UMLView::closeEvent QCloseEvent *  e  )  [protected]
 

Override standard method.

Definition at line 1829 of file umlview.cpp.

void UMLView::contentsDragEnterEvent QDragEnterEvent *  mouseEvent  )  [protected]
 

Override standard method.

Definition at line 511 of file umlview.cpp.

References UMLDoc::findObjectById(), UMLObject::getAbstract(), UMLObject::getBaseType(), UMLDrag::getClip3TypeAndID(), UMLObject::getStereotype(), getType(), and widgetOnDiagram().

void UMLView::contentsDropEvent QDropEvent *  mouseEvent  )  [protected]
 

Override standard method.

Definition at line 607 of file umlview.cpp.

References UMLDoc::findObjectById(), WidgetBase::getBaseType(), UMLDrag::getClip3TypeAndID(), m_nZoom, m_WidgetList, UMLWidget::onWidget(), and NoteWidget::setDiagramLink().

QRect UMLView::getDiagramRect  )  [protected]
 

Gets the smallest area to print.

Returns:
Returns the smallest area to print.

Definition at line 871 of file umlview.cpp.

References AssociationWidget::getAssocLineRectangle(), ObjectWidget::getEndLineY(), getType(), m_AssociationList, and m_WidgetList.

Referenced by copyAsImage(), print(), and resizeCanvasToItems().

void UMLView::init  )  [protected]
 

Initializes key variables.

Definition at line 116 of file umlview.cpp.

References defaultCanvasSize, ToolBarStateFactory::getState(), m_AssociationList, m_bShowSnapGrid, m_bStartedCut, m_bUseSnapComponentSizeToGrid, m_bUseSnapToGrid, m_Documentation, m_nCanvasHeight, m_nCanvasWidth, m_nCollaborationId, m_nID, m_nSnapX, m_nSnapY, m_nZoom, m_Type, slotCutSuccessful(), and slotRemovePopupMenu().

Referenced by UMLView().

void UMLView::contentsMouseReleaseEvent QMouseEvent *  mouseEvent  )  [protected]
 

Overrides the standard operation.

Calls the same method in the current tool bar state.

Definition at line 384 of file umlview.cpp.

References ToolBarState::mouseRelease().

void UMLView::contentsMouseMoveEvent QMouseEvent *  mouseEvent  )  [protected]
 

Overrides the standard operation.

Calls the same method in the current tool bar state.

Definition at line 722 of file umlview.cpp.

References ToolBarState::mouseMove().

void UMLView::contentsMouseDoubleClickEvent QMouseEvent *  mouseEvent  )  [protected]
 

Override standard method.

Calls the same method in the current tool bar state.

Definition at line 867 of file umlview.cpp.

References ToolBarState::mouseDoubleClick().

void UMLView::contentsMousePressEvent QMouseEvent *  mouseEvent  )  [protected]
 

Override standard method.

Calls the same method in the current tool bar state.

Definition at line 1171 of file umlview.cpp.

References ToolBarState::mousePress(), and showDocumentation().

void UMLView::selectWidgetsOfAssoc AssociationWidget a  )  [protected]
 

Selects all the widgets of the given association widget.

Definition at line 1192 of file umlview.cpp.

References makeSelected(), and setSelected().

Referenced by selectWidgets().

void UMLView::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.

Definition at line 1184 of file umlview.cpp.

References setSelected().

Referenced by selectWidgets(), and selectWidgetsOfAssoc().

void UMLView::updateComponentSizes  )  [protected]
 

Updates the size of all components in this view.

Definition at line 2855 of file umlview.cpp.

References m_WidgetList, and UMLWidget::updateComponentSize().

Referenced by setSnapComponentSizeToGrid().

void UMLView::findMaxBoundingRectangle const FloatingTextWidget ft,
int &  px,
int &  py,
int &  qx,
int &  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.

Definition at line 2230 of file umlview.cpp.

Referenced by copyAsImage().

void UMLView::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.

Definition at line 2874 of file umlview.cpp.

References UMLWidget::forceUpdateFontMetrics(), and m_WidgetList.

Referenced by print().

void UMLView::slotToolBarChanged int  c  )  [slot]
 

Changes the current tool to the selected tool.

The current tool is cleaned and the selected tool initialized.

Definition at line 388 of file umlview.cpp.

References ToolBarState::cleanBeforeChange(), ToolBarStateFactory::getState(), and ToolBarState::init().

Referenced by hideEvent(), and showEvent().

void UMLView::slotMenuSelection int  sel  )  [slot]
 

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

Definition at line 2382 of file umlview.cpp.

References FloatingTextWidget::changeTextDlg(), clearDiagram(), deleteSelection(), UMLApp::editCutCopy(), UMLViewImageExporter::exportView(), getID(), getName(), FloatingTextWidget::getText(), FloatingTextWidget::isTextValid(), UMLDoc::loadRedoData(), UMLDoc::loadUndoData(), UMLDoc::removeDiagram(), WidgetBase::setID(), UMLDoc::setModified(), setName(), UMLWidget::setName(), StateWidget::setName(), setupNewWidget(), showPropDialog(), UMLDoc::signalDiagramRenamed(), UMLApp::slotEditPaste(), toggleShowGrid(), and toggleSnapToGrid().

Referenced by setMenu(), and slotRemovePopupMenu().

void UMLView::slotRemovePopupMenu  )  [slot]
 

This slot is entered when an event has occurred on the views display, most likely a mouse event.

Before it sends out that mouse event everyone that displays a menu on the views surface (widgets and this ) thould remove any menu. This stops more then one menu bieing displayed.

Definition at line 2374 of file umlview.cpp.

References slotMenuSelection().

Referenced by init(), removeWidget(), and setMenu().

void UMLView::slotActivate  )  [slot]
 

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

Definition at line 1325 of file umlview.cpp.

References UMLDoc::changeCurrentView(), and getID().

void UMLView::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.

Definition at line 2595 of file umlview.cpp.

References deleteSelection(), and m_bStartedCut.

Referenced by init().

void UMLView::slotShowView  )  [slot]
 

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

Definition at line 2602 of file umlview.cpp.

References getID().

void UMLView::show  )  [slot]
 

Overrides standard method from QWidget to resize canvas when it's shown.

Definition at line 2850 of file umlview.cpp.

References resizeCanvasToItems().

void UMLView::sigAssociationRemoved AssociationWidget  )  [signal]
 

Emitted when an association is removed.

Referenced by hideEvent(), removeAssoc(), and showEvent().

void UMLView::sigWidgetRemoved UMLWidget  )  [signal]
 

Emitted when a widget is removed.

Referenced by hideEvent(), removeWidget(), and showEvent().


Member Data Documentation

const int UMLView::defaultCanvasSize = 1300 [static]
 

The width and height of a diagram canvas in pixels.

Definition at line 104 of file umlview.cpp.

Referenced by init(), and loadFromXMI().

Uml::IDType UMLView::m_nLocalID [protected]
 

Contains the unique ID to allocate to a widget that needs an ID for the view.

ObjectWidgets are an example of this.

Definition at line 930 of file umlview.h.

Referenced by getLocalID(), loadFromXMI(), and saveToXMI().

Uml::IDType UMLView::m_nID [protected]
 

The ID of the view.

Allocated by UMLDoc

Definition at line 935 of file umlview.h.

Referenced by getID(), init(), isSavedInSeparateFile(), loadFromXMI(), loadUISDiagram(), saveToXMI(), and setID().

Uml::Diagram_Type UMLView::m_Type [protected]
 

The type of diagram to represent.

Definition at line 940 of file umlview.h.

Referenced by createAutoAssociations(), createAutoAttributeAssociations(), getType(), init(), loadFromXMI(), loadUISDiagram(), saveToXMI(), and setType().

QString UMLView::m_Name [protected]
 

The name of the diagram.

Definition at line 945 of file umlview.h.

Referenced by getName(), and setName().

QString UMLView::m_Documentation [protected]
 

The documentation of the diagram.

Definition at line 950 of file umlview.h.

Referenced by getDoc(), init(), loadFromXMI(), saveToXMI(), and setDoc().

Settings::OptionState UMLView::m_Options [protected]
 

Options used by view.

Definition at line 955 of file umlview.h.

Referenced by getFillColor(), getFont(), getLineColor(), getLineWidth(), getOptionState(), getShowOpSig(), getUseFillColor(), loadFromXMI(), saveToXMI(), setFillColor(), setFont(), setLineColor(), setLineWidth(), setOptionState(), setShowOpSig(), and setUseFillColor().

MessageWidgetList UMLView::m_MessageList [protected]
 

Contains all the data items for MessageWidgets on the diagram.

Definition at line 960 of file umlview.h.

Referenced by activate(), addWidget(), checkMessages(), deleteSelection(), findWidget(), getMessageList(), removeWidget(), saveToXMI(), selectWidgets(), and widgetOnDiagram().

UMLWidgetList UMLView::m_WidgetList [protected]
 

Contains all the data for UMLWidgets on the diagram.

Definition at line 965 of file umlview.h.

Referenced by activate(), addWidget(), contentsDropEvent(), createAutoAssociations(), findWidget(), forceUpdateWidgetFontMetrics(), getDiagramRect(), getUMLObjects(), getWidgetAt(), getWidgetList(), onWidgetLine(), removeAllWidgets(), removeWidget(), saveToXMI(), selectWidgets(), setClassWidgetOptions(), setFont(), setupNewWidget(), updateComponentSizes(), updateContainment(), and widgetOnDiagram().

AssociationWidgetList UMLView::m_AssociationList [protected]
 

Contains all the data for AssociationWidgets on the diagram.

Definition at line 970 of file umlview.h.

Referenced by activate(), addAssociation(), checkSelections(), copyAsImage(), deleteSelection(), findAssocWidget(), getAssociationList(), getDiagramRect(), getSelectedAssocs(), getWidgetAssocs(), init(), removeAllAssociations(), removeAssoc(), removeAssociations(), saveToXMI(), selectAssociations(), and updateContainment().

int UMLView::m_nSnapX [protected]
 

The snap to grid x size.

Definition at line 975 of file umlview.h.

Referenced by getSnapX(), init(), loadFromXMI(), saveToXMI(), and setSnapX().

int UMLView::m_nSnapY [protected]
 

The snap to grid y size.

Definition at line 980 of file umlview.h.

Referenced by getSnapY(), init(), loadFromXMI(), saveToXMI(), and setSnapY().

bool UMLView::m_bUseSnapToGrid [protected]
 

Determines whether to use snap to grid.

The default is off.

Definition at line 985 of file umlview.h.

Referenced by getSnapToGrid(), init(), loadFromXMI(), saveToXMI(), and setSnapToGrid().

bool UMLView::m_bUseSnapComponentSizeToGrid [protected]
 

Determines whether to use snap to grid for component size.

The default is off.

Definition at line 991 of file umlview.h.

Referenced by getSnapComponentSizeToGrid(), init(), loadFromXMI(), saveToXMI(), and setSnapComponentSizeToGrid().

bool UMLView::m_bShowSnapGrid [protected]
 

Determines whether to show the snap grid.

The default will be on if the grid is on.

Definition at line 996 of file umlview.h.

Referenced by getShowSnapGrid(), init(), loadFromXMI(), saveToXMI(), and setShowSnapGrid().

int UMLView::m_nZoom [protected]
 

The zoom level in percent, default 100.

Definition at line 1001 of file umlview.h.

Referenced by contentsDropEvent(), getZoom(), init(), loadFromXMI(), saveToXMI(), and setZoom().

int UMLView::m_nCanvasWidth [protected]
 

Width of canvas in pixels.

Definition at line 1006 of file umlview.h.

Referenced by getCanvasWidth(), init(), loadFromXMI(), saveToXMI(), and setCanvasWidth().

int UMLView::m_nCanvasHeight [protected]
 

Height of canvas in pixels.

Definition at line 1011 of file umlview.h.

Referenced by getCanvasHeight(), init(), loadFromXMI(), saveToXMI(), and setCanvasHeight().

int UMLView::m_nCollaborationId [protected]
 

Used for creating unique name of collaboration messages.

Definition at line 1113 of file umlview.h.

Referenced by generateCollaborationId(), and init().

bool UMLView::m_bStartedCut [protected]
 

Flag if view/children started cut operation.

Definition at line 1123 of file umlview.h.

Referenced by init(), setStartedCut(), and slotCutSuccessful().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:08:08 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003