[Uml-devel] branches/work/isi-umbrello/umbrello/umbrello
Hassan Kouch
hkouch at hotmail.com
Thu Feb 22 22:20:34 UTC 2007
SVN commit 636368 by kouch:
Add the Pin Widget to the activity diagram (UML 2.0)
M +3 -2 CMakeLists.txt
M +2 -2 cmds/cmd_moveWidget.cpp
M +2 -0 listpopupmenu.cpp
M +2 -2 pics/CMakeLists.txt
AM pics/cursor-pin.png
AM pics/pin.png
A pinwidget.cpp [License: GPL (v2+)]
A pinwidget.h [License: GPL (v2+)]
M +5 -0 toolbarstateother.cpp
M +1 -0 umlnamespace.h
M +26 -0 umlview.cpp
M +4 -0 worktoolbar.cpp
M +2 -0 worktoolbar.h
--- branches/work/isi-umbrello/umbrello/umbrello/CMakeLists.txt #636367:636368
@@ -310,6 +310,7 @@
nodewidget.cpp
notewidget.cpp
notewidgetcontroller.cpp
+ objectflowwidget.cpp
objectwidget.cpp
objectwidgetcontroller.cpp
object_factory.cpp
@@ -321,13 +322,13 @@
packagewidget.cpp
petalnode.cpp
petaltree2uml.cpp
+ pinwidget.cpp
plugin.cpp
pluginloader.cpp
preconditionwidget.cpp
seqlinewidget.cpp
statewidget.cpp
- signalwidget.cpp
- objectflowwidget.cpp
+ signalwidget.cpp
stereotype.cpp
template.cpp
textblock.cpp
--- branches/work/isi-umbrello/umbrello/umbrello/cmds/cmd_moveWidget.cpp #636367:636368
@@ -32,7 +32,7 @@
namespace Uml
{
- cmdMoveWidget::cmdMoveWidget(UMLWidgetController* _UMLwc):UMLwc(_UMLwc),already(false)
+ cmdMoveWidget::cmdMoveWidget(UMLWidgetController* _UMLwc):QUndoCommand(),UMLwc(_UMLwc),already(false)
{
UMLWidget * w = _UMLwc->getWidget();
setText(i18n("Move widget :") + w->getName());
@@ -81,7 +81,7 @@
}
bool cmdMoveWidget::mergeWith(const QUndoCommand* other) {
- cmdMoveWidget* otherCmd = static_cast<const cmdMoveWidget*>(other);
+ const cmdMoveWidget* otherCmd = static_cast<const cmdMoveWidget*>(other);
if (UMLwc != otherCmd->UMLwc)
return false;
X = otherCmd->X;
--- branches/work/isi-umbrello/umbrello/umbrello/listpopupmenu.cpp #636367:636368
@@ -39,6 +39,7 @@
#include "objectflowwidget.h"
#include "forkjoinwidget.h"
#include "objectwidget.h"
+#include "pinwidget.h"
//ListPopupMenu for a UMLView (diagram)
ListPopupMenu::ListPopupMenu(QWidget *parent, Menu_Type type, UMLView * view)
@@ -358,6 +359,7 @@
break;
case Uml::wt_Object_Flow:
case Uml::wt_Signal:
+ case Uml::wt_Pin:
setupColor( object -> getUseFillColour() );
insertSeparator();
insertStdItem(mt_Cut);
--- branches/work/isi-umbrello/umbrello/umbrello/pics/CMakeLists.txt #636367:636368
@@ -7,13 +7,13 @@
CVprotected_signal.png CVprotected_slot.png CVprotected_var.png CVpublic_meth.png CVpublic_signal.png
CVpublic_slot.png CVpublic_var.png CVstruct.png deep-history.png shallow-history.png dependency.png
final_activity.png end_state.png generalisation.png initial_state.png interface.png join.png junction.png datatype.png enum.png
-message-synchronous.png message-asynchronous.png note.png object_flow.png object.png startlogo.png template.png text.png
+message-synchronous.png message-asynchronous.png note.png pin.png object_flow.png object.png startlogo.png template.png text.png
class.png uniassociation.png usecase.png branch.png fork.png state-fork.png package.png artifact.png
box.png node.png entity.png relationship.png subsystem.png cursor-actor.png message-found.png accept_signal.png accept_time_event.png send_signal.png cursor-andline.png
cursor-choice-rhomb.png cursor-choice-round.png cursor-combined_fragment.png cursor-deep-history.png cursor-join.png cursor-junction.png
cursor-shallow-history.png cursor-state-fork.png cursor-usecase.png cursor-initial_state.png cursor-package.png
cursor-aggregation.png cursor-component.png cursor-containment.png cursor-interface.png cursor-datatype.png
-cursor-enum.png cursor-text.png cursor-anchor.png cursor-object_flow.png cursor-composition.png cursor-message-asynchronous.png
+cursor-enum.png cursor-text.png cursor-anchor.png cursor-pin.png cursor-object_flow.png cursor-composition.png cursor-message-asynchronous.png
cursor-class.png cursor-artifact.png cursor-dependency.png cursor-message-synchronous.png
cursor-uniassociation.png cursor-association.png cursor-end_state.png cursor-final_activity.png cursor-node.png cursor-box.png
cursor-fork.png cursor-note.png cursor-branch.png cursor-generalisation.png cursor-object.png
** branches/work/isi-umbrello/umbrello/umbrello/pics/cursor-pin.png #property svn:executable
+ *
** branches/work/isi-umbrello/umbrello/umbrello/pics/cursor-pin.png #property svn:mime-type
+ application/octet-stream
** branches/work/isi-umbrello/umbrello/umbrello/pics/pin.png #property svn:executable
+ *
** branches/work/isi-umbrello/umbrello/umbrello/pics/pin.png #property svn:mime-type
+ application/octet-stream
--- branches/work/isi-umbrello/umbrello/umbrello/toolbarstateother.cpp #636367:636368
@@ -35,6 +35,7 @@
#include "umldoc.h"
#include "objectwidget.h"
#include "objectflowwidget.h"
+#include "pinwidget.h"
@@ -164,6 +165,10 @@
umlWidget = new ObjectFlowWidget(m_pUMLView);
break;
+ case WorkToolBar::tbb_Pin:
+ umlWidget = new PinWidget(m_pUMLView);
+ break;
+
default:
break;
}
--- branches/work/isi-umbrello/umbrello/umbrello/umlnamespace.h #636367:636368
@@ -110,6 +110,7 @@
wt_Object_Flow, // does not have UMLObject representation
wt_FloatingDashLine, // does not have UMLObject representation
wt_Signal, // does not have UMLObject representation
+ wt_Pin,
wt_EndOfLife
};
--- branches/work/isi-umbrello/umbrello/umbrello/umlview.cpp #636367:636368
@@ -88,6 +88,7 @@
#include "forkjoinwidget.h"
#include "activitywidget.h"
#include "objectflowwidget.h"
+#include "pinwidget.h"
#include "seqlinewidget.h"
#include "uniqueid.h"
#include "umllistviewitemlist.h"
@@ -1731,6 +1732,31 @@
pWidget -> setUMLObject( pObject );
m_WidgetList.append( pWidget );
}
+
+ case wt_Pin:
+ {
+ ObjectWidget* pObjectWidget = static_cast<ObjectWidget*>(pWidget);
+ if (pObjectWidget == NULL) {
+ kDebug() << "UMLView::addWidget(): pObjectWidget is NULL" << endl;
+ return false;
+ }
+ Uml::IDType newID = log->findNewID( pWidget -> getID() );
+ if (newID == Uml::id_None) {
+ return false;
+ }
+ pObjectWidget -> setID( newID );
+ Uml::IDType nNewLocalID = getLocalID();
+ Uml::IDType nOldLocalID = pObjectWidget -> getLocalID();
+ m_pIDChangesLog->addIDChange( nOldLocalID, nNewLocalID );
+ pObjectWidget -> setLocalID( nNewLocalID );
+ UMLObject *pObject = m_pDoc -> findObjectById( newID );
+ if( !pObject ) {
+ kDebug() << "addWidget::Can't find UMLObject" << endl;
+ return false;
+ }
+ pWidget -> setUMLObject( pObject );
+ m_WidgetList.append( pWidget );
+ }
break;
default:
kDebug() << "Trying to add an invalid widget type" << endl;
--- branches/work/isi-umbrello/umbrello/umbrello/worktoolbar.cpp #636367:636368
@@ -152,6 +152,8 @@
insertHotBtn(tbb_Accept_Signal);
insertHotBtn(tbb_Accept_Time_Event);
insertHotBtn(tbb_Region);
+ insertHotBtn(tbb_Pin);
+
break;
case Uml::dt_Component:
@@ -312,6 +314,7 @@
{ tbb_End_Activity, i18n("End Activity"), "end_state.png", SLOT(slotEnd_Activity()) },
{ tbb_Final_Activity, i18n("Final Activity"), "final_activity.png", SLOT(slotFinal_Activity()) },
{ tbb_Object_Flow, i18n("Object Flow"), "object_flow.png", SLOT(slotObject_Flow()) },
+ { tbb_Pin, i18n("Pin"), "pin.png", SLOT(slotPin()) },
{ tbb_Initial_Activity, i18n("Initial Activity"), "initial_state.png", SLOT(slotInitial_Activity()) },
{ tbb_Coll_Message, i18n("Message"), "message-asynchronous.png", SLOT(slotColl_Message()) },
{ tbb_Exception, i18n("Exception"), "exception.png", SLOT(slotException()) }
@@ -396,6 +399,7 @@
void WorkToolBar::slotDeepHistory() {buttonChanged(tbb_DeepHistory);}
void WorkToolBar::slotShallowHistory() {buttonChanged(tbb_ShallowHistory);}
void WorkToolBar::slotJoin() {buttonChanged(tbb_Join);}
+void WorkToolBar::slotPin() {buttonChanged(tbb_Pin);}
void WorkToolBar::slotStateFork() {buttonChanged(tbb_StateFork);}
void WorkToolBar::slotJunction() {buttonChanged(tbb_Junction);}
void WorkToolBar::slotChoice() {buttonChanged(tbb_Choice);}
--- branches/work/isi-umbrello/umbrello/umbrello/worktoolbar.h #636367:636368
@@ -120,6 +120,7 @@
tbb_End_Activity,
tbb_Final_Activity,
tbb_Object_Flow,
+ tbb_Pin,
tbb_Branch,
tbb_Fork,
tbb_DeepHistory,
@@ -255,6 +256,7 @@
void slotChoice();
void slotAndline();
void slotException();
+ void slotPin();
};
More information about the umbrello-devel
mailing list