umbrello API Documentation

FloatingTextWidgetController Class Reference

Controller for FloatingTextWidget. More...

#include <floatingtextwidgetcontroller.h>

Inheritance diagram for FloatingTextWidgetController:

UMLWidgetController List of all members.

Public Member Functions

 FloatingTextWidgetController (FloatingTextWidget *floatingTextWidget)
 Constructor for FloatingTextWidgetController.
 ~FloatingTextWidgetController ()
 Destructor for MessageWidgetController.

Protected Member Functions

virtual void saveWidgetValues (QMouseEvent *me)
 Overridden from UMLWidgetController.
virtual bool isInResizeArea (QMouseEvent *me)
 Overridden from UMLWidgetController.
virtual void moveWidgetBy (int diffX, int diffY)
 Overridden from UMLWidgetController.
virtual void constrainMovementForAllWidgets (int &diffX, int &diffY)
 Overridden from UMLWidgetController.

Detailed Description

Controller for FloatingTextWidget.

When moving a FloatingTextWidget, it is constrained using constrainTextPos method from the LinkWidget, if any. This applies both when moving as part of a selection and when constraining the move of the selection because it's the receiver of mouse move events. The only exception to this is that when moving the widget, if it's a sequence message and the message widget is selected, the floating text widget isn't moved itself, but automatically by the message widget. If the sequence message wasn't part of the selection, the floating text widget moves it. When moving the floating text as part of a selection, if the position of the floating text is constrained, it's kept at that position until it can be moved to another valid position. No resize is allowed for FloatingTextWidget.

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

Definition at line 38 of file floatingtextwidgetcontroller.h.


Constructor & Destructor Documentation

FloatingTextWidgetController::FloatingTextWidgetController FloatingTextWidget floatingTextWidget  ) 
 

Constructor for FloatingTextWidgetController.

Parameters:
floatingTextWidget The floating text widget which uses the controller.

Definition at line 21 of file floatingtextwidgetcontroller.cpp.

FloatingTextWidgetController::~FloatingTextWidgetController  ) 
 

Destructor for MessageWidgetController.

Definition at line 30 of file floatingtextwidgetcontroller.cpp.


Member Function Documentation

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

Overridden from UMLWidgetController.

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

Parameters:
me The QMouseEvent to get the offset from.

Reimplemented from UMLWidgetController.

Definition at line 33 of file floatingtextwidgetcontroller.cpp.

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

bool FloatingTextWidgetController::isInResizeArea QMouseEvent *  me  )  [protected, virtual]
 

Overridden from UMLWidgetController.

FloatingTextWidgets can't be resized, so this method always returns false. Cursor isn't changed.

Parameters:
me The QMouseEVent to check.
Returns:
true if the mouse is in resize area, false otherwise.

Reimplemented from UMLWidgetController.

Definition at line 42 of file floatingtextwidgetcontroller.cpp.

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

Overridden from UMLWidgetController.

Moves the widget to a new position using the difference between the current position and the new position. If the floating text widget is part of a sequence message, and the message widget is selected, it does nothing: the message widget will update the text position when it's moved. In any other case, the floating text widget constrains its move using constrainPosition. When the position of the floating text is constrained, it's kept at that position until it can be moved to another valid position (m_unconstrainedPositionX/Y and m_movementDirectionX/Y are used for that). Moreover, if is part of a sequence message (and the message widget isn't selected), it updates the position of the message widget.

See also:
constrainPosition
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 46 of file floatingtextwidgetcontroller.cpp.

References LinkWidget::calculateNameTextSegment(), UMLWidget::getHeight(), UMLWidget::getSelected(), MessageWidget::getSequenceMessageType(), MessageWidget::getWidget(), UMLWidget::getX(), UMLWidget::getY(), FloatingTextWidget::m_pLink, FloatingTextWidget::m_Role, UMLWidget::setX(), and UMLWidget::setY().

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

Overridden from UMLWidgetController.

Modifies the value of the diffX and diffY variables used to move the widgets. The values are constrained using constrainPosition.

See also:
constrainPosition
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 100 of file floatingtextwidgetcontroller.cpp.

References UMLWidget::getX(), and UMLWidget::getY().


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