umbrello 2.39.0
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:
Collaboration 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 () const
 
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 UMLWidgetcurrentWidget () const
 
virtual void setCurrentWidget (UMLWidget *widget)
 
virtual AssociationWidgetcurrentAssociation () const
 
virtual void setCurrentAssociation (AssociationWidget *association)
 
void setMouseEvent (QGraphicsSceneMouseEvent *ome, const QEvent::Type &type)
 
AssociationWidgetassociationAt (const QPointF &pos)
 
MessageWidgetmessageAt (const QPointF &pos)
 
FloatingDashLineWidgetfloatingLineAt (const QPointF &pos)
 
- Protected Attributes inherited from ToolBarState
UMLScenem_pUMLScene
 The UMLScene.
 
QGraphicsSceneMouseEvent * m_pMouseEvent
 The mouse event currently in use.
 

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
umlSceneThe UMLScene to use.

◆ ~ToolBarStateOther()

ToolBarStateOther::~ToolBarStateOther ( )
virtual

Destroys this ToolBarStateOther.

Member Function Documentation

◆ getObjectType()

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

Returns the object type of this tool.

Returns
The object type of this tool.
Here is the call graph for this function:

◆ 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().

Reimplemented from ToolBarState.

Here is the call graph for this function:

◆ 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.
Here is the call graph for this function:

◆ 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: