Upload
ekojgj66
View
217
Download
0
Embed Size (px)
Citation preview
8/9/2019 VisioUML2.2Tips
1/5
TipsforusingaVisiotemplateforUML2.2,availableathttp://softwarestencils.com Page1
TipsforUsingaVisioTemplateforUML2.2
ThisdocumentcontainstipsandsuggestionsforcreatingUML2.2diagramsusingthestencilsandtemplatesavailableat
http://softwarestencils.com.ItispossibletodrawallUMLsymbolsanddiagramsspecifiedintheOMGdocument
formal/20090202,OMGUnifiedModelingLanguage(OMGUML),Superstructure,version2.2,availableat
http://www.omg.org/spec/UML/2.2/.
Thispdffileisforreferenceonly.Thelatestversionofthisdocumentisathttp://softwarestencils.com.
Macros
Thestencilsandtemplatedonotcontainmacros.IfVisioasksyouwhetheryouwanttoenableordisablemacros,disable
them.
ImportantTips
ThesetipsareusefulespeciallyforthosewhoarenewtoVisio.Pleasereadthisdocumentbeforeaskingmequestions.
However,Iamalwaysinterestedinyourfeedback,suggestionsandcomments.Ifyouhaveadditionaltipsthatcouldbe
includedinthisdocumentpleasecontactme,PavelHruby,[email protected].
Startbyopeningthetemplate"UML2.2Template".Thetemplatedefines
allrequiredVisiosettings,andopensautomaticallytwostencils:"UML2.2
Symbols",and"UMLIconsandStereotypes".
Thetemplateandthestencilsaredesignedtoworktogether.When
startingcreatinganewdiagramusing"New/GettingStarted",lookfor
thistemplateicon.
Ifforsomereason,youopenfirstanothertemplate(suchasablank
template,ortheUMLModelDiagramtemplatebuiltinVisio)andthen
opentheUML2.2stencilsfromthisothertemplate,youneedtochange
somesettings.
ClickTools,Snap&GlueandplacecheckmarksintheGlueandShape
Verticescheckboxes.
WiththesesettingswillVisioautomaticallycreateconnectionpointson
Lifelinesinsequencediagrams,whenyouconnectMessages,Fragments,
orInteractionOccurrencestoLifelines.
InVisio2000andVisio5,moreover,inTools,Options,Advancedtab,place
checkmarksintheEnableMicrosoftBasicforApplications,LoadVisual
BasicforApplicationsfromtext,andenableAutomationEventscheck
boxes.
8/9/2019 VisioUML2.2Tips
2/5
TipsforusingaVisiotemplateforUML2.2,availableathttp://softwarestencils.com Page2
Whenyourightclickmostoftheshapes,ausefulmenu
appears.
Youcanopenadditionalcompartmentsofaclass,object,package,part,
component,node,state,andusecase.Todoso,clickthecontrolonthe
bottomlineoftheshapeanddragitup.
Youcanedittextintheadditionalcompartments.Toinsert
newtext,selecttheshapeandclickonceontheadditional
compartment.ItturnsgrayinVisio4.15.0andinVisio
2000
2002
it
changes
its
corners
to
a
light
green
symbol
that
lookslike(x).Then,typeinthetext.
Toeditexistingtext,selecttheadditionalcompartmentand
pressF2,orselectTextTool(clickiconAonthemenu
bar),orrightclicktheselectedcompartmentandselectEdit
Textfromthemenu.EditTextmenuisavailableonlyin
Visio2000andVisio2002.
Toaddassociationrolesandcardinalities (multiplicities)toassociations,
selecttheshapeandclickonceontheyellowcontrol(greeninVisio2000).
Itselectstheunderlyingtextbox,whichturnsgreen.Then,typetextin.To
editexisting
text,
click
once
on
the
yellow
control,
and
press
F2,
or
select
TextToolfromthemenu.
TextoftheLabelshapecanbemovedtotherightorleftsideoftheyellow
control(greeninVisio2000).SelecttheLabelshape,andClickAlignRight
buttononFormattingToolbartomovetexttotheleftsideofthecontrol.
AlignLeftmovestextright,andAligncentermovesthecontroltothe
middleofthetext.
8/9/2019 VisioUML2.2Tips
3/5
TipsforusingaVisiotemplateforUML2.2,availableathttp://softwarestencils.com Page3
Inthebottomleftcornerofmosttwodimensionalshapesthereisapool
ofconnectionpointsthatyoucanmovearoundusingcontrols.For
example,youcanmovethemneartoclassoperationsorattributes,and
thenconnectRelationshipsorNotestothem.
Thereis
an
alternative
way
of
adding
connection
points
to
ashape
side.
IfyourightclicktheshapeRegion/Partition,youcanturnitintoa
ConnectionPointsLine,whichisaninvisiblelinecontaining80
connectionpoints.
YoucangluetheRegion/Partitiontoanothershapeandinthisway
increasethenumberofconnectionpointsonitssides.
TheStateLifelineinTimingDiagramcanbemodifiedbymovingthe
controlsattherightside.
InVisio2003andearlierversions,youcaneasilychangeaclasstoan
object,andviceversa,bychangingitstextstylefrom"UMClassifier"to
"UMInstance".Inthisway,youcaneasilycreateacommunicationdiagram
from
a
class
diagram
by
copying
and
pasting
the
class
diagram
and
then
selectingalltheclassesandchangingtheirtextstyle.
InVisio2007,Microsofthasdisablesstyles,unlessyourunadeveloper
mode.Howtoenabledevelopermode,pleasereadahelpiteminVisio
2007Whathappenedtostyles?
8/9/2019 VisioUML2.2Tips
4/5
TipsforusingaVisiotemplateforUML2.2,availableathttp://softwarestencils.com Page4
ThestencilcontainsbothUML2.2 shapesandnonnormativeshapes,
which
are
the
shapes
not
defined
in
the
standard,
but
used
in
some
UML
booksandpapers.
Thenonnormativeshapeoptionsarealwaysatthebottomoftheright
clickmenus;thenonnormativestereotypesandiconsareplacedafterthe
iconNonnormativeUML.
UnlessyouhaveaverygoodknowledgeofUML,dontusethenon
normativeshapes.Rather,trytofindthecorrectUMLwaytoexpressyour
softwaredesign.
Stereotypes
arein
the
stencil
for
Visio
2000
and
earlier
versions
availablefromtherightclickmenu.
InVisio2002andlaterversions,Microsoftforsecurityreasonsremoved
thefunctionalitythatmadethispossible,therefore, pleaseinsert
stereotypesastext.
YoucansettheautocorrectoptionsofMicrosoftOfficetoreplaceby,tomakeiteasier.Todoso,pleaseselectVisiomenuitem
Tools/AutoCorrectOptions.Thecharactersandareaccessiblefrom
CharacterMap
in
Windows.
Character
Map
can
usually
be
opened
by
selecting AllPrograms/Accessories/SystemTools/CharacterMap.
8/9/2019 VisioUML2.2Tips
5/5
TipsforusingaVisiotemplateforUML2.2,availableathttp://softwarestencils.com Page5
InformationforAdvancedUsers
Thestencilandtemplatecontainthefollowingstyles:o UMNormal:basedonstyleNormal,withArial8pt.regularfont,andLineweight1o UMConnector(textstyle):basedonUMNormal,buttextisalignedlefto UMClassifier(textstyle):basedonUMNormal,buttextisbold,notextbackgroundo UMInstance(textstyle):basedonUMNormal,buttextisunderlined,notextbackground
Thecontrolsusedfortextpositioningensurethataconstantdistanceiskeptbetweenthetextandtheclosestlineend,orthetextandtheclosestsideorsidesofatwodimensionalshape.Likewise,ifthetextispositionedinthemiddleof
theshape,itwillremaininthemiddleregardlessofhowyouchangetheshapesize.
ForVisio5.0andVisio4.1:VisioautomaticallycreatesnewconnectionpointsonObjectlifelinesandActivationswhenyouconnectmessagestothem.(Ifitdoesnt,clickTools,Snap&GlueandplacecheckmarksintheGlueandShape
Verticescheck
boxes.)
If
you
later
disconnect
the
object
lifeline
and
the
message,
Visio
5.0
and
earlier
versions
do
not
removetheconnectionpointsautomatically.Ifyoudontwanttoseetheextraconnectionpoints,youcanclickView
anddeselectConnectionPoints.Alternatively,youcandeletethemmanuallybyselectingConnectionPointTool.You
canthenselecttheextraconnectionpoint,whichturnsmagenta,andpresstheDeletekey.Visio2000removesthe
connectionpointsautomatically.
ForVisio5.0:TheroutableconnectorintheVisio5.0stencilsometimeschangesitspathunexpectedly,forexample,whenoneendoftheconnectorisinsideandtheotherendisoutsideasymbol,suchaspackageandclass.Visiofixed
thisprobleminVisio2000andlaterversionsbutnotinVisio5.0.Therefore,ifyouuseVisio5.0,andtheroutable
connectorwouldntbehaveasyouexpect,Irecommendthatyouusetheangledorstraightconnectors
Detailsabout
the
Stencil
Design
Somerelatedshapeshavethesamedesignanddifferonlyintheirinitialstates.Thismeansthatifyouredesignone,youmustredesignall.Thefollowingshapesarehavethesameorsimilardesign:
o StraightRelationshipandRoutableRelationshiparethesameshapeo Package,Class,Object,andPartarethesameshapeo Activity/EventandObject/Signalarethesameshapeo Region/PartitionandFork/JoinNodearethesameshapeo PseudostateandFlow/Activity/Initial/Finalarealmostthesame;theydifferonlyintherightclickmenus.o FrameandInteractionOccurrencearealmostthesame;doubleclickonFrameeditsthetextofthepentagon
inupperleftcorner,anddoubleclickonInteractionOccurrenceeditsthetextoftheshapebody.From
developerperspective,FramehasdisabledEditGroupText,andControl3isinvisible.
Althoughthestencilisdesignedtoallowmaximaldrawingfreedom,thereisasmallrestrictiononformattingthetextintheadditionalcompartmentsofPackage,Class,Object,Part,State,Node,ComponentandUseCase.Ifyou
formatthetextintheadditionalcompartmentsusinghorizontalalignment=centerandverticalalignment=middle,
thefirstcharactercannotbeunderlinedortypedinboldface.(Itcan,however,beboldandunderlined).Ifyouchoose
oneofthesetwoformatsforthefirstcharacter,theformatautomaticallyswitchestothedefaultformatforthis
compartment,whichishorizontalalignment=left,verticalalignment=top,andregularfont.Thesetwoformatsare
rarelyused.Youmightcomeacrossthissituationpracticallyonlyifyouapplyyourowntextstylestotheshape.