umbrello: ToolBarStateOther Class Reference

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

Public Member Functions | Private Member Functions | List of all members
ToolBarStateOther Class Reference

`#include <toolbarstateother.h>`

Inheritance diagram for ToolBarStateOther:

## Public Member Functions
| ToolBarStateOther (UMLScene *umlScene)
virtual | ~ToolBarStateOther ()
Public Member Functions inherited from ToolBarStatePool
virtual | ~ToolBarStatePool ()
void | setButton (const WorkToolBar::ToolBar_Buttons &button)
WorkToolBar::ToolBar_Buttons | getButton () const
Public Member Functions inherited from ToolBarState
virtual | ~ToolBarState ()
virtual void | init ()
virtual void | cleanBeforeChange ()
virtual void | mousePress (QGraphicsSceneMouseEvent *ome)
virtual void | mouseRelease (QGraphicsSceneMouseEvent *ome)
virtual void | mouseDoubleClick (QGraphicsSceneMouseEvent *ome)
virtual void | mouseMove (QGraphicsSceneMouseEvent *ome)

## Private Member Functions
virtual void | setCurrentElement ()
virtual void | mouseReleaseEmpty ()
UMLObject::ObjectType | getObjectType ()
bool | newWidget ()

## Additional Inherited Members
Public Slots inherited from ToolBarState
virtual void | slotAssociationRemoved (AssociationWidget *association)
virtual void | slotWidgetRemoved (UMLWidget *widget)
Signals inherited from ToolBarState
void | finished ()
Protected Member Functions inherited from ToolBarStatePool
| ToolBarStatePool (UMLScene *umlScene)
Protected Member Functions inherited from ToolBarState
| ToolBarState (UMLScene *umlScene)
virtual void | mousePressAssociation ()
virtual void | mousePressWidget ()
virtual void | mousePressEmpty ()
virtual void | mouseReleaseAssociation ()
virtual void | mouseReleaseWidget ()
virtual void | mouseDoubleClickAssociation ()
virtual void | mouseDoubleClickWidget ()
virtual void | mouseDoubleClickEmpty ()
virtual void | mouseMoveAssociation ()
virtual void | mouseMoveWidget ()
virtual void | mouseMoveEmpty ()
virtual void | changeTool ()
virtual UMLWidget * | currentWidget () const
virtual void | setCurrentWidget (UMLWidget *widget)
virtual AssociationWidget * | currentAssociation () const
virtual void | setCurrentAssociation (AssociationWidget *association)
void | setMouseEvent (QGraphicsSceneMouseEvent *ome, const QEvent::Type &type)
AssociationWidget * | associationAt (const QPointF &pos)
MessageWidget * | messageAt (const QPointF &pos)
FloatingDashLineWidget * | floatingLineAt (const QPointF &pos)
Protected Attributes inherited from ToolBarState
UMLScene * | m_pUMLScene
| The UMLScene. More...
QGraphicsSceneMouseEvent * | m_pMouseEvent
| The mouse event currently in use. More...

## Detailed Description

Other tool creates almost all the objects (except associations and messages). Objects are created when left button is released, no matter if it was released on an association, on a widget or on an empty space.

Associations and widgets aren't taken into account, and are treated as empty spaces.

## Constructor & Destructor Documentation

## ◆ ToolBarStateOther()

ToolBarStateOther::ToolBarStateOther | ( | UMLScene * | umlScene | ) |
| explicit

Creates a new ToolBarStateOther.

Parameters

  umlScene | The UMLScene to use.

## ◆ ~ToolBarStateOther()

ToolBarStateOther::~ToolBarStateOther | ( |  | ) |
| virtual

Destroys this ToolBarStateOther.

## Member Function Documentation

## ◆ getObjectType()

UMLObject::ObjectType ToolBarStateOther::getObjectType | ( |  | ) |
| private

Returns the object type of this tool.

Returns
  The object type of this tool.

## ◆ mouseReleaseEmpty()

void ToolBarStateOther::mouseReleaseEmpty | ( |  | ) |
| privatevirtual

Called when the release event happened on an empty space. Associations, widgets and actual empty spaces are all treated as empty spaces. It creates a new widget if the left button was released. The widget to create depends on the type of the toolbar button selected. If the widget is the visual representation of a UMLObject, the object factory handles its creation. Otherwise, the widget is created using newWidget(). The UMLView is resized to fit on all the items.

Reimplemented from ToolBarState.

## ◆ newWidget()

bool ToolBarStateOther::newWidget | ( |  | ) |
| private

Creates and adds a new widget to the UMLView (if widgets of that type don't have an associated UMLObject). If the type of the widget doesn't use an UMLObject (for example, a note or a box), it creates the widget, adds it to the view and returns true. Otherwise, it returns false.

Returns
  True if the widget was created, false otherwise.

Todo:
  Rename to something more clear. The name is a bit confusing.

## ◆ setCurrentElement()

void ToolBarStateOther::setCurrentElement | ( |  | ) |
| privatevirtual

Overridden from base class to ignore associations and widgets and treat them as empty spaces to create widgets on it. Sets nothing.

Reimplemented from ToolBarState.

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

- umbrello/toolbarstateother.h
- umbrello/toolbarstateother.cpp