uml建模工具中bouml的使用整理版中英文对照.docx
《uml建模工具中bouml的使用整理版中英文对照.docx》由会员分享,可在线阅读,更多相关《uml建模工具中bouml的使用整理版中英文对照.docx(52页珍藏版)》请在冰豆网上搜索。
uml建模工具中bouml的使用整理版中英文对照
这个bouml是基于Qt的,感觉挺好。
目前关注的功能:
支持windows,linux等多种操作系统,运行快,体积小,可以支持代码生成,可以生成文档,可以导出为图片。
感觉真的不错。
官方网址是:
http:
//bouml.free.fr/index.html
有一个简易的教程,为了查看方便,转到我的博客里面了,网上也有中文的翻译我传到csdn上面了。
网址是:
以下是我转载的内容:
Bouml–Tutorial
ThistutorialiswrittentohelpyoutouseBOUMLforthefirsttime,onlyfewfeaturesofBOUMLareexposedhere,butafulldescriptionofBOUMLisgiveninthereferencemanual.
本教程主要为了帮助您第一次起用BOUML。
在这里仅显露BOUML少数的特点,而BOUML完整描述参见其参考手册。
ThetutorialmustbereadinorderbecauseIwillnotrepeateachtimethegeneralcommandstocallamenuetc...
本教程必须按序阅读,因为我不会每次重复诸如调用菜单等一般性的命令。
Starting启动
WhenyouexecuteBOUMLthefollowingmessageappears,hitokthistime,butyouwillhavetodefineyouownidentifierforaneffectiveusageofBOUML:
当您执行BOUML出现下面消息,按确定(OK)按钮。
但你将不得不定义你自己的有效的BOUML标识:
(1~127中的整数)。
TheBOUMLwindowappears(thedrawingisdependentontheusedreleaseofQt,herethe2.4underLinuxtobecompatiblewiththeWindowsrelease):
在BOUML视窗显现(图样取决于使用的Qt版本,这里是在Linux下运行的2.4版本,与Windows版本兼容):
Theboumlwindowiscomposedofthreeparts:
bouml窗口由三个部分组成
Theleftsub-windowdisplayabrowserpresentingyourproject,thenavigationmaybedonebythemouseorthekeyboard'sarrows.Theboldfontisusedwhenanitemismodifiable,anitemisread-onlywhenyoudonothavethewritepermissionforthefile(s)supportingit.
◆ 左边的子窗口是一个展示您项目的浏览器,可由鼠标或上下左右键进行导航。
黑体的字体表示该项是可修改的,当您没有文件写权限时则一个项是只读。
Thebottom-rightsub-windowisusedtodisplay/modifythecommentassociatedtothecurrentselecteditem.
◆ 右下角的子窗口是用来显示/修改与当前所选项相关联的注释。
Thetop-rightpartisusedtodisplay/modifythediagrams,theseonesmaybemaximizedorminimized.
◆ 右上方的部分是用来显示/修改图表,这些窗口可以的最大化或最小化。
Obviouslytherespectivesizesofthesub-windowsmaybechanged,placingthemouseontheseparationbetweenthem.Note:
ifyouhaveatleastadualmonitorconfigurationthebetteristosettheenvironmentvariableBOUML_LIMIT_DESKTOP,seehere.
显然地,个别子窗的大小会发生改变,当把鼠标放在它们之间的分拆处时,可以更改窗口大小。
注意:
如果你有双监视器配置,更好的办法是设置环境变量BOUML_LIMIT_DESKTOP,参见此地。
Atthislevelyouhavetocreateanewproject,ortoloadanalreadyexistingproject.
在此水平下你必须创建一个新的项目,或加载一个已经存在的项目。
Createanewproject创建一个新项目
Herewecreateanewproject:
inthemenuProjectchoosenew,afiledialogappears(itsaspectdependontheusedsystemandwindowmanager)andyouhavetoselectthedirectorywheretheprojectwillbeplacedanditsname,Ichoosetheprojectfooplacedunder/tmp:
这儿,我们创建一个新项目:
在Project菜单中选择New菜单项,呈现一个文件对话框(它的外观取决于所用的系统和窗口管理器),请求输入项目名称,你必须选择一个目录用以存放项文件,并选择输入项目名字,我输入项目名为foo,放置在/tmp目录之下:
InthiscaseBOUMLcreatesthedirectoryfoounder/tmp,andplacessomefilesin/tmp/fooincludingfoo.prjwhichisthefiletoloadwhenyouwillre-loadthisproject.Note:
donotrenameordeletethefilesproducedbyBOUMLnorthedirectoryitself!
在这种情况下BOUML在/tmp下创建目录foo(即\tmp\foo),并将某些文件(包括foo.prj)
放置在/tmp/foo目录之下。
当重新加载工程时(foo.prj),这些文件都会加载。
!
注意:
不要重命名或删除由BOUML产生的文件,以及目录本身!
Anewdialogappears:
接着显示一个新的对话框:
Followingtherecommendation,IsetforinstancethetoggleforC++andJavaintheLanguagemenu(wewillseewhylater):
遵循以下的建议,通过Language菜单我为此例切换为C++和Java的语言(以后我们将看到为什么这样做):
Thenameoftheprojectappearsinthebrowser,theprojectisthetoplevelpackage,arightmouseclickonitproducesthemenu:
该项目的名称显示在浏览器中,该项目是顶级包,其上点击鼠标右键产生的菜单:
Asyoucansee,apackagemaycontainotherpackagesandsomeviews:
usecaseview,classview,componentviewanddeploymentview.
你将看到,一个包(package)可能包含其他包和一些视图:
用例视图(usecaseview),类视图(classview),构件视图(componentview)和部署视图(deploymentview)。
View,Usecase视图(View,)用例(Usecase)
Boumlusesviewsinaprojecttoorganizeandstructurethemodelelementsanddiagrams.Thedifferenttypesofviewsprovidedifferentcontextmenuslistingthediagramsandmodelelementsthatcanbecreatedinit.
Bouml在一个bouml工程中使用视图来组织和结构化模型元素和图。
不同类型视图依据上下文提供不同的菜单,以列出在其中可以创建图和模型元素。
Todefineusecasesweneedtohaveausecaseview,sowechoosenewusecaseview:
若要定义用例,我们需要有一个用例视图(usecaseview),所以我们选择新的用例视图(newusecaseview):
Boumlasksforthenameoftheview,tochangeitlatertheusecaseviewmustbeeditedthroughadoublemouseclick,orchoosingeditinthemenuappearingonarightmouseclick,showingtheusecaseeditor:
Bouml要求提供的视图名。
在以后要想修改它,必须鼠标双击用例视图(newusecaseview)
,或点鼠标右键出现菜单,从菜单中选择edit,则显示了用例编辑器。
Diagram图
Tocreateausecasediagraminthisview,doarightclickontheusecaseviewandchoosenewusecasediagram:
要在此视图创建用例图(usecasediagram),在用例视图上右击鼠标,弹出菜单,并选择新的用例图(newusecasediagram):
Thenameisalsoasked,tochangeittheusecasediagrammustbeeditedchoosingeditinthemenuappearingonarightmouseclick.Contrarytothenondiagramitems,adoubleclickonadiagramshowit:
同样还要输入用例图的名字。
要修改用例图,在用例图上右击鼠标键,显示一菜单[此菜单为元素的关联菜单,以后简称关联菜单],从菜单中选择edit。
相对于非图项,在图上双击显示。
Addelementsinadiagram在图中添加元素
Tocreateandplaceausecaseintheusecasediagramyouhavetwoways:
在用例图中创建并放置用例你有两种方法可选:
todoarightclickontheusecaseviewandtochoosenewusecase,thentodragitfromthebrowsertothediagram,
◆ 在用例视图右击鼠标,在菜单中选择新的用例(newusecase),然后从浏览器拖放到图中。
ortohittheellipsisbuttoninthetopofthediagramsub-windows,thentohitsomewhereinthediagramsub-window.
◆或点击图子窗口顶上的用例功能(椭圆)按钮,然后在图中某个点点击鼠标即可。
Notethattheusecaseiscreatedintheviewcontainingthediagram,thiswillbethesamethingintheotherscasewhateverthediagramexceptforthestatesmachine.
请注意,用例是包含用例图的视图中创建的,除状态机(statesmachine.)外,不论何种图皆与此类似。
Let'sWithdrawthenameoftheusecase.我们将用例的名字取为Withdraw。
Tomovetheusecaseinthediagram,doaleftclickonitandmovethemouseclickdown,thenamefollowtheusecasebutthenamemaybemovedindependently,forinstancetoplaceitinthemiddleoftheellipsis.Youmayalsoselecttheusecaseandtousethearrowsofthekeyboard.
要移动图中的usecase,在usecase上按鼠标左键,保持按下状态移动鼠标,用例名跟着用例移动,但用例名也可以独立移动。
例如,将用例名放置在椭圆的中间。
您也可以选中用例后使用键盘上的箭头移动。
CreateanactornamedCustomerlikeyoucreatetheusecase,tohave:
创建一个名为Customer的角色如同你创建用例一样,结果如下:
Notethatanactorisinfactaclass,whenthestereotypeisactortheiconshowninthebrowserisanactor,elseaclass.Tochangethestereotypeedittheclass(doublemouseclickontheclass,orchoosingeditinthemenuappearingonarightmouseclickontheclass),chooseamongthepredefinedlistofstereotypesorenteranewone,readthereferencemanualtochangethepredefinedlistofstereotypes.
请注意,一个角色(actor)其实是一个类,当板型是角色时,在浏览器中显示的图标是一个角色,否则是一个类。
要改变板型,编辑类(在类上双击鼠标,或在类上点击鼠标右键出现的菜单,选择edit),从预定义列表中选择板型或输入一个新的板型。
关于修改预定义的板型列表,请阅读参考手册。
Theusecasepicturemayberesizedmovingthepointsappearingwhenyouclickontheusecase.Theactorcan'tberesized.
用例可以改变大小:
点击用例,移动的出现点即可。
然而角色不能调整大小
Youhavetowaystodrawtheassociation:
asimplelineasUMLrecommendation,oranarrow.Hitonthedesiredicon,leftclickontheactor,movethemouseclickdownuptotheusecaseandreleasetheclick:
你有多种方法画出关联关系:
UML的推荐(一条简单线条或有箭头),点击所需图标按钮,在角色上点击(不松开),移动鼠标到用例上,松开鼠标。
Thelinesmaybebrokenduringtheinitialconstructionifyoureleasetheclickoutofanyitem,oraftertheconstructionwithaleftmouseclickonthelineandmovingthemouseclickdown.
在最初的构建线条时,如果你在元素之外松开鼠标左键,线条变成折线。
或在线条构建完成之后,在线上点击鼠标左键,拖动原线条亦变为折线。
Toremoveapointinaline,doubleleftclickonit,orrightclicktoshowthemenuandchooseremovefromview.Toabortalineduringitsconstruction:
doubleclick.
要删除线上的一个点,双击此点,或右键单击此点显示菜单并选择removefromview菜单项。
在线条的构建过程中,双击将终止构建
Addnewelementsinthediagramlikethis(editthedependencytosetthestereotypeinclude):
同样方式在图中添加新元素,如下图(编辑依赖性以设置其板型)
Asyoucansee,thegeneralizationsanddependenciesarevisibleonthebrowser,theirmenu(onarightclick)inthebrowserallowstonavigatetothetarget.
正如你所看到的,在浏览器上可见到范化(generalizations)和依赖(dependencies)关系,它们关联菜单(在其上鼠标右键单击)允许浏览到你要找的目标。
IfyoueditthegeneralizationfromWithdrawyouwillhaveasimpledialog,thisisnotthecaseforthegeneralizationbetweentheactorsbecausethisinheritancemayproducesourcecode:
anactorisaclass.
如果您从WithDraw来编辑泛化关联,将有一个简单的对话框,这与角色之间的泛化关系不是一回事,因为继承会产生源代码:
一个角色是一个类。
Removeanelementinadiagram删除图中的一个元素
Toremovesomethinginthediagram,selectthedesiredelements(leftclickonit)andpressSupprorcallthemenuandchooseremovefromview.Notethatthisisnotpossibletoremovealabel.
从图中删除一些元素,选择要删除元素(左键点击),然后按DEL或从关联菜单选择removefromview。
请注意,不可能的删除图中的标签(label)。
Delete/undeletebrowserelement删除/恢复浏览器中的元素
Todeletesomethingfromthemodel,usecontrol-dorchoosedeletefrommodel,youmayalsodothatontheiteminthebrowser.ForinstanceifIdeletetheAdministrator:
要从模型中删除元素,按ctrol+d或从关联菜单选择deletefrommodel,,你也可以在浏览器中如此做。
:
例如删除的Administrator:
ObviouslytheAdministratorandthegeneralizationdisappearfromthediagram,butthisisnotthecaseinthebrowser:
theyarejustmarkeddeleted.Theirmenuismodified:
youmayundeletejusttheAdministratororthisoneandallhischildren(undeleterecursively),youhavenomenuforthegeneralizationbecauseitcan'tbeundeletedwhileAdministratorisdeleted!
显然,Administrator和generalization从图中消失,但在浏览器中并非如此:
它们只是加上删除标记,相对应的菜单的也发生了改变。
你可仅恢复(undelete)Administrator或者它和它的全部子孙(递归性恢复)。
当Administrator被删除时,generalizationr没有关联菜单,在Administrator被删除时,是不可以单单恢复它的子孙
Notethatthedeletedelementsarenotsaved,ifyoureloadtheprojectthedeletedelementswillbedefinitivelylost.
注意:
所有删除的元素是不保存的,如果你重新调入工程,被删除的元素一定丢失了。
Undeletetheactorandthegeneralization,theydonotreappearsinthediagram.
恢复角色和它的子孙,它们将不会在图中。
Reinserttheactorinthediagram,usingadrag&dropfromtheb