umbrello API Documentation

MessageWidgetController Class Reference

Controller for MessageWidget. More...

#include <messagewidgetcontroller.h>

Inheritance diagram for MessageWidgetController:

UMLWidgetController List of all members.

Public Member Functions

 MessageWidgetController (MessageWidget *messageWidget)
 Constructor for MessageWidgetController.
 ~MessageWidgetController ()
 Destructor for MessageWidgetController.

Protected Member Functions

virtual void saveWidgetValues (QMouseEvent *me)
 Overriden from UMLWidgetController.
virtual QCursor getResizeCursor ()
 Overriden from UMLWidgetController.
virtual void resizeWidget (int newW, int newH)
 Overriden from UMLWidgetController.
virtual void moveWidgetBy (int diffX, int diffY)
 Overriden from UMLWidgetController.
virtual void constrainMovementForAllWidgets (int &diffX, int &diffY)
 Overriden from UMLWidgetController.
virtual void doMouseDoubleClick (QMouseEvent *me)
 Overriden from UMLWidgetController.

Detailed Description

Controller for MessageWidget.

When moving a MessageWidget, it is only moved along Y axis. X axis movement is always ignored. So, if the MessageWidget is being moved as part of a selection and that selection is moved in X and/or Y axis, the MessageWidget will only move in Y axis. Another constrain is applied in Y axis, so the message doesn't pass over the related object widgets. Due to this constrain, the vertical position the message would have if it wasn't constrained is calculated, so when the widget lowers the position where it was constrained it begins to move again. Also, when constraining the move of the selection because the receiver of mouse move events is a MessageWidget, all the widgets are moved only in Y axis. Another constrain is applied in Y axis, so the message doesn't pass over the related object widgets. The unconstrained position isn't need here, because the message widget is the receiver of the events, so when the cursor goes lower than where it was constrained it begins to lower automatically.

Creation messages take care of moving the object created when they're moved.

Only vertical resize is allowed for MessageWidget. Cursor is set to reflect this.

Double click shows the dialog to select the operation of the message.

Author:
Umbrello UML Modeller Authors <uml-devel@lists.sourceforge.net>

Definition at line 47 of file messagewidgetcontroller.h.


Constructor & Destructor Documentation

MessageWidgetController::MessageWidgetController MessageWidget messageWidget  ) 
 

Constructor for MessageWidgetController.

Parameters:
messageWidget The message widget which uses the controller.

Definition at line 25 of file messagewidgetcontroller.cpp.

MessageWidgetController::~MessageWidgetController  ) 
 

Destructor for MessageWidgetController.

Definition at line 31 of file messagewidgetcontroller.cpp.


Member Function Documentation

void MessageWidgetController::saveWidgetValues QMouseEvent *  me  )  [protected, virtual]
 

Overriden from UMLWidgetController.

Saves the values of the widget needed for move/resize. Calls parent method and then saves the value of m_unconstrainedPositionY

Parameters:
me The QMouseEvent to get the offset from.

Reimplemented from UMLWidgetController.

Definition at line 34 of file messagewidgetcontroller.cpp.

References UMLWidget::getY(), and UMLWidgetController::saveWidgetValues().

QCursor MessageWidgetController::getResizeCursor  )  [protected, virtual]
 

Overriden from UMLWidgetController.

Returns the cursor to be shown when resizing the widget. The cursor shown is KCursor::sizeVerCursor().

Returns:
The cursor to be shown when resizing the widget.

Reimplemented from UMLWidgetController.

Definition at line 40 of file messagewidgetcontroller.cpp.

void MessageWidgetController::resizeWidget int  newW,
int  newH
[protected, virtual]
 

Overriden from UMLWidgetController.

Resizes the height of the message widget and emits the message moved signal. Message widgets can only be resized vertically, so width isn't modified.

Parameters:
newW The new width for the widget (isn't used).
newH The new height for the widget.

Reimplemented from UMLWidgetController.

Definition at line 44 of file messagewidgetcontroller.cpp.

References UMLWidget::setSize(), and MessageWidget::sigMessageMoved().

void MessageWidgetController::moveWidgetBy int  diffX,
int  diffY
[protected, virtual]
 

Overriden from UMLWidgetController.

Moves the widget to a new position using the difference between the current position and the new position. X position is ignored, and widget is only moved along Y axis. If message goes upper than the object, it's kept at this position until it should be lowered again (the unconstrained Y position is saved to know when it's the time to lower it again). If the message is a creation message, the object created is also moved to the new vertical position.

See also:
constrainPositionY
Parameters:
diffX The difference between current X position and new X position (isn't used).
diffY The difference between current Y position and new Y position.

Reimplemented from UMLWidgetController.

Definition at line 49 of file messagewidgetcontroller.cpp.

References UMLWidget::getHeight(), UMLWidget::getY(), MessageWidget::m_pOw, MessageWidget::m_sequenceMessageType, MessageWidget::moveEvent(), and UMLWidget::setY().

void MessageWidgetController::constrainMovementForAllWidgets int &  diffX,
int &  diffY
[protected, virtual]
 

Overriden from UMLWidgetController.

Modifies the value of the diffX and diffY variables used to move the widgets. All the widgets are constrained to be moved only in Y axis (diffX is set to 0).

See also:
constrainPositionY
Parameters:
diffX The difference between current X position and new X position.
diffY The difference between current Y position and new Y position.

Reimplemented from UMLWidgetController.

Definition at line 71 of file messagewidgetcontroller.cpp.

References UMLWidget::getY().

void MessageWidgetController::doMouseDoubleClick QMouseEvent *  me  )  [protected, virtual]
 

Overriden from UMLWidgetController.

Executes the action for double click in the widget. Shows the dialog to select the operation of the message.

Parameters:
me The QMouseEvent which triggered the double click event.

Reimplemented from UMLWidgetController.

Definition at line 76 of file messagewidgetcontroller.cpp.

References MessageWidget::m_pFText, and FloatingTextWidget::slotMenuSelection().


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:05 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003