umbrello API Documentation

ToolBarStateArrow Class Reference

Arrow tool for select, move and resize widgets and associations. More...

#include <toolbarstatearrow.h>

Inheritance diagram for ToolBarStateArrow:

ToolBarState List of all members.

Public Member Functions

 ToolBarStateArrow (UMLView *umlView)
 Creates a new ToolBarStateArrow.
virtual ~ToolBarStateArrow ()
 Destroys this ToolBarStateArrow.
virtual void init ()
 Goes back to the inital state.

Protected Member Functions

virtual void mousePressAssociation ()
 Called when the press event happened on an association.
virtual void mousePressWidget ()
 Called when the press event happened on a widget.
virtual void mousePressEmpty ()
 Called when the press event happened on an empty space.
virtual void mouseReleaseAssociation ()
 Called when the release event happened on an association.
virtual void mouseReleaseWidget ()
 Called when the release event happened on a widget.
virtual void mouseReleaseEmpty ()
 Called when the release event happened on an empty space.
virtual void mouseDoubleClickAssociation ()
 Called when the double click event happened on an association.
virtual void mouseDoubleClickWidget ()
 Called when the double click event happened on a widget.
virtual void mouseMoveAssociation ()
 Called when the move event happened when an association is currently available.
virtual void mouseMoveWidget ()
 Called when the move event happened when a widget is currently available.
virtual void mouseMoveEmpty ()
 Called when the move event happened when no association nor widget are currently available.
virtual void setCurrentWidget (UMLWidget *currentWidget)
 Sets the widget currently in use.
virtual void changeTool ()
 Overriden from base class to do nothing, as arrow is the default tool.

Protected Attributes

QPtrList< QCanvasLine > m_selectionRect
 The selection rectangle that contains the four lines of its borders.
QPoint m_startPosition
 The start position of the selection rectangle.

Detailed Description

Arrow tool for select, move and resize widgets and associations.

Arrow tool delegates the event handling in the widgets and associations. When no widget nor association is being used,the arrow tool acts as a selecting tool that selects all the elements in the rectangle created when dragging the mouse.

This is the default tool.

Definition at line 34 of file toolbarstatearrow.h.


Constructor & Destructor Documentation

ToolBarStateArrow::ToolBarStateArrow UMLView umlView  ) 
 

Creates a new ToolBarStateArrow.

Parameters:
umlView The UMLView to use.

Definition at line 21 of file toolbarstatearrow.cpp.

References init(), and m_selectionRect.

ToolBarStateArrow::~ToolBarStateArrow  )  [virtual]
 

Destroys this ToolBarStateArrow.

Definition at line 27 of file toolbarstatearrow.cpp.


Member Function Documentation

void ToolBarStateArrow::init  )  [virtual]
 

Goes back to the inital state.

Reimplemented from ToolBarState.

Definition at line 30 of file toolbarstatearrow.cpp.

References ToolBarState::init(), and m_selectionRect.

Referenced by ToolBarStateArrow().

void ToolBarStateArrow::mousePressAssociation  )  [protected, virtual]
 

Called when the press event happened on an association.

Delivers the event to the association.

Reimplemented from ToolBarState.

Definition at line 36 of file toolbarstatearrow.cpp.

References ToolBarState::getCurrentAssociation(), and AssociationWidget::mousePressEvent().

void ToolBarStateArrow::mousePressWidget  )  [protected, virtual]
 

Called when the press event happened on a widget.

Delivers the event to the widget.

Reimplemented from ToolBarState.

Definition at line 40 of file toolbarstatearrow.cpp.

References ToolBarState::getCurrentWidget(), and UMLWidget::mousePressEvent().

void ToolBarStateArrow::mousePressEmpty  )  [protected, virtual]
 

Called when the press event happened on an empty space.

Calls base method and, if left button was pressed, prepares the selection rectangle.

Reimplemented from ToolBarState.

Definition at line 44 of file toolbarstatearrow.cpp.

References m_selectionRect, m_startPosition, ToolBarState::mousePressEmpty(), UMLWidget::setPen(), and UMLWidget::setZ().

void ToolBarStateArrow::mouseReleaseAssociation  )  [protected, virtual]
 

Called when the release event happened on an association.

Delivers the event to the association.

Reimplemented from ToolBarState.

Definition at line 68 of file toolbarstatearrow.cpp.

References ToolBarState::getCurrentAssociation(), and AssociationWidget::mouseReleaseEvent().

void ToolBarStateArrow::mouseReleaseWidget  )  [protected, virtual]
 

Called when the release event happened on a widget.

Delivers the event to the widget.

Reimplemented from ToolBarState.

Definition at line 72 of file toolbarstatearrow.cpp.

References ToolBarState::getCurrentWidget(), and UMLWidget::mouseReleaseEvent().

void ToolBarStateArrow::mouseReleaseEmpty  )  [protected, virtual]
 

Called when the release event happened on an empty space.

If selection rectangle is active, it is cleared. Else, if the right button was released, it shows the pop up menu for the diagram.

Reimplemented from ToolBarState.

Definition at line 76 of file toolbarstatearrow.cpp.

References m_selectionRect, and UMLView::setMenu().

void ToolBarStateArrow::mouseDoubleClickAssociation  )  [protected, virtual]
 

Called when the double click event happened on an association.

Delivers the event to the association.

Reimplemented from ToolBarState.

Definition at line 84 of file toolbarstatearrow.cpp.

References ToolBarState::getCurrentAssociation(), and AssociationWidget::mouseDoubleClickEvent().

void ToolBarStateArrow::mouseDoubleClickWidget  )  [protected, virtual]
 

Called when the double click event happened on a widget.

Delivers the event to the widget.

Reimplemented from ToolBarState.

Definition at line 88 of file toolbarstatearrow.cpp.

References ToolBarState::getCurrentWidget(), and UMLWidget::mouseDoubleClickEvent().

void ToolBarStateArrow::mouseMoveAssociation  )  [protected, virtual]
 

Called when the move event happened when an association is currently available.

Delivers the event to the association.

Reimplemented from ToolBarState.

Definition at line 92 of file toolbarstatearrow.cpp.

References ToolBarState::getCurrentAssociation(), and AssociationWidget::mouseMoveEvent().

void ToolBarStateArrow::mouseMoveWidget  )  [protected, virtual]
 

Called when the move event happened when a widget is currently available.

Delivers the event to the widget.

Reimplemented from ToolBarState.

Definition at line 96 of file toolbarstatearrow.cpp.

References ToolBarState::getCurrentWidget(), and UMLWidget::mouseMoveEvent().

void ToolBarStateArrow::mouseMoveEmpty  )  [protected, virtual]
 

Called when the move event happened when no association nor widget are currently available.

Updates the selection rectangle to the new position and selectes all the widgets in the rectangle.

Reimplemented from ToolBarState.

Definition at line 100 of file toolbarstatearrow.cpp.

References m_selectionRect, m_startPosition, and UMLView::selectWidgets().

void ToolBarStateArrow::setCurrentWidget UMLWidget currentWidget  )  [protected, virtual]
 

Sets the widget currently in use.

It ensures that the widget is only set if there is no other widget set already. It avoids things like moving a big widget over a little one, clicking right button to cancel the movement and the little widget getting the event, thus not cancelling the movement in the big widget.

Reimplemented from ToolBarState.

Definition at line 126 of file toolbarstatearrow.cpp.

References ToolBarState::getCurrentWidget(), and ToolBarState::setCurrentWidget().

void ToolBarStateArrow::changeTool  )  [protected, virtual]
 

Overriden from base class to do nothing, as arrow is the default tool.

Reimplemented from ToolBarState.

Definition at line 123 of file toolbarstatearrow.cpp.


Member Data Documentation

QPtrList<QCanvasLine> ToolBarStateArrow::m_selectionRect [protected]
 

The selection rectangle that contains the four lines of its borders.

Definition at line 149 of file toolbarstatearrow.h.

Referenced by init(), mouseMoveEmpty(), mousePressEmpty(), mouseReleaseEmpty(), and ToolBarStateArrow().

QPoint ToolBarStateArrow::m_startPosition [protected]
 

The start position of the selection rectangle.

Definition at line 154 of file toolbarstatearrow.h.

Referenced by mouseMoveEmpty(), and mousePressEmpty().


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