The TikZ-UML package. Nicolas Kielbasiewicz
|
|
|
- Douglas O’Brien’
- 9 years ago
- Views:
Transcription
1 The TikZ-UML package Nicolas Kielbasiewicz March 29, 2016
2 Contents 1 Preamble Dependencies Required packages Installation Class diagrams Packages, classes, attributes and operations To define a package To define a class To define a relation between classes General command To define the geometry of a relation To adjust the geometry of a relation To define informations about attributes of a relation To place information about attributes of a relation To adjust the alignment of information about attributes of a relation To define and place the stereotype of a relation To modify the anchor points of a relation To define a recursive relation Name of auto-built points of a relation To draw an intersection point between relations dvanced styling of a relation N-ary associations Comments / constraints note ssociation class dvanced features for positioning Horizontal and vertical alignment Relative positioning To change preferences Examples Example from introduction, step by step To define a specialization of a class Priority rules of options and known bugs Use case diagrams To define a system To define an actor To define a use case To define a relation dvanced features for positioning Horizontal and vertical alignment
3 3.5.2 Relative positioning To change preferences Examples Example from introduction, step by step State-transitions diagrams To define a state To define a transition To define a unidirectional transition To define a recursive transition To define a transition between sub states dvanced features for positioning Horizontal and vertical alignment Relative positioning To change preferences Examples Example from introduction, step by step Sequence diagrams To define a sequence diagram To define an object Types of objects utomatic placement of an object To scale an object To define a function call asic / recursive calls To place a call Synchron / asynchron calls Operation, arguments and return value To define a constructor call To name a call To define a combined fragment Informations of a fragment Name of a fragment To define regions of a fragment To change preferences Examples Example from introduction, step by step Known bugs and perspectives Component diagrams To define a component To define a provided/required interface To define an assembly connector To define the geometry of an assembly connector To place the assembly connector symbol To adjust the geometry of an assembly connector To define a delegate connector To define a port on a component To change preferences Examples Example from introduction, step by step
4 Chapter 1 Preamble In front of the wide range of possibilities given by the PGF/TikZ library, and in front of the apparent lack of dedicated packages to UML diagrams, except to one specific diagram, such as pgf-umlcd (for class diagrams) and pgf-umlsd (for sequence diagrams), I was to develop the TikZ-UML package, with a set of specialized commands and environments for these diagrams. It is dedicated to succeed pst-uml package, that was developped for similar reasons in PSTricks. ctually, the package contains definitions of complete class diagrams, use case diagrams, sequence diagrams, state diagrams and component diagrams in a quite easy way. Some improvements are still needed, but it is near the final release. Here is an example of class diagram you can draw: 3
5 p sp1 T n : uint t : float d : double set(b : ) : void get() : toto 1 Je suis une note qui concerne la relation d import sp2 Je suis une note qui concerne la classe * tata interface C n : uint s : string 1 tutu titi * D n : uint vector We will now show you the various functionnalities of TikZ-UML, but before we will talk about packages dependencies and installation of TikZ-UML. 1.1 Dependencies Required packages tikz: It is useless to present this extremely powerful and complete drawing package. Every diagram generated by TikZ-UML is in fact generated by TikZ. It also gives some packages and libraries used by TikZ-UML, such as the backgrounds, arrows, shapes, fit, shadows, decorations.markings libraries and the pgfkeys package that manages macros options. ifthen: This package offers the management of conditional test, such as if... then... else... xstring: This package offers string substitutions. It is used for the management of names between programmation items (classes, states, packages,... ) and and the nodes representing them. calc: This package offers easy access to calculations. pgfopts: This package is an add-on of the pgfkeys package for the management of packages and classes options. 4
6 For still unknown reasons, TikZ-UML works fine if you have already included the babel package with the language of your choice. 1.2 Installation Coming soon 5
7 Chapter 2 Class diagrams 2.1 Packages, classes, attributes and operations To define a package You can define a package with the umlpackage environment: \ begin{umlpackage} [ x=0, y=0 ] { package name} \end{umlpackage} package-name oth options x and y allow to define the package position in the figure. The default value for both of them is 0. context \ begin{umlpackage} [ x=0, y=0, package-name type=context ] { package name} \end{umlpackage} Option type When a package contains classes and sub-packages, its dimensions automatically fit to its content. You can define as many packages as you want in a figure. For an empty package (that contains no class), you can use a shortcut command: umlemptypackage that takes the same arguments and options as the umlpackage environment To define a class You can define a class with the umlclass command: \umlclass{namespace : : }{ + n : u i n t \\ \ umlstatic{ i : i n t } \\ \# r : const f l o a t }{ + set ( i : i n t ) : void \\ \umlvirt{\# get ( ) : } } namespace:: + n : uint i : int # r : const float + set(i : int) : void # get() : The class name is defined with the first argument or the umlclass command. s you can see, you can use double dots in it. 6
8 The attributes of a class are defined with the second argument of the umlclass command. You write the attributes list using \\ as a delimiter. The operations of a class are defined with the third argument of the umlclass command. To define a static attribute or a static operation, you can use the umlstatic command. In a similar way, the umlvirt command is used to define a virtual operation. For empty classes (that contains no attributes and no operations), you can use a shortcut command umlemptyclass: namespace::class-name \umlemptyclass{ namespace : : c l a s s name} You may also prefer drawing a single rectangle node instead of a 3 parts rectangle node. In this case, you may use the simple option of umlclass or the shortcut command umlsimpleclass that also takes only the class name for argument and the same options as the command umlclass: \umlsimpleclass{namespace : : c l a s s name} namespace::class-name The umlclass command (and its shortcuts) also takes options. Name of the node defining a class To name a class, you may want use special characters, such as, or double dots (:) when giving namespace. Internal mechanism of TikZ-UML name the class node with the class name. ut to name a TikZ node, backslashes and double dots are forbidden. s far as double dots are concerned, string substitutions are done on the class name to define the node name. ut for, it does not work so easily. That is why you can directly name a node with the option name: \ umlclass [ x=0,y=0, name=classname ] { namespace : : c l a s s \ name}{}{} namespace::class name To define coordinates of the class node \umlclass{namespace : : }{ + n : u i n t \\ \ umlstatic{ i : i n t } \\ \# r : const f l o a t }{ + set ( i : i n t ) : void \\ \umlvirt{\# get ( ) : } } \ umlsimpleclass [ x=1, y= 3] {} namespace:: + n : uint i : int # r : const float + set(i : int) : void # get() : oth options x and y allow to define the class position in the figure. 2 cases: if the class is defined inside a package, the class position is relative to the package; on the contrary, the class position is relative to the figure. The default value for both options is 0. To define the width of a class The default width of a class is 10ex. You can use the width option to specify an other value: 7
9 class15 \umlemptyclass [ width=15ex ] { c l a s s 15} \umlemptyclass [ y= 2, width=30ex ] { c l a s s 30} class30 To define type and tagged values of a class There is different types of classes: class, interface, typedef, enum. You can specify it with the type option (the default value is class): \umlemptyclass [ type=i n t e r f a c e ] { c l a s s name} interface class-name The type is written between and above the class name, excepted the class type (default behavior), and the abstract type, where the class name is written in italic style instead: \umlemptyclass [ type=a b s t r a c t ] { c l a s s name} class-name Shortcuts exist for each value of the type option: umlabstract, umltypedef, umlenum, umlinterface. For these shortcuts, option type is forbidden. You can also draw interfaces with a circular node. To do so, you can use the simple option to the umlinterface command, or use the shortcut umlsimpleinterface \umlsimpleinterface [ x=0,y=0 ] { I } To add tagged values to a class, you can use the option tags: I \umlemptyclass [ t a g s={v 1. 2 } ] { c l a s s name} class-name {v1.2} To specify template parameters For a template class, you can use the template option to specify the template parameters list: \umlemptyclass [ template={t,u} ] { c l a s s name} class-name T,U 2.2 To define a relation between classes General command Each class or package is draw as a node sharing the same name. To define a relation between two classes, you just need to specify the source class name, the target class name and a set of options specific to the 8
10 relation: \umlemptyclass{1} \umlemptyclass [ x=3, y= 3] {2} \umluniaggreg [ arg2=a, mult 2=1, pos 2=0.9 ] {1}{2} \ umluniassoc [ geometry =, arg1=x, mult 1=1, pos 1=1.9, arg2=y, mult 2=, pos 2=0.2 ] {1}{2} \umlunicompo [ arg=z, mult = 1.., pos =0.8, angle 1= 90, angle 2= 140, l o o p s i z e =2cm ] {2}{2} 1 y * z 1 1..* a 1 x 2 From a UML semantic point of view, there are 12 different relations. Every type of relation is defined in TikZ-UML : dependency: You can use the umldep command 1 2 n association: You can use the umlassoc command 1 2 unidirectional association: You can use the umluniassoc command 1 2 n aggregation: You can use the umlaggreg command 1 2 unidirectional aggregation You can use the umluniaggreg command 1 2 composition: You can use the umlcompo command 1 2 9
11 unidirectional composition: You can use the umlunicompo command 1 2 n import: You can use the umlimport command P1 P2 n inheritance: You can use the umlinherit command 1 2 n implementation: You can use the umlimpl command 1 2 nesting: You can use the umlnest command 1 2 realization: You can use the umlreal command 1 2 These 12 shortcuts are based on the same scheme (the umlrelation command) and take theoretically the same set of options. Nevertheless, some options concern only part of them To define the geometry of a relation s you may have seen in previous examples, you can specify the geometric shape of a relation with the geometry option. It needs a value among the following list: - - (straight line), - (horizontal then vertical), - (vertical then horizontal), - - (horizontal chicane) ou - (vertical chicane). These values are very inspired from TikZ philosophy. It seems that this option is used very often. That is why a shortcut of the umlrelation command has been defined each possible value of the geometry option: umlhvrelation: shortcut of umlrelation with geometry=- umlvhrelation: shortcut of umlrelation with geometry= - 10
12 umlhvhrelation: shortcut of umlrelation with geometry=- umlvhvrelation: shortcut of umlrelation with geometry= - For each of these 4 shortcuts, the geometry option is forbidden. There is no shortcut for the value - -: this is the default value for the umlrelation command To adjust the geometry of a relation When the geometry is built with 2 segments, you can define the coordinates of the auto-built point, named control node. Then, instead of using umlrelation, you should use the umlcnrelation command, or one of its 12 shortcuts: 1 \umlemptyclass{1} \umlemptyclass [ x=3,y= 3] {2} \umluniaggreg [ geometry= ] {1}{2} \umlcnuniassoc{1}{ 4, 0}{2} 2 When the geometry is built with 3 segments, the relative position of the middle segment between classes is defined by the midlle of the classes nodes. You can adjust this parameter with the weight option: \umlemptyclass{1} \umlemptyclass [ x=4, y= 1] {2} \umlemptyclass [ y= 2] {3} \umlassoc [ geometry= ] {1}{2} \umluniaggreg [ geometry=, weight =0.3 ] {3}{2} In some cases, this option is not very convenient, because it needs to compute the option value to give. There is another possibility by uusing the arm1 and arm2 options, that control the size of the first and last segment respectively. Let s see the 2 following examples using respectively the weight option and the arm1 option: \umlemptyclass{1} \umlemptyclass [ x=4, y=1 ] {2} \umlemptyclass [ x=6, y=3 ] {3} \umlhvhdep[ weight =0.375 ] {1}{2} \umlhvhdep[ weight =0.25 ] {1}{3}
13 \umlemptyclass{1} \umlemptyclass [ x=4, y=1 ] {2} \umlemptyclass [ x=6, y=3 ] {3} \umlhvhdep[ arm1=1.5cm ] {1}{2} \umlhvhdep[ arm1=1.5cm ] {1}{3} The arm1 and arm2 options also take negative values. How does it work then? positive value means an arm oriented to the right direction (to the right or to the top), whereas a negative valuemeans an arm oriented to the opposite direction, that allows you to draw other 3-segments relations: \umlemptyclass{1} \umlemptyclass [ x=4, y=2 ] {2} 2 \umlhvhdep[ arm2= 2cm ] {1}{2} \umlhvhdep[ arm2=2cm ] {1}{2} To define informations about attributes of a relation relation means a dependency between two classes and represents an attribute in most of the cases. You can define its name with the arg1 option or the arg2 option, and its multiplicity with the mult1 option or the mult2 option: \umlemptyclass{1} \umlemptyclass [ x=5 ] {2} \umlassoc [ arg1=arg 1, mult1=mult 1, arg2=arg 2, mult2=mult 2 ] {1}{2} 1 arg1 mult1 arg2 mult2 2 For unidirectional relations, you should use only arg2 and mult2 options. That is why shortcuts have been defined, namely the arg option and the mult option respectively. In addition, when you define the name and the multiplicity of an attribute, you may prefer use the all-in-one following options attr1, attr2 and attr: \umlemptyclass{1} \umlemptyclass [ x=5 ] {2} \umlassoc [ a t t r1=arg 1 mult 1, a t t r2=arg 2 mult2 ] {1}{2} 1 arg1 mult1 arg2 mult2 2 This has an advantage: the semantic of the two values has disappeared and you can switch them for convenience: \umlemptyclass{1} \umlemptyclass [ x=5 ] {2} \umlassoc [ a t t r1=mult 1 arg 1, a t t r2=mult 2 arg 2 ] {1}{2} 1 mult1 arg1 mult2 arg2 2 12
14 2.2.5 To place information about attributes of a relation You can place information seen in previous section with the following options: pos1, pos2 and pos. The umlrelation command determine by itself if name and multiplicity should be written on left and right or on top and bottom of the arrow, according to the geometry and their placement. For those who know TikZ enough, the mechanism is based on auto and swap options. \umlemptyclass{1} \umlemptyclass [ x=2, y= 2] {2} \umlemptyclass [ x= 2, y= 2.5 ] {3} \umlassoc [ geometry =, arg1=x, mult 1=1, pos 1=0.2, arg2=y, mult 2=, pos 2=1.9 ] {1}{2} \umlassoc [ geometry =, arg1=a, mult 1=1, pos 1=0.5, arg2=b, mult 2=, pos 2=1.5 ] {1}{3} 3 * b 1 1 a x 1 * y 2 You may have noticed that the range of values of the position depends on the number of segments composing the arrow. For a straight line, position has to be between 0 (source class) and 1 (target class). If there are 2 segments, then position has to be between 0 et 2 (target class), the value 1 corresponding to the control node. Otherwise, position has to be between 0 et 3, values 1 and 2 corresponding to the first and second control node respectively To adjust the alignment of information about attributes of a relation Name and multiplicity of an attribute, when they are written on top and bottom of the relation, are centered by default. You can define an other alignment. The options align1, align2 and align are used to have ragged right or ragged left text: \umlemptyclass{1} \umlemptyclass [ x=4, y= 3] {2} \umlassoc [ geometry=, arg1=arg 1, mult1=mult 1, pos 1=0.1, a l i g n1= l e f t, arg2=arg 2, mult2=mult 2, pos 2=2.9, a l i g n 2= r i g h t ] {1}{2} 1 arg1 mult1 arg2 2 mult To define and place the stereotype of a relation The stereotype of a relation is a keyword contained between and. You can define it with the option stereo and place it with the option pos stereo. 1 \umlemptyclass{1} \umlemptyclass [ x=4, y= 3] {2} \umlassoc [ geometry=, s t e r e o=vector, pos s t e r e o =1.2 ] {1}{2} vector 2 13
15 2.2.8 To modify the anchor points of a relation The default behavior of a relation is to start from the center anchor of the source class node and to end to the center anchor of the target class node. You can adjust this with the options anchor1 and anchor2. \umlemptyclass{} \umlemptyclass [ x=4,y=2 ] {} \umldep [ geometry= ] {}{} \umlassoc [ geometry =, anchor 1=30, anchor 2=300, name=a s s o c 1 ] {}{} \umlassoc [ geometry =, anchor 1= 30, anchor 2= 60, name=a s s o c 2 ] {}{} You give angular values in degree and they can be negative. The internal mechanism of TikZ uses modulos. The value 0 is east, 90 is north, 180 (or -180) is west, et 270 (or -90) is south. The following figure illustrates this option and its angular meaning on 2 examples of rectangular nodes, (class nodes for instance). You can notice that border anchors (to use TikZ vocabulary) depend on node dimensions. north north 40 west center Rectangle 30 o east west center O 30 o east -30 south south You will very often define anchor1 and anchor2 simultaneously. In this case, you can use the all-in-one option anchors: \umlemptyclass{} \umlemptyclass [ x=4,y=2 ] {} \umldep [ geometry= ] {}{} \umlassoc [ geometry =, anchors =30 and 300, name=a s s o c 1 ] {}{} \umlassoc [ geometry =, anchors= 30 and 60, name=a s s o c 2 ] {}{} To define a recursive relation You can define recursive relations, namely a relation from a class to itself. Then, the geometry option is disabled, but 3 specific options are available: angle1 determines the start angle, angle2 determines the end angle, and loopsize controls the size of the loop. 14
16 \umlemptyclass{1} \umlassoc [ arg=x, mult=1, pos =0.6, angle 1= 90, angle 2= 140, l o o p s i z e =2cm ] {1}{1} \umlassoc [ arg=y, mult = 1.., pos =0.6, angle 1= 90, angle 2= 140, l o o p s i z e =4cm ] {1}{1} \umlassoc [ arg=z, mult = 0.., pos =0.8, angle 1= 90, angle 2=0, l o o p s i z e =2cm ] {1}{1} y x 1..* 1 1 z 0..* When you use recursive relations, you will notice that you will need the 3 options simultaneously. This is the reason why a compact form is defined, the recursive option, and the following syntax: \umlemptyclass{1} \umlassoc [ arg=x, mult=1, pos =0.6, r e c u r s i v e = cm ] {1}{1} \umlassoc [ arg=y, mult = 1.., pos =0.6, r e c u r s i v e = cm ] {1}{1} \umlassoc [ arg=z, mult = 0.., pos =0.8, r e c u r s i v e = cm ] {1}{1} y x 1..* 1 1 z 0..* Name of auto-built points of a relation In order to understand the purpose of giving a name to a relation, one should explain how arrows are defined. To build an arrow, we need to define control nodes, and a name for each one. The only way to identify a relation is to give a name using a id counter. This counter is incremented each time we define a relation in a picture. Let s suppose the relation has the id i. The name of the relation, called relname in the following, is: relation-i The first defined node is the middle of the class nodes. It is called relname-middle. To simplify, we will not deal with the placement of the argument and its multiplicity here. So, there are 3 cases: 1. If the arrow is a straight line or a recursive line, it is renamed in relname-1. relname-1 relname-1 2. If the arrow has one right angle, the node placed at the angle is named relname-2, that is enough to draw the arrow. 2 other nodes are defined, placed at the middle of each arc and named respectively relname-1 and relname-3. 15
17 relname-1 relname-3 relname-2 3. If the arrow has 2 right angles, they are defined with relname-middle, that is enough to draw the arrow. Nodes placed at the angles are named respectively relname-2 and relname-4. 3 other nodes are defined, at the middle of each arc, named respectively relname-1, relname-3, and relname-5. relname-4 relname-5 relname-1 relname-3 relname-2 This default behavior is not easy to use, because the value of the counter is not defined by the user, and depends on the order of definition of the relations in the picture. This is the reason why you can define relname thanks to the name option. In the two following sections, you will see when this option is useful To draw an intersection point between relations When you draw a diagram, it occurs that relations cross other ones or share arcs. Let s take two crossing arrows. Can both start points go graphically to both end points? If yes, you will want to draw a point at the intersection of the arrows, and this point should be a control node of one the the relations. To define the point, you can use the umlpoint command. \umlemptyclass{1} \umlemptyclass [ x=4, y= 1] {2} \umlemptyclass [ y= 2] {3} \umlassoc [ geometry=, name=a s s o c ] {1}{2} \umluniaggreg [ geometry=, weight =0.3 ] {3}{2} \umlpoint{ assoc 4} dvanced styling of a relation On a relation, you can use every TikZ option, thickness options for instance: \umlemptyclass{1} \umlemptyclass [ r i g h t=3cm o f 1 ] {2} \umluniaggreg [ anchors =10 and 170 ] {1}{2} \umluniaggreg [ anchors= 10 and 170, very t h i c k ] {1}{2}
18 N-ary associations Sometimes, you need to draw a relation between more than two classes, namely a n-ary association. To do so, you have to draw the main node of such a relation, ans link it to every class it has to be linked: \umlemptyclass{} \umlemptyclass [ x=6 ] {} \umlemptyclass [ x=3, y=3 ] {C} \umlnarynode [ x=3, name=naryassoc, below ] { l a b e l } \umlassoc [ a t t r1=a ] {}{ naryassoc } \umlassoc [ mult 1=0..1 ] {}{ naryassoc } \umlassoc [ mult= ] { naryassoc }{C} The umlnarynode command accepts the following options: a * C * label 0..1 width: to set the width of the node name: to give a name to the node and use it in others macros below, below left, left, above left, above, above right, right, below right: to place the label of the n-ary node. Contrary to their equivalents in TikZ, these options has to be used without values. The default is above. To use advanced positioning, do not forget to load TikZ library positioning 2.3 Comments / constraints note note is a text comment attached to a class or a relation. The umlnote command needs the name of the node as argument: \umlemptyclass{1} \umlnote [ x=3 ] {1}{ Je s u i s une note a t t a c h e e a l a c l a s s e 1} \umlnote [ x=2,y= 3, width=5cm ] {1}{ Je une note p l u s l a r g e a t t a c h e e a l a c l a s s e 1} s u i s 1 Je suis une note attachee a la classe 1 Je suis une note plus large attachee a la classe 1 Here again, you can give the name of a control node of a relation to attach the note. Giving a name to the relation will be very useful: \umlemptyclass{} \umlemptyclass [ x=4 ] {} \umluniassoc [ arg=bb, mult=1, pos =0.95, a l i g n=r i g h t, name=u n i a s s o c ] {}{} \umlnote [ x=2,y= 3] { uniassoc 1}{Je s u i s une note a t t a c h e e a l a r e l a t i o n u n i a s s o c } bb 1 Je suis une note attachee a la relation uniassoc 17
19 Notes have 2 uses: comments and contraints (generally in OCL format). The umlnote command has the following options: x, y These 2 options define the coordinates of the note. width This option defines the width of the note. For TikZ users, it encapsulates the text width option weight, arm, anchor1, anchor2, anchors These options has the same behavior as for umlrelation, arm being equivalent to arm1, namely attached to the note. \umlemptyclass{} \umlemptyclass [ x=4 ] {} \umluniassoc [ arg=bb, mult=1, pos =0.95, a l i g n=r i g h t, name=u n i a s s o c ] {}{} \umlnote [ y= 3, geometry =, anchor 1=70, arm=0.5cm ] { uniassoc 1}{Je s u i s une note a t t a c h e e a l a r e l a t i o n u n i a s s o c } Je suis une note attachee a la relation uniassoc bb 1 For a note, you can also use the geometry option, as for umlrelation. Default value is. For other values, aliases have been defined: umlhvnote, umlvhnote, umlhvhnote and umlvhvnote. For each of these aliases, the geometry option is forbidden. 2.4 ssociation class Drawing an association class is very easy with TikZ-UML. It is just a class and a dependency between this class and a built point of another relation. The umlassocclass makes it for you: \umlemptyclass{} \umlemptyclass [ x=6, y= 3] {} \umlhvassoc [ name=assoc, a t t r=t, pos =1.9 ] {}{} \ umlassocclass [ geometry =, x=2, y= 3] {C}{ assoc 1}{}{} C * t s the command is like a class and a relation, you can use the following options: x, y, width (default is 10ex), type (default is class), template coming from the umlclass environment, and name, geometry (default is - -), weight, arm, anchor1, anchor2, and anchors coming from the umlrelation command. 2.5 dvanced features for positioning umlpackage, umlclass and their aliases, umlnote and umlassocclass can accept every option key defined for nodes in TikZ. In this section, you will see how some of them can be used for advanced features. 18
20 2.5.1 Horizontal and vertical alignment In a class diagram, classes have different width and height. For a graphical purpose, you may want to align them horizontally or vertically. Let s take the following example: \ umlsimpleclass{} \umlemptyclass [ x= 2, y= 3] {} \umlclass [ x=2, y= 3] {C}{ i : i n t \\ r : double }{} \umlvhvinherit{}{} \umlvhvinherit{c}{} C i : int r : double The y coordinate defines the center of the class node. It will be better in this example to have classes and C top-aligned. solution is to define manually the y value for C, but it is not very convenient. You may prefer use the anchor option. If you specify anchor=north, the y coordinate will define the top center anchor of the node, instead of the center. You may take a look at the differences between both codes. \ umlsimpleclass{} \umlemptyclass [ x= 2, y= 2, anchor=north ] {} \ umlclass [ x=2, y= 2, anchor=north ] {C}{ i : i n t \\ r : double }{} \umlvhvinherit [ arm2= 1.2cm ] {}{} \umlvhvinherit [ arm2= 1.2cm ] {C}{} C i : int r : double In a similar way, you may use anchor=east to right align classes, anchor=west to left align classes or anchor=south to bottom align classes. For empty packages, association classes and notes, you can also use the mechanism Relative positioning Using the x-y coordinate system may be very hard in big diagrams, when you have to change position of elements in order to fit the diagram to the page. Relative positioning may be useful in this case, namely advanced syntax of options above, left, below, right, above left, below left, below right and above right provided by the TikZ library positioning. Let s take the previous example, you can define by its cordinates (-2,-2) or by saying that is 2cm below and 2cm left of. You can also define C by saying it is 4cm right of. Notice that because of the top alignment of and C, the latter is defined 4cm right of.north. 19
21 \ umlsimpleclass{} \umlemptyclass [ below l e f t =2cm and 2cm o f, anchor=north ] {} \umlclass [ r i g h t =4cm o f. north, anchor=north ] {C}{ i : i n t \\ r : double }{} \umlvhvinherit [ arm2= 1.2cm ] {}{} \umlvhvinherit [ arm2= 1.2cm ] {C}{} C i : int r : double For empty packages, association classes and notes, you can also use the mechanism. 2.6 To change preferences Thanks to the tikzumlset command, you can change default preferences for packages, classes and notes. The available options are: text: allows you to set default text color for every drawn object (=black by default), draw: allows you to define default edge color for every drawn object (=black by default), fill class: allows you to define the default background color of a class node (=yellow!20 by default), fill template: allows you to define the default background color of a template node (=yellow!2 by default), fill package: allows you to define the default background color of a package (=blue!20 by default), fill note: allows you to define the default background color for a note (=green!20 by default), font: allows you to define the default font style for every drawn object (=\small by default). x: allows you to set the default first coordinate (=0 by default) y: allows you to set the default second coordinate (=0 by default) package type: allows you to set the default package type (=package by default) class width: allows you to set the default class width (=10ex by default) simple interface width: allows you to set the default width of a simple interface (=4ex by default) class type: allows you to set the default class type (=class by default) narynode width: allows you to set the default n-ary node width (=6ex by default) relation geometry: allows you to set the default geometry of a relation (= by default) relation angle1: allows you to set the default angle1 of a relation (=-30 by default) relation angle2: allows you to set the default angle2 of a relation (=30 by default) relation loopsize: allows you to set the default loopsize of a relation (=3em by default) relation weight: allows you to set the default weight of a relation (=0.5 by default) relation pos1: allows you to set the default pos1 of a relation (=0.2 by default) 20
22 relation pos2: allows you to set the default pos2 of a relation (=0.8 by default) relation pos stereo: allows you to set the default pos stereo of a relation (=0.5 by default) note width: allows you to set the default note width (=3cm by default) Furthermore, relation commands has the style option taking a TikZ style name as value. Let s see the definition of the umlinherit command: \ tikzstyle { tikzuml i n h e r i t s t y l e }= [ c o l o r=\tikzumldefaultdrawcolor, open t r i a n g l e 45 ] \newcommand{\ umlinherit} [ 3 ] [ ] {\ umlrelation [ s t y l e ={tikzuml i n h e r i t s t y l e }, #1] {#2}{#3}} You can easily define a command on this model by defining a particular style. 2.7 Examples Example from introduction, step by step We will now build step by step the picture seen in introduction to understand the behavior of each used command. Definition of packages p, sp1 and sp2 The package p is placed at (0,0) (default), and the sub-packages sp1 and sp2 respectively at (0,0) and (10,-6). \ begin{umlpackage}{p} \umlvirt{ set ( b : ) : void } \\ get ( ) : } \end{umlpackage} }{} }{} p sp1 sp2 21
23 Definition of classes,, C, D and their attributes and operations The class is placed at (0,0) in the sub-package sp1 and has a template parameter: T. The class is placed 3 units below, still in the sub-package sp1. The interface C is placed at (0,0) in the sub sp2. The class D is placed at (2,-11) in the package p. Class has two attributes. Class has one attribute and two operations (one is virtual). Class C has two attributes. Classe D has one attribute. \ begin{umlpackage}{p} \ begin{umlpackage}{ sp 1} \umlclass [ t e m p l a t e=t] {}{ n : u i n t \\ t : f l o a t }{} \umlclass [ y= 3] {}{ d : double }{ \umlvirt{ set ( b : ) : void } \\ get ( ) : } \end{umlpackage} \begin{umlpackage} [ x=10,y= 6] { sp 2} \ umlinterface{c}{ n : u i n t \\ s : s t r i n g }{} \end{umlpackage} \umlclass [ x=2,y= 10] {D}{ n : u i n t }{} 22
24 p sp1 T n : uint t : float d : double set(b : ) : void get() : sp2 interface C n : uint s : string D n : uint Definition of relations We define an association between classes C and, a unidirectional composition between classes D and C, an import relation named import between sub-packages sp2 and sp1 (with modification of anchors), a recursive aggregation on class D and an inheritnce between classes D and. On thses relations, we will specify argument names and multiplicities. You can notice the value given to place these elements on each arrow according to the geometry.... \end{umlpackage} \umlassoc [ geometry=, arg1=t a t a, mult 1=, pos 1=0.3, arg2=t o t o, mult 2=1, pos 2=2.9, a l i g n 2= l e f t ] {C}{} \umlunicompo [ geometry =, arg=t i t i, mult =, pos =1.7, s t e r e o=v e c t o r ] {D}{C} \umlimport [ geometry =, anchors=90 and 50, name=import ] { sp 2}{ sp 1} 23
25 p sp1 T n : uint t : float d : double set(b : ) : void get() : toto 1 sp2 * tata interface C n : uint s : string 1 tutu titi * D n : uint vector Definition of notes We add a note attached to class and a note attached to the import relation.... \umlaggreg [ arg=tutu, mult =1, pos =0.8, a n g l e 1=30, a n g l e 2=60, l o o p s i z e =2cm] {D}{D} \ umlinherit [ geometry= ] {D}{} \umlnote [ x =2.5, y= 6, width=3cm] {}{ Je s u i s une note qui concerne l a c l a s s e } \umlnote [ x =7.5, y= 2] { import 2}{Je s u i s une note qui concerne l a r e l a t i o n d import } 24
26 p sp1 T n : uint t : float d : double set(b : ) : void get() : toto 1 Je suis une note qui concerne la relation d import sp2 Je suis une note qui concerne la classe * tata interface C n : uint s : string 1 tutu titi * D n : uint vector Setting style We illustrate the use of the tikzumlset command by changing colors associated to class and font. We can also change colors of a given class with draw, text and fill options. \tikzumlset{ f i l l c l a s s=red! 2 0, f i l l template=v i o l e t! 1 0, f o n t=\bfseries \ footnotesize }... \umlclass [ x=2,y= 11, f i l l =orange! 5 0, draw=white, t e x t=red ] {D}{ n : u i n t }{}... 25
27 p sp1 T n : uint t : float d : double set(b : ) : void get() : toto 1 Je suis une note qui concerne la relation d import sp2 Je suis une note qui concerne la classe * tata interface C n : uint s : string 1 tutu titi * D n : uint vector To define a specialization of a class specialization of a classe is an inheritance from a templace class in which one of the template parameters is defined. To draw this relation, you will use the umlreal command, and its stereo option: \umlemptyclass [ template=t] {} \umlemptyclass [ template={t,u}, x=5, y= 2] {} \umlreal [ s t e r e o={u $\ r i g h t a r r o w $ i n t } ] {}{} T U int T,U 2.8 Priority rules of options and known bugs 1. The geometry option has always the priority on the others options. It means for instance that if it has a non-default value, then angle1, angle2 and loopsize options, defining recursive relations, will be ignored. 26
28 2. s far as a template class is concerned, there are cases in which a relation about it will not be drawn correctly, as in the picture below, where the aggregation symbol is hidden by the template parameter: \umlemptyclass [ template=t] {} \umlemptyclass [ x=4,y=2 ] {} \umluniaggreg{}{} T To solve this problem, you van link the arrow between the template part of class and class, by adding the suffix -template and adjusting the start anchor (the -30 value is correct here): \umlemptyclass [ template=t] {} \umlemptyclass [ x=4,y=2 ] {} \umluniaggreg [ anchor1= 30 ] { template }{} T 3. If you define a class with a name having the: character in it typically when you give the namespace of the class it may have a conflict with the french (or frenchb or francais) option of the babel package. Indeed, these options add a white-space before the: character if the writer forgot it, that is a problem for the access operator::. If we take the example of class definition, we should obtain: \umlclass{namespace : : }{ + n : u i n t \\ \ umlstatic{ i : i n t } \\ \# r : const f l o a t }{ + set ( i : i n t ) : void \\ \umlvirt{\# get ( ) : } } namespace::class-name The solution is to use a specific macro given by these options of babel package you have to use in the preamble of your document: \ f r e n c h b s e t u p { utospacepunctuation=f a l s e } 4. The automatic placement of argument names and multiplicity on a relation can be surprising when you can to deactivate it. Let s take the example shown in introduction. If we focus on the association relation and its attributes toto and tata, toto is above, tata is below. If we justify to the right the tata attribute (and change its position to 0.1), positions of tata and its multiplicity exchange. 27
29 p sp1 T n : uint t : float d : double set(b : ) : void get() : toto 1 Je suis une note qui concerne la relation d import sp2 Je suis une note qui concerne la classe tata * interface C n : uint s : string 1 tutu titi * D n : uint vector 28
30 Chapter 3 Use case diagrams Here is an example of use case diagram you can draw: The system The system user use case1 use case2 use case4 on 2 lines use case5 extend admin include subuser use case3 use case6 note on include dependency We will see how to define the four constitutive elements of such a diagram: the system, the actors, the use cases and the relations. 3.1 To define a system system is defined by the umlsystem environment: \ begin{umlsystem} [ x=0, y=0 ] { system name} system name system name \end{umlsystem} oth options x and y allow to place the system in the picture. The default value is 0. Inside this environment, you will define use cases, whereas outside, you will define actors. 29
31 3.2 To define an actor You can define an actor with the umlactor command: \umlactor [ x=0, y=0 ] { u s e r } oth options x and y allow to place the actor in the picture. The default value is 0. You can change dimensions of the actor symbol with the scale option. It also adapts position of the label below: user \umlactor{ normal u s e r } \umlactor [ x=2, s c a l e =0.5 ] { small u s e r } \umlactor [ x=4, s c a l e =2 ] { big u s e r } normal user small user big user The actor symbol size is defined according to the font size (ex unit), whereas the distance between the symbol and the label is in cm. You can adjust it if you need with the below option (0.5cm by default). \tikzumlset{ f o n t=\tiny } \umlactor{ normal u s e r } \umlactor [ x=2, s c a l e =0.5, below =0.1cm ] { small u s e r } \umlactor [ x=4, s c a l e =2 ] { big u s e r } normal user small user big user Every TikZ option dedicated to nodes can be used here, see section 2.5 for details. 3.3 To define a use case You can define a use case with the umlusecase command: \umlusecase [ x=0, y=0 ] { c a s e 1} \umlusecase [ x=3, y=1 ] { c a s e 2} case1 case2 oth options x and y allow to place the use case in the picture or in the container system. The default value is 0. The text argument is the label of the use case. The node representing the use case has a default name, based on a global counter, that is like usecase-17. For pratical reasons, you can rename it thanks to the name option. Furthermore, you can set the witdh of the use case with the width option. Every TikZ option dedicated to nodes can be used here, see section 2.5 for details. Now, we can talk about relations between use cases, systems and actors. 3.4 To define a relation Relations in a user case diagram are of 4 categories: Inheritance relations, between actors or between use cases. You can use the umlinherit command and its aliases, ie subsection
32 ssociation relations, between an actor and a use cases. You can use the umlassoc command and its aliases, ie subsection Include and extend relations. Graphically, it is a dependency relation, as for class diagrams, with the stereotype extend or include. You can use aliases of the umlrelation command, named umlinclude, umlhvinclude,..., umlextend, umlhvextend,..., to define such relations. anchor1, anchor2, anchors, arm1, arm2, weight, geometry (only for umlinclude and umlextend), and pos stereo options are available here. \umlusecase [ name=c a s e 1 ] { use c a s e 1} \umlusecase [ x=5, name=c a s e 2 ] { use c a s e 2} \umlusecase [ x=5, y= 2, name=c a s e 3 ] { use c a s e 3} use case 1 include use case 2 \umlinclude{ c a s e 1}{ c a s e 2} \umlvhextend [ pos s t e r e o =1.5 ] { c a s e 1}{ c a s e 3} extend use case dvanced features for positioning umlactor and umlusecase can accept every option key defined for nodes in TikZ. In this section, you will see how some of them can be used for advanced features Horizontal and vertical alignment In a use case diagram, cases and actors have different width and height. For a graphical purpose, you may want to align them horizontally or vertically. Let s take the following example: \umlactor{} \umlactor [ x= 2, y= 3] {} \umlusecase [ x=2, y= 3] {C} The y coordinate defines the center of the case or actor node. It will be better in this example to have actpr and case C top-aligned. solution is to define manually the y value for C, but it is not very convenient. You may prefer use the anchor option. If you specify anchor=north, the y coordinate will define the top center anchor of the node, instead of the center. You may take a look at the differences between both codes. C \umlactor{} \umlactor [ x= 2, y= 2, anchor=north ] {} \umlusecase [ x=2, y= 2, anchor=north ] {C} C 31
33 You can notice there is still mis-alignement. It is because an actor node is elliptical and hidden. In a similar way, you may use anchor=east to right align classes, anchor=west to left align classes or anchor=south to bottom align classes Relative positioning Using the x-y coordinate system may be very hard in big diagrams, when you have to change position of elements in order to fit the diagram to the page. Relative positioning may be useful in this case, namely advanced syntax of options above, left, below, right, above left, below left, below right and above right provided by the TikZ library positioning. Let s take the previous example, you can define by its cordinates (-2,-2) or by saying that is 2cm below and 2cm left of. You can also define C by saying it is 4cm right of. Notice that because of the top alignment of and C, the latter is defined 4cm right of.north. \umlactor{} \umlactor [ below l e f t =2cm and 2cm o f, anchor=north ] {} \umlusecase [ r i g h t=4cm o f. north, anchor=north ] {C} C 3.6 To change preferences With the tikzumlset command, you can change default colors for use cases, systems, actors and relations: text: allows to set the text color (=black by default), draw: allows to set the edge colors (=black by default), fill usecase: allows to set the background color for use cases (=blue!20 by default), fill system: allows to set the background color for systems (=white by default), font: allows to set the font style (=\small by default). actor below: allows to set the space between actor symbol and text (=0.5cm by default) You can also use text, draw and fill options on a particular element to change its colors, as shown in the introduction example. 3.7 Examples Example from introduction, step by step Definition of actors 32
34 \umlactor{ u s e r } \umlactor [ y= 3] { subuser } \umlactor [ x=14, y= 1.5 ] {admin} user admin subuser Definition of use cases We also show here the use of the fil option. \umlusecase{ use c a s e 1} \umlusecase [ y= 2] { use c a s e 2} \umlusecase [ y= 4] { use c a s e 3} \umlusecase [ x=4, y= 2, width =1.5cm] { use c a s e 4 on 2 l i n e s } \umlusecase [ x=6, f i l l =green!20 ] { use c a s e 5} \umlusecase [ x=6, y= 4] { use c a s e 6} \umlactor{ u s e r } \umlactor [ y= 3] { subuser } \umlactor [ x=14, y= 1.5 ] {admin} user use case1 use case5 use case2 use case4 on 2 lines admin subuser use case3 use case6 Definition of the system s the system is a box used as a new coordinate system, we have to change coordinates of use cases. \begin{umlsystem} [ x=4, f i l l =red!10 ] {The system } \umlusecase{ use c a s e 1} \umlusecase [ y= 2] { use c a s e 2} \umlusecase [ y= 4] { use c a s e 3} \umlusecase [ x=4, y= 2, width =1.5cm ] { use c a s e 4 on 2 l i n e s } \umlusecase [ x=6, f i l l =green! 2 0 ] { use c a s e 5} \umlusecase [ x=6, y= 4] { use c a s e 6} \end{umlsystem} 33
35 \umlactor{ u s e r } \umlactor [ y= 3] { subuser } \umlactor [ x=14, y= 1.5 ] {admin} The system The system user use case1 use case5 use case2 use case4 on 2 lines admin subuser use case3 use case6 Definition of relations and of the note You will notice here the use of the name option to ensure the definition of the note, and its interest for use cases, in order to ignore the order of their definition, as shown in the following example: \begin{umlsystem} [ x=4, f i l l =red! 1 0 ] {The system } \umlusecase{ use c a s e 1} \umlusecase [ y= 2] { use c a s e 2} \umlusecase [ y= 4] { use c a s e 3} \umlusecase [ x=4, y= 2, width =1.5cm ] { use c a s e 4 on 2 l i n e s } \umlusecase [ x=6, f i l l =green! 2 0 ] { use c a s e 5} \umlusecase [ x=6, y= 4] { use c a s e 6} \end{umlsystem} \umlactor{ u s e r } \umlactor [ y= 3] { subuser } \umlactor [ x=14, y= 1.5 ] {admin} \umlinherit{ subuser }{ u s e r } \umlassoc{ u s e r }{ usecase 1} \umlassoc{ subuser }{ usecase 2} \umlassoc{ subuser }{ usecase 3} \umlassoc{admin}{ usecase 5} \umlassoc{admin}{ usecase 6} \umlinherit{ usecase 2}{ usecase 1} \umlvhextend{ usecase 5}{ usecase 4} \umlinclude [ name=i n c l ] { usecase 3}{ usecase 4} \umlnote [ x=7, y= 7] { i n c l 1}{ note on i n c l u d e dependency } 34
36 user subuser use case1 use case2 use case3 include The system The system use case4 on 2 lines use case5 extend use case6 admin note on include dependency 35
37 Chapter 4 State-transitions diagrams Here is an example of state-transition diagram you can draw: graphe Etat global de l objet op2 test1 op1 op3 op4 Visualisation test2 a op5 Now, we will see how to define parts of these diagrams, namely the ten sorts of state and the transitions. 36
38 4.1 To define a state standard state can be defined with the umlstate environment: \ begin{ umlstate} [ x=0, y=0, name=s t a t e ] { s t a t e } state \end{ umlstate} oth options x and y allows to place the state in the figure, or in another state. The default value is 0. The argument to give is the label of the state. The node representing the state has a default name, based on a global counter. For practical reasons, when you define a transition for instance, you can rename it with the name option. You can also define the width of an empty state with the width option (8ex by default). You can define a state in another state. Then, the coordinates of the sub-states are relative to the parent state: \begin{umlstate} [ name=s t a t e ] { I am a s t a t e } \begin{umlstate} [ name=s u b s t a t e 1 ] { I am a s u b s t a t e 1} I am a state I am a substate 1 \end{ umlstate} \ begin{ umlstate} [ x=3, y= 3, name=s u b s t a t e 2 ] { I am a s u b s t a t e 2} \end{ umlstate} \end{ umlstate} I am a substate 2 If you want to define a state without detailing it, you can use the umlbasicstate command, that is an alias of the umlstate environment. Let s talk about the pseudo-states: \ umlstateinitial [ name=i n i t i a l ] \ umlstatefinal [ x=1, name=f i n a l ] \ umlstatejoin [ x=2, name=j o i n ] \ umlstatedecision [ x=3, name=d e c i s i o n ] \umlstateenter [ y= 2, name=e n t e r ] \ umlstateexit [ x=1, y= 2, name=e x i t ] \umlstateend [ x=2, y= 2, name=end ] \ umlstatehistory [ x=3, y= 2, name=h i s t ] \ umlstatedeephistory [ x=4, y= 2, name=d e e p h i s t ] From left to right and top to bottom: n initial state is defined with the umlstateinitial command. final state is defined with the umlstatefinal command. join state is defined with the umlstatejoin command. 37
39 decision state is defined with the umlstatedecision command. n enter state is defined with the umlstateenter command. n exit state is defined with the umlstateexit command. n end state is defined with the umlstateend command. n history state is defined with the umlstatehistory command. deep history state is defined with the umlstatedeephistory command. These commands take several options: name, to rename the node, and width to set their size. You can use these commands in a umlstate environment: \begin{umlstate} [ name=s t a t e ] { s t a t e } \begin{umlstate} [ name=s u b s t a t e ] { s u b s t a t e } \ umlstateinitial [ name=i n i t i a l ] \ umlstatefinal [ x=1, name=f i n a l ] \ umlstatejoin [ x=2, name=j o i n ] \end{ umlstate} \ umlstatedecision [ x=4, name=d e c i s i o n ] \umlstateenter [ y= 2, name=e n t e r ] \ umlstateexit [ x=1, y= 2, name=e x i t ] \umlstateend [ x=2, y= 2, name=end ] \ umlstatehistory [ x=3, y= 2, name=h i s t ] \ umlstatedeephistory [ x=4, y= 2, name=d e e p h i s t ] \end{ umlstate} substate You can also give actions on a state, through the entry, do and exit options: state \begin{umlstate} [ name=s t a t e, do=b, e x i t=c ] { s t a t e } \begin{umlstate} [ name=substate, entry=d, e x i t=f ] { s u b s t a t e } \end{ umlstate} \end{ umlstate} state do/b exit/c substate entry/d exit/f 4.2 To define a transition Transitions are relations between states in a state-transition diagram. You can define them with the umltrans command, that is an alias of the umlrelation command. There are unidirectional transitions and recursive transitions To define a unidirectional transition Thanks to the geometry option, usual aliases are available: umlhvtrans, umlvhtrans, umlvhvtrans and umlhvhtrans. Graphically, the use of these aliases are the most interesting, because corners are rounded. 38
40 \ umlstateinitial [ name=i n i t i a l ] \ umlstatefinal [ x=4, y= 2, name=f i n a l ] \umlhvtrans [ arg=t r a n s i t i o n 1, pos =0.5 ] { i n i t i a l }{ f i n a l } \umlhvhtrans[ arm1= 2cm, arg=t r a n s i t i o n 2, pos =1.5 ] { i n i t i a l }{ f i n a l } transition2 transition1 Every option of the umlrelation command can be used with the umltrans command and its aliases To define a recursive transition Recursive transitions are graphically the most difficult to manage, because their shape is a rounded rectangle, contrary to recursive relations in a class diagram. Conceptually, it is as if the geometry option has the value - - or -, that is to say arrows composed of several segments. \umlbasicstate [ name=s t a t e ] { I am a s t a t e } \umltrans [ r e c u r s i v e = cm, arg=a, pos =1.5, r e c u r s i v e d i r e c t i o n=r i g h t to r i g h t ] { s t a t e }{ s t a t e } \umltrans [ r e c u r s i v e = cm, arg=b, pos =2, r e c u r s i v e d i r e c t i o n=l e f t to bottom ] { s t a t e }{ s t a t e } b I am a state a The recursive direction option is fundamental. Indeed, giving values of start angle and end angle is not enough to determine the start direction and the end direction of the recursive arrow, because it does not define the normal direction. Then, we have to precise it. There are 2 cases: The arrow can be composed of 3 segments. In this case, usable nodes are shown as follows: I am a state relname-5 relname-1 relname-4 relname-3 relname-2 The arrow can be composed of 4 segments. In this case, usable nodes are shown as follows: 39
41 I am a state relname-1 relname-2 relname-7 relname-6 relname-5 relname-3 relname To define a transition between sub states When you want to define transitions between sub-states, transitions are drawn inside the parent state.then, you have to define them inside the umlstate environment. Let s compare the two following examples: \begin{umlstate} [ name=s t a t e ] { s t a t e } \umlbasicstate [ name=s t a t e 1 ] { sub s t a t e 1} \umlbasicstate [ x=4, name=s t a t e 2 ] { sub s t a t e 2} \end{ umlstate} \umlvhvtrans[ arm1= 2cm ] { s t a t e 1}{ s t a t e 2} sub state1 state sub state2 \begin{umlstate} [ name=s t a t e ] { s t a t e } \umlbasicstate [ name=s t a t e 1 ] { sub s t a t e 1} \umlbasicstate [ x=4, name=s t a t e 2 ] { sub s t a t e 2} sub state1 state sub state2 \umlvhvtrans[ arm1= 2cm ] { s t a t e 1}{ s t a t e 2} \end{ umlstate} 4.3 dvanced features for positioning umlstate and the 9 pseudo-state commands can accept every option key defined for nodes in TikZ. In this section, you will see how some of them can be used for advanced features Horizontal and vertical alignment In a state-transition diagram, states have different width and height. For a graphical purpose, you may want to align them horizontally or vertically. Let s take the following example: \ umlbasicstate{} \ umlbasicstate [ x= 2, y= 3] {} \ umlbasicstate [ x=2, y= 3] {C} C 40
42 The y coordinate defines the center of the state node. It will be better in this example to have states and C top-aligned. solution is to define manually the y value for C, but it is not very convenient. You may prefer use the anchor option. If you specify anchor=north, the y coordinate will define the top center anchor of the node, instead of the center. You may take a look at the differences between both codes. \ umlbasicstate{} \ umlbasicstate [ x= 2, y= 2, anchor=north ] {} \ umlbasicstate [ x=2, y= 2, anchor=north ] {C} C In a similar way, you may use anchor=east to right align states, anchor=west to left align states or anchor=south to bottom align states Relative positioning Using the x-y coordinate system may be very hard in big diagrams, when you have to change position of elements in order to fit the diagram to the page. Relative positioning may be useful in this case, namely advanced syntax of options above, left, below, right, above left, below left, below right and above right provided by the TikZ library positioning. Let s take the previous example, you can define by its cordinates (-2,-2) or by saying that is 2cm below and 2cm left of. You can also define C by saying it is 4cm right of. Notice that because of the top alignment of and C, the latter is defined 4cm right of.north. \ umlbasicstate{} \umlbasicstate [ below l e f t =2cm and 2cm o f, anchor=north ] {} \umlbasicstate [ r i g h t=4cm o f. north, anchor=north ] {C} C The behavior is not the one expected. It is because definition of a state node is complex. Instead of, you may use here -body. \ umlbasicstate{} \umlbasicstate [ below l e f t =2cm and 2cm o f, anchor=north ] {} \umlbasicstate [ r i g h t=4cm o f body. north, anchor=north ] {C} C 41
43 4.4 To change preferences With the tikzumlset command, you can change default colors for states and transitions: text: allows to set default text color (=black by default), draw: allows to set the default edge color and the default color of initial, final and join states (=black by default), fill state: allows to set the default background color of a state (=yellow!20 by default), font: allows to set the default font style (=\small by default). state join width allows to set the default with of a state join (=3ex by default), state decision width: allows to set the default width of a state decision (=3ex by default), state initial width: allows to set the default width of a state initial (=5ex by default), state final width: allows to set the default width of a state final (=5.5ex by default), state enter width: allows to set the default width of a state enter (=5ex by default), state exit width: allows to set the default width of a state exit (=5ex by default), state end width: allows to set the default wdith of a state end (=5ex by default), state history width: allows to set the default width of a state history (=5ex by default), state deep history width: allows to set the default width of a state deep-history (=5ex by default), state width: allows to set the default width of a state (=8ex by default) You can also use the text, draw and fill options on a particular element, in order to change its colors, as shown in the introduction example. 4.5 Examples Example from introduction, step by step Definition of basic states graphe test1 Etat global de l objet Visualisation test2 42
44 \begin{umlstate} [ name=main ] { Etat g l o b a l de l o b j e t } \begin{umlstate} [ name=graph, f i l l =red!20 ] { graphe } \umlbasicstate [ y= 4, name=t e s t 1, f i l l =white ] { t e s t 1} \umlbasicstate [ y= 8, name=t e s t 2, f i l l =white ] { t e s t 2} \end{ umlstate} \umlbasicstate [ x=6, y= 6, name=visu, f i l l =green!20 ] { V i s u a l i s a t i o n } \end{ umlstate} Definition of specific states Etat global de l objet graphe test1 Visualisation test2 \begin{umlstate} [ name=main ] { Etat g l o b a l de l o b j e t } \begin{umlstate} [ name=graph, f i l l =red! 2 0 ] { graphe } \ umlstateinitial [ name= i n i t ] \umlbasicstate [ y= 4, name=t e s t 1, f i l l =white ] { t e s t 1} \umlbasicstate [ y= 8, name=t e s t 2, f i l l =white ] { t e s t 2} \ umlstatefinal [ x=3, y= 7.75, name= f i n a l ] \end{ umlstate} \ umlstateinitial [ x=6, y=1, name= i n i t ] \ umlstatefinal [ x=6, y= 3.5, name= f i n a l ] \umlbasicstate [ x=6, y= 6, name=visu, f i l l =green! 2 0 ] { V i s u a l i s a t i o n } \end{ umlstate} 43
45 Definition of transitions \begin{umlstate} [ name=main ] { Etat g l o b a l de l o b j e t } \begin{umlstate} [ name=graph, f i l l =red! 2 0 ] { graphe } \ umlstateinitial [ name= i n i t ] \umlbasicstate [ y= 4, name=t e s t 1, f i l l =white ] { t e s t 1} \umltrans{ i n i t }{ t e s t 1} \umltrans [ r e c u r s i v e = cm, r e c u r s i v e d i r e c t i o n=r i g h t to top, arg={op 1}, pos =1.5 ] { t e s t 1}{ t e s t 1} \umltrans [ r e c u r s i v e = cm, r e c u r s i v e d i r e c t i o n= l e f t to top, arg={op 2}, pos =1.5 ] { t e s t 1}{ t e s t 1} \umltrans [ r e c u r s i v e = cm, r e c u r s i v e d i r e c t i o n= l e f t to bottom, arg={op 3}, pos =1.5 ] { t e s t 1}{ t e s t 1} \umltrans [ r e c u r s i v e = cm, r e c u r s i v e d i r e c t i o n=r i g h t to bottom, arg={op 4}, pos =1.5 ] { t e s t 1}{ t e s t 1} \umlbasicstate [ y= 8, name=t e s t 2, f i l l =white ] { t e s t 2} \umltrans [ r e c u r s i v e = cm, r e c u r s i v e d i r e c t i o n= l e f t to bottom, arg={op 5}, pos =1.5 ] { t e s t 2}{ t e s t 2} \umltrans{ t e s t 1}{ t e s t 2} \ umlstatefinal [ x=3, y= 7.75, name= f i n a l ] \umltrans{ t e s t 2}{ f i n a l } \end{ umlstate} \ umlstateinitial [ x=6, y=1, name= i n i t ] \umlvhtrans [ anchor2=40 ] { i n i t }{ graph} \ umlstatefinal [ x=6, y= 3.5, name= f i n a l ] \umlhvtrans [ anchor1=30 ] {graph}{ f i n a l } \umlbasicstate [ x=6, y= 6, name=visu, f i l l =green! 2 0 ] { V i s u a l i s a t i o n } \umlhvtrans{ f i n a l }{ v i s u } \umltrans{ v i s u }{ f i n a l } \umltrans [ r e c u r s i v e = cm, r e c u r s i v e d i r e c t i o n=r i g h t to bottom, arg=a, pos =1.5 ] { v i s u }{ v i s u } \end{ umlstate} 44
46 graphe Etat global de l objet op2 test1 op1 op3 op4 Visualisation test2 a op5 45
47 Chapter 5 Sequence diagrams Here is an example of sequence diagram you can draw: a: b: c:c d:d opa() opt opb() alt [condition] opc() [default] opd() 3 1 opt assert ope() opf() create e:e opt opg() 6 oph() 7 create f:f 46
48 Now, we will talk about elements that compose such diagrams. 5.1 To define a sequence diagram Here is the main difference from previous diagrams: to define a sequence diagram, you have to use a umlseqdiag environment. Its aim is to initialise some global variables and to draw the lifelines of each object in the diagram. You have to understand that commands and environments you will use to define a sequence diagrams place the elements (calls, objects,... ) automatically. We will talk about that in more details later. 5.2 To define an object Types of objects You can define an object with the umlobject command: \ begin{umlseqdiag} \ umlobject{ a} \end{umlseqdiag} a: The default type is a class instance. You can give the class name with the class option (empty by default). \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \end{umlseqdiag} a: On the contrary, you may want to hide the double dots and not giving a class: \ begin{umlseqdiag} \umlobject [ no ddots ] {a} \end{umlseqdiag} a The stereo option allows to set the type of object. It needs one of the following values: object (default value), actor, entity, boundary, control, database, multi. The last six are drawn in the following picture, from left to right and top to bottom: \ begin{umlseqdiag} \umlactor [ c l a s s=] {b} \umlentity [ x=2, c l a s s=c] { c } \umlboundary [ x=4, c l a s s=d] {d} \umlcontrol [ x=0, y= 2.5, c l a s s=e] { e } \umldatabase [ x=2, y= 2.5, c l a s s=f ] { f } \umlmulti [ x=4, y= 2.5, c l a s s=g] {g} \end{umlseqdiag} b: c:c d:d e:e f:f g:g UML objects may be used in other contexts than class instances. Then, the colon symbol shown in an object may not be necessary. For this purpose, you may use the umlbasicobject command. 47
49 5.2.2 utomatic placement of an object oth options x and y allows to place an object. You only have to use them if the automatic placement does not do what you need. Its behavior is the following: The default value of the y option is 0, that means the default placement of an object is at the top of the sequence diagram. The default value of the x option is the product of 4 by the value of the global counter identifying the object: for instance, for the second object defined in a diagram, the x option is set to 8 by default,... Unless the width of the object is too large, a shift of 4 is enough. If not, you use the x option To scale an object The scale option of the umlobject command allows to scale an object, its symbol and its font size: \ begin{umlseqdiag} \umlobject [ c l a s s=, s t e r e o=e n t i t y ] {a} \umlobject [ x=4, s c a l e =2, c l a s s=, s t e r e o=e n t i t y ] {b} \end{umlseqdiag} \tikzumlset{ f o n t=\large } \ begin{umlseqdiag} \umlobject [ c l a s s=, s t e r e o=e n t i t y ] {a} \umlobject [ x=4, s c a l e =2, c l a s s=, s t e r e o=e n t i t y ] {b} \end{umlseqdiag} a: a: b: b: 5.3 To define a function call Function calls are the core of sequence diagrams. Then, we need a motor either smart enough to propose a satisfacting default behavior, either easy enough to parametrize. From a technical point of view, and I open here a parenthesis, there are two ways to implement function calls: 1. Either we use the nodal matrix structure of TikZ. The advantage is to work on a pre computed nodal grid and then to place elements of a sequence diagram easily (and fast for compilation) with exactly one counter. 2. Either we use an automatical positioning of nodes with a set of coordinates, here the time instant, that allows total freedom for the user and make its work easier. I chose the second way, to keep the philosophy used to implement the other diagrams in this package. Indeed, if the lack of a grid needs a more accurate computation core, and as a result more compilation time, you can define most of the elements very easily, such as constructor calls, drawn according to the standard. That is different from others UML softwares I used before. I close the parenthesis. 48
50 5.3.1 asic / recursive calls You can define a function call with the umlcall environment. environments in other ones: \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \umlobject [ c l a s s=] {b} \umlobject [ c l a s s=c] { c } \begin{umlcall }{a}{b} \begin{umlcall }{b}{ c } \end{umlseqdiag} Of course, you can define umlcall a: b: c:c You have to give the name of the source object and the name of the destination object. If you give the same name as source and destination, you define a recursive call. In this case, you may prefer use an alias, the umlcallself environment: \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \umlobject [ c l a s s=] {b} \begin{umlcall }{a}{b} \ begin{ umlcall }{b}{b} \begin{ umlcallself }{b} \end{ umlcallself } \end{umlseqdiag} a: b: Of course, you can define umlcallself inside umlcallself and umlcall: \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \umlobject [ c l a s s=] {b} \begin{umlcall }{a}{b} \begin{ umlcallself } [ op=c 1, \begin{ umlcallself } [ op=c 2, \end{ umlcallself } \end{ umlcallself } \end{umlseqdiag} r e t u r n=0 ] {b} r e t u r n=t r u e ] {b} a: b: c1 c2 true To place a call The dt option allows to place a function call on a lifeline, relatively to the last call drawn on this lifeline. It has no default value. Its unit is ex. The default behavior is to shift the call you define to avoid overwriting between to consecutive calls: 49
51 \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \umlobject [ c l a s s=] {b} \begin{umlcall }{a}{b} \ begin{ umlcall }{b}{b} \begin{ umlcallself } [ dt=5 ] {b} \end{ umlcallself } \end{umlseqdiag} a: b: Do not forget that using option dt means relatively to the last call defines on the lifeline. \ begin{umlseqdiag} \umlactor{} \umlactor{} \ umlobject{c} \ begin{ umlcall }{}{C} \ begin{ umlcall }{C}{} \ begin{ umlcall }{}{C} \ begin{ umlcall }{C}{} \begin{umlcall} [ r e t u r n=1 ] {}{C} \begin{umlcall} [ dt =20, r e t u r n=1 ] {}{C} \end{umlseqdiag} : : C: 1 1 oth calls between and C are first ones, so they are drawn on top of the lifeline. However, you want that they are drawn below the first call between and C. y using option dt, you can do it: \ begin{umlseqdiag} \umlactor{} \umlactor{} \ umlobject{c} \ begin{ umlcall }{}{C} \ begin{ umlcall }{C}{} \begin{umlcall} [ dt=10 ] {}{C} \ begin{ umlcall }{C}{} \begin{umlcall} [ r e t u r n=1 ] {}{C} \begin{umlcall} [ dt =20, r e t u r n=1 ] {}{C} \end{umlseqdiag} : : C: 1 1 You can also set spaces for recursive calls with the padding option. recursive call: It set the space just below the 50
52 \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \umlobject [ c l a s s=] {b} \begin{umlcall} [ padding=10 ] {a}{b} \ begin{ umlcall }{b}{b} \begin{ umlcallself }{b} \end{ umlcallself } \end{umlseqdiag} a: b: padding can also takes negative values, to fix for instance position of a call too far away for the previous one Synchron / asynchron calls The type option allows to tell if the call is synchron (default value) or asynchron: \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \umlobject [ c l a s s=] {b} \begin{umlcall} [ type=synchron ] {a}{b} \begin{umlcall} [ type=asynchron ] {a}{b} \end{umlseqdiag} a: b: Operation, arguments and return value You can give the function name in a call and its arguments with the op option: \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \umlobject [ c l a s s=] {b} \begin{umlcall} [ op={ c a l l ( i, k ) } ] {a}{b} \end{umlseqdiag} a: call(i,k) b: eware of the braces, so as to the comma between i and k is deactivated as an option delimiter. WIthout them, there will be a compilation error. You can also set the return value with the return option, with the same warning: \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \umlobject [ c l a s s=] {b} \begin{umlcall} [ op={ c a l l ( i, k ) }, r e t u r n=2 ] {a}{b} \end{umlseqdiag} a: call(i,k) 2 b: 51
53 In this case, the return arrow is drawn with the return value above. You can draw the return arrow without giving a return value. For this, there is the with return option: \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \umlobject [ c l a s s=] {b} \begin{umlcall} [ op={ c a l l ( i, k ) }, r e t u r n ] {a}{b} \end{umlseqdiag} with a: call(i,k) b: In some cases, the call may have multiple return arrows. To draw an additionnal return arrow, you can do as follows: \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \umlobject [ c l a s s=] {b} \begin{umlcall} [ op={ c a l l ( i, k ) }, r e t u r n=1 ] {a}{b} \begin{umlcall} [ type=r e t u r n ] {b}{a} \end{umlseqdiag} a: call(i,k) 1 b: To define a constructor call Constructor calls are special function calls, insofar as they build a new object. They are not messages between two lifelines, but between a lifeline and an object. To define a constructor call, you can use the umlcreatecall command: \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \ umlcreatecall [ c l a s s=] {a}{b} \begin{umlcall} [ op={ c a l l ( i, k ) }, r e t u r n=2 ] {a}{b} \end{umlseqdiag} a: create call(i,k) 2 b: You can notice that everything behave normally after a constructor call. s an object builder, the umlcreatecall command has class, stereo and x options. s a function call, it has the dt option To name a call The name option allows to give a name for a function call. It is not useful actually, insofar as this option was added for the definition of combined fragments, but as you will see, combined fragment does not use this feature. Maybe this option will be used for future developments of the package. 5.4 To define a combined fragment Combined fragments are the second family of elements in a sequence diagram, with the function calls. You can define them with the umlfragment environment: 52
54 \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \ umlcreatecall [ c l a s s=] {a}{b} \ begin{umlfragment} \begin{umlcall} [ op={ c a l l ( i, k ) }, dt =7, r e t u r n=2 ] {a}{b} \end{umlfragment} \end{umlseqdiag} opt a: create call(i,k) 2 b: Informations of a fragment The type option allows to set the keyword on the top left corner: opt, alt, loop, par, assert,... The default value is opt. The label option allows to set information such as the condition for a opt fragment: \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \ umlcreatecall [ c l a s s=] {a}{b} \begin{umlfragment} [ type=a l t, l a b e l=i >5, i n n e r xsep=2 ] \begin{umlcall} [ op={ c a l l ( i, k ) }, dt =7, r e t u r n=2 ] {a}{b} \end{umlfragment} \end{umlseqdiag} alt [i>5] a: create call(i,k) 2 b: The inner xsep option allows to shift type and label to the left. The default value is 1 and its unit is ex Name of a fragment You can give a name to a combined fragment with the name option. It can be useful when you want to attach a note on a fragment: \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \ umlcreatecall [ c l a s s=] {a}{b} \begin{umlfragment} [ type=a l t, l a b e l=i >5, name=a l t, i n n e r xsep=2 ] \begin{umlcall} [ op={ c a l l ( i, k ) }, dt =7, r e t u r n=2 ] {a}{b} \end{umlfragment} \umlnote [ x=2, y= 5] { a l t }{ note on a l t fragment } \end{umlseqdiag} alt [i>5] a: create call(i,k) 2 note on alt fragment b: To define regions of a fragment Let s take a alt fragment. It represents a switch-case instruction block. To represent each case, you need to set regions in the fragment. For this purpose, you can use the umlfpart command: 53
55 \ begin{umlseqdiag} \umlobject [ c l a s s=] {a} \ umlcreatecall [ c l a s s=] {a}{b} \begin{umlfragment} [ type=a l t, l a b e l=i >5, i n n e r xsep=5 ] \begin{umlcall} [ op={ c a l l 1( i, k ) }, dt =7, r e t u r n=2 ] {a}{b} \umlfpart [ d e f a u l t ] \begin{umlcall} [ op={ c a l l 2( a, k ) }, r e t u r n=4 ] {a}{b} \end{umlfragment} \end{umlseqdiag} a: alt [i>5] [default] create call1(i,k) 2 call2(a,k) 4 b: 5.5 To change preferences Thanks to the tikzumlset command, you can set colors for calls, fragments and objects: text: allows to set the default text color (=black by default), draw: allows to set the default color of edges and arrows (=black by default), fill object: allows to set the default background color of objects (=yellow!20 by default), fill call: allows to set the default background color for calls (=white by default), fill fragment: allows to set the default background color for fragments (=white by default), font: allows to set the default font style (=\small by default), object stereo: allows to set the default font style (=object by default), call dt: allows to set the default font style (=auto by default), call padding: allows to set the default font style (=2 by default), call type: allows to set the default font style (=synchron by default), fragment type: allows to set the default font style (=opt by default), fragment inner xsep: allows to set the default font style (=1 by default), fragment inner ysep: allows to set the default font style (=1 by default), create call dt: allows to set the default font style (=4 by default) You can also use the options text, draw and fill on a particular element, as in the example of introduction. There is an exception: umlcreatecall. The options text, draw and fill set the colors of the call, whereas options text obj, draw obj and fill obj set the colors of the object. \ begin{umlseqdiag} \umlactor [ c l a s s=] {a} \ umlcreatecall [ c l a s s=, draw obj=green! 7 0! black, f i l l obj=green! 2 0, draw=blue! 7 0 ] {a}{b} \end{umlseqdiag} a: create b: 54
56 5.6 Examples Example from introduction, step by step Definition of objects \ begin{umlseqdiag} \umlactor [ c l a s s=] {a} \umldatabase [ c l a s s=, f i l l =b l u e!20 ] {b} \umlmulti [ c l a s s=c] { c } \umlobject [ c l a s s=d] {d} \end{umlseqdiag} a: b: c:c d:d Definition of the call opa and its components \ begin{umlseqdiag} \umlactor [ c l a s s=] {a} \umldatabase [ c l a s s=, f i l l =blue! 2 0 ] {b} \umlmulti [ c l a s s=c] { c } \umlobject [ c l a s s=d] {d} \begin{umlcall} [ op=opa ( ), t y p e=synchron, r e t u r n=0] {a}{b} \begin{umlcall} [ op=opb ( ), t y p e=synchron, r e t u r n=1] {b}{ c } \begin{umlcall} [ op=opc ( ), t y p e=asynchron, f i l l =red!10 ] { c }{d} \begin{umlcall} [ t y p e=r e t u r n ] { c }{b} \begin{umlcall} [ op=opd ( ), t y p e=synchron, r e t u r n=3] { c }{d} \end{umlseqdiag} 55
57 a: b: c:c d:d opa() opb() opc() 1 opd() 3 0 ope() opf() 5 4 Definition of the calls following the construction of E \ begin{umlseqdiag} \umlactor [ c l a s s=] {a} \umldatabase [ c l a s s=, f i l l =blue! 2 0 ] {b} \umlmulti [ c l a s s=c] { c } \umlobject [ c l a s s=d] {d} \begin{umlcall} [ op=opa ( ), type=synchron, r e t u r n=0 ] {a}{b} \begin{umlcall} [ op=opb ( ), type=synchron, r e t u r n=1 ] {b}{ c } \begin{umlcall} [ op=opc ( ), type=asynchron, f i l l =red! 1 0 ] { c }{d} \begin{umlcall} [ type=r e t u r n ] { c }{b} \begin{umlcall} [ op=opd ( ), type=synchron, r e t u r n=3 ] { c }{d} \begin{ umlcallself } [ op=ope ( ), t y p e=synchron, r e t u r n=4] {b} \begin{umlcall} [ op=opf ( ), t y p e=synchron, r e t u r n=5] {b}{ c } \end{ umlcallself } \ umlcreatecall [ c l a s s=e, x=8] {a}{ e } \begin{umlcall} [ op=opg ( ), name=t e s t, t y pe=synchron, r e t u r n =6, dt =7, f i l l =red!10 ] {a}{ e } \ umlcreatecall [ c l a s s=f, s t e r e o=boundary, x=12 ] { e }{ f } \begin{umlcall} [ op=oph ( ), t y p e=synchron, r e t u r n=7] {a}{ e } 56
58 a: b: c:c d:d opa() opb() opc() 1 opd() 3 0 create ope() opf() 5 4 e:e opg() 6 oph() 7 create f:f Definition of fragments \ begin{umlseqdiag} \umlactor [ c l a s s=] {a} \umldatabase [ c l a s s=, f i l l =blue! 2 0 ] {b} \umlmulti [ c l a s s=c] { c } \umlobject [ c l a s s=d] {d} \begin{umlcall} [ op=opa ( ), type=synchron, r e t u r n=0 ] {a}{b} \ begin{umlfragment} \begin{umlcall} [ op=opb ( ), type=synchron, r e t u r n=1 ] {b}{ c } \begin{umlfragment} [ t y p e=a l t, l a b e l=condition, inner xsep =8, f i l l =green!10 ] \begin{umlcall} [ op=opc ( ), type=asynchron, f i l l =red! 1 0 ] { c }{d} \begin{umlcall} [ type=r e t u r n ] { c }{b} \umlfpart [ d e f a u l t ] \begin{umlcall} [ op=opd ( ), type=synchron, r e t u r n=3 ] { c }{d} \end{umlfragment} \end{umlfragment} \ begin{umlfragment} \begin{ umlcallself } [ op=ope ( ), type=synchron, r e t u r n=4 ] {b} 57
59 \begin{umlfragment} [ t y p e=a s s e r t ] \begin{umlcall} [ op=opf ( ), type=synchron, r e t u r n=5 ] {b}{ c } \end{umlfragment} \end{ umlcallself } \end{umlfragment} \ umlcreatecall [ c l a s s=e, x=8 ] {a}{ e } \ begin{umlfragment} \begin{umlcall} [ op=opg ( ), name=t e s t, type=synchron, r e t u r n =6, dt =7, f i l l =red! 1 0 ] {a}{ e } \ umlcreatecall [ c l a s s=f, s t e r e o=boundary, x=12 ] { e }{ f } \begin{umlcall} [ op=oph ( ), type=synchron, r e t u r n=7 ] {a}{ e } \end{umlfragment} \end{umlseqdiag} 58
60 a: b: c:c d:d opa() opt opb() alt [condition] opc() [default] opd() 3 1 opt assert ope() opf() create e:e opt opg() 6 oph() 7 create f:f 5.7 Known bugs and perspectives 1. When you define a fragment on a set of calls just after a constructor call, the automatic shift does not work. You have to use the dt with a value greather than 7 to the first call inside the fragment. 2. The automatic placement of objects with a multiple of 4 is not very convenient. shift of 4 relatively to the last object drawn should be better. 3. You can not give arguments to constructor calls. 4. You can not force the drawing of the activity area of a non working object. 59
61 \ begin{umlseqdiag} \umlactor [ no ddots ] { u s e r } \umlobject [ c l a s s=] {a} \umlobject [ c l a s s=] {b} \begin{umlcall }{a}{b} \end{umlseqdiag} user a: b: ut you can lengthen lifelines thanks to umlsdnode command: \ begin{umlseqdiag} \umlactor [ no ddots ] { u s e r } \umlobject [ c l a s s=] {a} \umlobject [ c l a s s=] {b} \begin{umlcall }{a}{b} \umlsdnode [ dt=10 ] { u s e r } \umlsdnode [ dt=4 ] {a} \end{umlseqdiag} user a: b: 60
62 Chapter 6 Component diagrams Here is an example of component diagram you can draw: I am the node named -west-interface I am the node named C-east-interface D D delegate -interface I am the node named toto-interface C C-interface I am the node named -south-port E G I am the node named E-interface EF E GHF F H I am the node named F-east-port Now, we will talk about elements that compose such diagrams: 61
63 6.1 To define a component component can be defined with the umlcomponent environment: \ begin{umlcomponent} [ x=0,y=0 ] {} \end{umlcomponent} oth options x and y allow to place the component in the figure, or in another component. The default value is 0. The argument to give is the label of the component. The node representing the state has a default name, based on a global counter. For practical reasons, you can rename it with the name option. You can also define the width of an empty component with the width option (8ex by default). You can define a component in another component or in a package. Then, the coordinates of the subcomponent are relative to the parent component or package: p \ begin{umlpackage}{p} \ begin{umlcomponent}{} \ begin{umlcomponent}{} \umlemptyclass{d} \end{umlcomponent} \ begin{umlcomponent} [ x=4,y= 2] {C} D \end{umlcomponent} \end{umlcomponent} \end{umlpackage} C Notice that you can define a class inside a component. If you want to define a component without detailing it, you can use the umlbasiccomponent command, that is an alias of the umlcomponent environment. Every TikZ option dedicated to nodes can be used here, see section 2.5 for details. 6.2 To define a provided/required interface On a component, you can define 2 kinds of interfaces: provided interfaces and required interfaces. For that purpose, you can use umlprovidedinterface and/or umlrequiredinterface commands. These 2 commands offers the same list of options: 62
64 \ begin{umlcomponent}{} \umlbasiccomponent{} \umlbasiccomponent [ y= 2.5 ] {C} \umlrequiredinterface [ i n t e r f a c e=ri, d i s t a n c e=2cm, width=2em ] {} \umlprovidedinterface [ i n t e r f a c e=cpi, d i s t a n c e=3cm, with port ] {C} \end{umlcomponent} Cpi C ri The interface option is used to give the label of the interface, written above the interface symbol. The interface symbol is a node named X-Y-interface, where X is the name of the component, and Y is west for a provided interface and east for a required interface. You can change these default names with the name option. The width option is used to size the interface symbol. The default value is 1em. The distance option is used to set the distance between the interface symbol and the component port. The with port option is used to draw the port symbol. If you look at the previous example, you can notice the padding between the interface symbols on subcomponents, and the boundary of the parent component. You can change it with the padding option. The default value is 1cm. \ begin{umlcomponent}{} \umlbasiccomponent{} \umlbasiccomponent [ y= 2.5 ] {C} \umlrequiredinterface [ i n t e r f a c e=ri, d i s t a n c e=2cm, padding=2cm ] {} \umlprovidedinterface [ i n t e r f a c e=cpi, d i s t a n c e=3cm, padding=0cm ] {C} \end{umlcomponent} Cpi C ri This option will be very useful when you draw connectors, as you will see in the next section. 6.3 To define an assembly connector n assembly connector is a relation between 2 different components. It is graphically the provided interface of one of them with the required interface of the other. For that purpose, you can use the umlassemblyconnector command: \umlbasiccomponent{} \umlbasiccomponent [ x=4, y= 2] {} \umlassemblyconnector [ i n t e r f a c e=] {}{} \umlhvassemblyconnector [ with port ] {}{} 63
65 The assembly connector symbol is drawn only if the interface option is given. s for umlprovidedinterface and umlrequiredinterface commands, the with port option is used to draw ports, and the width option is used to set the size of the assembly connector symbol (default is 1em). You can also name the assembly connector with the option name To define the geometry of an assembly connector s for umlrelation command, you can use the geometry option and shortcuts are defined: umlhvassemblyconnector: shortcut of umlassemblyconnector with geometry=- umlvhassemblyconnector: shortcut of umlassemblyconnector with geometry= umlhvhassemblyconnector: shortcut of umlassemblyconnector with geometry=- umlvhvassemblyconnector: shortcut of umlassemblyconnector with geometry= To place the assembly connector symbol To place the assembly connector symbol, you can use the first arm, second arm, middle arm or last arm options: \umlbasiccomponent{} \umlbasiccomponent [ x=4, y= 3] {} \umlhvhassemblyconnector [ i n t e r f a c e=1, arm1=6cm, l a s t arm ] {}{} \umlhvhassemblyconnector [ i n t e r f a c e=2 ] {}{} \umlvhassemblyconnector [ i n t e r f a c e=3, f i r s t arm ] {}{} To adjust the geometry of an assembly connector s for umlrelation command, you can use the arm1, arm2, anchor1, anchor2 and anchors options: \umlbasiccomponent{} \umlbasiccomponent [ x=4, y= 3] {} \umlhvhassemblyconnector [ i n t e r f a c e=1, arm1=6cm, anchor 1=20, l a s t arm, with port ] {}{} \umlhvhassemblyconnector [ i n t e r f a c e=2, anchors= 20 and 160, arm2= 0.5cm ] {}{} \umlvhassemblyconnector [ i n t e r f a c e=3, f i r s t arm, anchor2= 160 ] {}{} The position of the ports is automatically evaluated according to the values given to these options and to the geometry option. 64
66 6.4 To define a delegate connector delegate connector is a connector between a sub-component and its parent component. For this purpose, you can use the umldelegateconnector command. It has all options of umlrelation command except stereo, that is set to delegate. \ begin{umlcomponent}{} \umlbasiccomponent{} \umlbasiccomponent [ y= 3] {C} \umlprovidedinterface [ i n t e r f a c e=pi, d i s t a n c e=2cm, padding=2cm ] {} \umlprovidedinterface [ i n t e r f a c e=cpi, d i s t a n c e=2cm, padding=2cm ] {C} \end{umlcomponent} delegate delegate \umldelegateconnector{ west port }{ west i n t e r f a c e } Cpi \umlhvhdelegateconnector [ pos s t e r e o =1.5 ] { west port }{C west i n t e r f a c e } \umlport{}{ west } pi C 6.5 To define a port on a component Sometimes, as in the previous example, you have to draw manually a port. For this purpose, you can use the umlport command. The first argument is the component name, the second one is the anchor of the component node where you want to draw the port. You can set the size of the port with the width option. 6.6 To change preferences Thanks to the tikzumlset command, you can set colors for components, provided/required interfaces, ports and assembly/delegate connectors: text: allows to set the text color (=black by default), draw: allows to set the color od edges and arrows (=black by default), fill component: allows to set the background color of components (=yellow!20 by default), fill port: allows to set the background color of ports (=yellow!20 by default), fill assembly connector: allows to set the background color for assembly connector symbols (=white by default), font: allows to set the font style (=\small by default). You can also use the options text, draw and fill on a particular element. There is an exception: umlassemblyconnector. The option fill assembly connector sets the colors of the assembly connector symbol, whereas the option fill port sets the colors of the port symbol. 65
67 6.7 Examples Example from introduction, step by step Definition of the components There is 6 components, D, E, F, G and H, and 2 sub-components of : and C. \ begin{umlcomponent}{} \umlbasiccomponent{} \umlbasiccomponent [ y= 2] {C} \end{umlcomponent} \umlbasiccomponent [ x= 10,y=1 ] {D} \umlbasiccomponent [ x=3,y= 7.5 ] {E} \umlbasiccomponent [ x= 2, y= 9] {F} \umlbasiccomponent [ x= 7,y= 8] {G} \umlbasiccomponent [ x= 7,y= 11 ] {H} D C G E F H Definition of the interfaces We define a required interface for the component, and a provided interface for the component C. We prepare the delegate connector by setting the padding. 66
68 \ begin{umlcomponent}{} \umlbasiccomponent{} \umlbasiccomponent [ y= 2] {C} \umlrequiredinterface [ i n t e r f a c e=c i n t e r f a c e ] {C} \umlprovidedinterface [ i n t e r f a c e= i n t e r f a c e, with port, d i s t a n c e=3cm, padding =2.5cm] {} \end{umlcomponent} \umlbasiccomponent [ x= 10,y=1 ] {D} \umlbasiccomponent [ x=3,y= 7.5 ] {E} \umlbasiccomponent [ x= 2, y= 9] {F} \umlbasiccomponent [ x= 7,y= 8] {G} \umlbasiccomponent [ x= 7,y= 11 ] {H} D -interface C C-interface G E F H Definition of the connectors We define 5 assembly connectors and 1 delegate connector. \ begin{umlcomponent}{} \umlbasiccomponent{} 67
69 \umlbasiccomponent [ y= 2] {C} \umlrequiredinterface [ i n t e r f a c e=c i n t e r f a c e ] {C} \umlprovidedinterface [ i n t e r f a c e= i n t e r f a c e, with port, d i s t a n c e=3cm, padding =2.5cm ] {} \end{umlcomponent} \umlbasiccomponent [ x= 10,y=1 ] {D} \umlbasiccomponent [ x=3,y= 7.5 ] {E} \umlbasiccomponent [ x= 2, y= 9] {F} \umlbasiccomponent [ x= 7,y= 8] {G} \umlbasiccomponent [ x= 7,y= 11 ] {H} \umlassemblyconnector [ i n t e r f a c e=d, with port, name=t o t o ] {D}{} \umldelegateconnector{ west port }{ west i n t e r f a c e } \umlvhvassemblyconnector [ i n t e r f a c e=e, with p o r t ] {}{E} \umlhvhassemblyconnector [ i n t e r f a c e=ef, with port, f i r s t arm ] {E}{F} \umlhvhassemblyconnector [ i n t e r f a c e=ghf, with port, arm2= 2cm, l a s t arm ] {G}{F} \umlhvhassemblyconnector [ w i t h port, arm2= 2cm, l a s t arm ] {H}{F} D D delegate -interface C C-interface E G EF E GHF F H Definition of the notes We add notes to explain the node names. 68
70 \ begin{umlcomponent}{} \umlbasiccomponent{} \umlbasiccomponent [ y= 2] {C} \umlrequiredinterface [ i n t e r f a c e=c i n t e r f a c e ] {C} \umlprovidedinterface [ i n t e r f a c e= i n t e r f a c e, with port, d i s t a n c e=3cm, padding =2.5cm ] {} \end{umlcomponent} \umlbasiccomponent [ x= 10,y=1 ] {D} \umlbasiccomponent [ x=3,y= 7.5 ] {E} \umlbasiccomponent [ x= 2, y= 9] {F} \umlbasiccomponent [ x= 7,y= 8] {G} \umlbasiccomponent [ x= 7,y= 11 ] {H} \umlassemblyconnector [ i n t e r f a c e=d, with port, name=t o t o ] {D}{} \umldelegateconnector{ west port }{ west i n t e r f a c e } \umlvhvassemblyconnector [ i n t e r f a c e=e, with port ] {}{E} \umlhvhassemblyconnector [ i n t e r f a c e=ef, with port, f i r s t arm ] {E}{F} \umlhvhassemblyconnector [ i n t e r f a c e=ghf, with port, arm2= 2cm, l a s t arm ] {G}{F} \umlhvhassemblyconnector [ with port, arm2= 2cm, l a s t arm ] {H}{F} \umlnote [ x= 4, y=4, width =3.4cm] { west i n t e r f a c e }{ I am the node named west i n t e r f a c e } \umlnote [ x=2, y=4, width =3.4cm] {C east i n t e r f a c e }{ I am the node named C east i n t e r f a c e } \umlnote [ x= 8.5, y= 2, width =3.4cm] { toto i n t e r f a c e }{ I am the node named toto i n t e r f a c e } \umlnote [ x= 5.5, y= 4.5, width =3.4cm] { south port }{ I am the node named south port } \umlnote [ x= 1, y= 6, width =3.4cm] {E i n t e r f a c e }{ I am the node named E i n t e r f a c e } \umlnote [ x=2, y= 11, width =3.4cm] {F east port }{ I am the node named F east port } 69
71 I am the node named -west-interface I am the node named C-east-interface D D delegate -interface I am the node named toto-interface C C-interface I am the node named -south-port E G I am the node named E-interface EF E GHF F H I am the node named F-east-port 70
The tikzposter class
The tikzposter class Pascal Richter, Richard Barnard, Elena Botoeva, Dirk Surmann [email protected] August 2, 2013 Abstract This document class aims to provide a simple way of using TikZ
Using Microsoft Word. Working With Objects
Using Microsoft Word Many Word documents will require elements that were created in programs other than Word, such as the picture to the right. Nontext elements in a document are referred to as Objects
Pro/ENGINEER Wildfire 4.0 Basic Design
Introduction Datum features are non-solid features used during the construction of other features. The most common datum features include planes, axes, coordinate systems, and curves. Datum features do
Understand the Sketcher workbench of CATIA V5.
Chapter 1 Drawing Sketches in Learning Objectives the Sketcher Workbench-I After completing this chapter you will be able to: Understand the Sketcher workbench of CATIA V5. Start a new file in the Part
CATIA Drafting TABLE OF CONTENTS
TABLE OF CONTENTS Introduction...1 Drafting...2 Drawing Screen...3 Pull-down Menus...4 File...4 Edit...5 View...6 Insert...7 Tools...8 Drafting Workbench...9 Views and Sheets...9 Dimensions and Annotations...10
ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite
ALGEBRA Pupils should be taught to: Generate and describe sequences As outcomes, Year 7 pupils should, for example: Use, read and write, spelling correctly: sequence, term, nth term, consecutive, rule,
CONSTRUCTING SINGLE-SUBJECT REVERSAL DESIGN GRAPHS USING MICROSOFT WORD : A COMPREHENSIVE TUTORIAL
CONSTRUCTING SINGLE-SUBJECT REVERSAL DESIGN GRAPHS USING MICROSOFT WORD : A COMPREHENSIVE TUTORIAL PATRICK GREHAN ADELPHI UNIVERSITY DANIEL J. MORAN MIDAMERICAN PSYCHOLOGICAL INSTITUTE This document is
Welcome to CorelDRAW, a comprehensive vector-based drawing and graphic-design program for the graphics professional.
Workspace tour Welcome to CorelDRAW, a comprehensive vector-based drawing and graphic-design program for the graphics professional. In this tutorial, you will become familiar with the terminology and workspace
Microsoft Excel 2010 Charts and Graphs
Microsoft Excel 2010 Charts and Graphs Email: [email protected] Web Page: http://training.health.ufl.edu Microsoft Excel 2010: Charts and Graphs 2.0 hours Topics include data groupings; creating
CATIA Electrical Harness Design TABLE OF CONTENTS
TABLE OF CONTENTS Introduction...1 Electrical Harness Design...2 Electrical Harness Assembly Workbench...4 Bottom Toolbar...5 Measure...5 Electrical Harness Design...7 Defining Geometric Bundles...7 Installing
Using UML Part Two Behavioral Modeling Diagrams
UML Tutorials Using UML Part Two Behavioral Modeling Diagrams by Sparx Systems All material Sparx Systems 2007 Sparx Systems 2007 Page 1 Trademarks Object Management Group, OMG, Unified Modeling Language,
Plotting: Customizing the Graph
Plotting: Customizing the Graph Data Plots: General Tips Making a Data Plot Active Within a graph layer, only one data plot can be active. A data plot must be set active before you can use the Data Selector
C++ INTERVIEW QUESTIONS
C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get
Excel 2007 Basic knowledge
Ribbon menu The Ribbon menu system with tabs for various Excel commands. This Ribbon system replaces the traditional menus used with Excel 2003. Above the Ribbon in the upper-left corner is the Microsoft
Excel -- Creating Charts
Excel -- Creating Charts The saying goes, A picture is worth a thousand words, and so true. Professional looking charts give visual enhancement to your statistics, fiscal reports or presentation. Excel
Physics 221 Experiment 5: Magnetic Fields
Physics 221 Experiment 5: Magnetic Fields August 25, 2007 ntroduction This experiment will examine the properties of magnetic fields. Magnetic fields can be created in a variety of ways, and are also found
Tutorials. If you have any questions, comments, or suggestions about these lessons, don't hesitate to contact us at [email protected].
Tutorials The lesson schedules for these tutorials were installed when you installed Milestones Professional 2010. They can be accessed under File Open a File Lesson Chart. If you have any questions, comments,
Chapter 1. Creating Sketches in. the Sketch Mode-I. Evaluation chapter. Logon to www.cadcim.com for more details. Learning Objectives
Chapter 1 Creating Sketches in Learning Objectives the Sketch Mode-I After completing this chapter you will be able to: Use various tools to create a geometry. Dimension a sketch. Apply constraints to
Introduction to CATIA V5
Introduction to CATIA V5 Release 16 (A Hands-On Tutorial Approach) Kirstie Plantenberg University of Detroit Mercy SDC PUBLICATIONS Schroff Development Corporation www.schroff.com www.schroff-europe.com
Microsoft Word defaults to left justified (aligned) paragraphs. This means that new lines automatically line up with the left margin.
Microsoft Word Part 2 Office 2007 Microsoft Word 2007 Part 2 Alignment Microsoft Word defaults to left justified (aligned) paragraphs. This means that new lines automatically line up with the left margin.
Publisher 2010 Cheat Sheet
April 20, 2012 Publisher 2010 Cheat Sheet Toolbar customize click on arrow and then check the ones you want a shortcut for File Tab (has new, open save, print, and shows recent documents, and has choices
Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c 2004 2011
Sequence Diagrams Massimo Felici What are Sequence Diagrams? Sequence Diagrams are interaction diagrams that detail how operations are carried out Interaction diagrams model important runtime interactions
How To Create A Complex Diagram On A Computer Game
ENTERPRISE ARCHITECT IMPORT user guide No Magic, Inc. 2013 All material contained herein is considered proprietary information owned by No Magic, Inc. and is not to be shared, copied, or reproduced by
Scientific Graphing in Excel 2010
Scientific Graphing in Excel 2010 When you start Excel, you will see the screen below. Various parts of the display are labelled in red, with arrows, to define the terms used in the remainder of this overview.
Umbraco v4 Editors Manual
Umbraco v4 Editors Manual Produced by the Umbraco Community Umbraco // The Friendly CMS Contents 1 Introduction... 3 2 Getting Started with Umbraco... 4 2.1 Logging On... 4 2.2 The Edit Mode Interface...
ECDL. European Computer Driving Licence. Spreadsheet Software BCS ITQ Level 2. Syllabus Version 5.0
European Computer Driving Licence Spreadsheet Software BCS ITQ Level 2 Using Microsoft Excel 2010 Syllabus Version 5.0 This training, which has been approved by BCS, The Chartered Institute for IT, includes
Excel Level Two. Introduction. Contents. Exploring Formulas. Entering Formulas
Introduction Excel Level Two This workshop introduces you to formulas, functions, moving and copying data, using autofill, relative and absolute references, and formatting cells. Contents Introduction
CATIA Basic Concepts TABLE OF CONTENTS
TABLE OF CONTENTS Introduction...1 Manual Format...2 Log on/off procedures for Windows...3 To log on...3 To logoff...7 Assembly Design Screen...8 Part Design Screen...9 Pull-down Menus...10 Start...10
Guide To Creating Academic Posters Using Microsoft PowerPoint 2010
Guide To Creating Academic Posters Using Microsoft PowerPoint 2010 INFORMATION SERVICES Version 3.0 July 2011 Table of Contents Section 1 - Introduction... 1 Section 2 - Initial Preparation... 2 2.1 Overall
ADMINISTRATORS GUIDE EPISUITE 6
ADMINISTRATORS GUIDE EPISUITE 6 A quick tutorial on how to set up and implement Episuite Software created by IDentiphoto Specialists in IDentification 1810 Joseph Lloyd Pkwy. Willoughby, OH 44094 Phone:
Copyright 2011 Casa Software Ltd. www.casaxps.com. Centre of Mass
Centre of Mass A central theme in mathematical modelling is that of reducing complex problems to simpler, and hopefully, equivalent problems for which mathematical analysis is possible. The concept of
Beas Inventory location management. Version 23.10.2007
Beas Inventory location management Version 23.10.2007 1. INVENTORY LOCATION MANAGEMENT... 3 2. INTEGRATION... 4 2.1. INTEGRATION INTO SBO... 4 2.2. INTEGRATION INTO BE.AS... 4 3. ACTIVATION... 4 3.1. AUTOMATIC
Basic Microsoft Excel 2007
Basic Microsoft Excel 2007 The biggest difference between Excel 2007 and its predecessors is the new layout. All of the old functions are still there (with some new additions), but they are now located
Tutorial Creating Vector Graphics
Tutorial Creating Vector Graphics This tutorial will guide you through the creation of your own vector graphic and show you how best to meet the specific criteria for our print process. We recommend designing
Communicate: In Print
Communicate: In Print A simple guide Work areas Communicate: In Print has two different modes in which to edit your documents: Create and Adjust modes. These are easily interchangeable and the toolbars
Geometry and Measurement
The student will be able to: Geometry and Measurement 1. Demonstrate an understanding of the principles of geometry and measurement and operations using measurements Use the US system of measurement for
Fixplot Instruction Manual. (data plotting program)
Fixplot Instruction Manual (data plotting program) MANUAL VERSION2 2004 1 1. Introduction The Fixplot program is a component program of Eyenal that allows the user to plot eye position data collected with
Introduction. UML = Unified Modeling Language It is a standardized visual modeling language.
UML 1 Introduction UML = Unified Modeling Language It is a standardized visual modeling language. Primarily intended for modeling software systems. Also used for business modeling. UML evolved from earlier
DOING MORE WITH WORD: MICROSOFT OFFICE 2010
University of North Carolina at Chapel Hill Libraries Carrboro Cybrary Chapel Hill Public Library Durham County Public Library DOING MORE WITH WORD: MICROSOFT OFFICE 2010 GETTING STARTED PAGE 02 Prerequisites
FluidDraw 5 User s Guide
FluidDraw 5 User s Guide 04/08 FluidDraw is an application for creating pneumatic circuit diagrams. Not only the standard circuit symbols are available but also all of the components contained in the Festo
Create a Poster Using Publisher
Contents 1. Introduction 1. Starting Publisher 2. Create a Poster Template 5. Aligning your images and text 7. Apply a background 12. Add text to your poster 14. Add pictures to your poster 17. Add graphs
Cabri Geometry Application User Guide
Cabri Geometry Application User Guide Preview of Geometry... 2 Learning the Basics... 3 Managing File Operations... 12 Setting Application Preferences... 14 Selecting and Moving Objects... 17 Deleting
PowerPoint 2007 Basics Website: http://etc.usf.edu/te/
Website: http://etc.usf.edu/te/ PowerPoint is the presentation program included in the Microsoft Office suite. With PowerPoint, you can create engaging presentations that can be presented in person, online,
User Manual Microsoft Dynamics AX Add-on LabAX Label Printing
User Manual Microsoft Dynamics AX Add-on LabAX Label Printing Version 1.7 Last Update: 17.04.2011 User Manual Microsoft Dynamics AX Add-on LabAX Label Printing Page 2 / 23 Contents 1 Introduction... 3
PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?
1. Distinguish & and && operators. PART-A Questions 2. How does an enumerated statement differ from a typedef statement? 3. What are the various members of a class? 4. Who can access the protected members
HIT THE GROUND RUNNING MS WORD INTRODUCTION
HIT THE GROUND RUNNING MS WORD INTRODUCTION MS Word is a word processing program. MS Word has many features and with it, a person can create reports, letters, faxes, memos, web pages, newsletters, and
Using UML Part One Structural Modeling Diagrams
UML Tutorials Using UML Part One Structural Modeling Diagrams by Sparx Systems All material Sparx Systems 2007 Sparx Systems 2007 Page 1 Trademarks Object Management Group, OMG, Unified Modeling Language,
What s New V 11. Preferences: Parameters: Layout/ Modifications: Reverse mouse scroll wheel zoom direction
What s New V 11 Preferences: Reverse mouse scroll wheel zoom direction Assign mouse scroll wheel Middle Button as Fine tune Pricing Method (Manufacturing/Design) Display- Display Long Name Parameters:
Each function call carries out a single task associated with drawing the graph.
Chapter 3 Graphics with R 3.1 Low-Level Graphics R has extensive facilities for producing graphs. There are both low- and high-level graphics facilities. The low-level graphics facilities provide basic
Introduction to Autodesk Inventor for F1 in Schools
Introduction to Autodesk Inventor for F1 in Schools F1 in Schools Race Car In this course you will be introduced to Autodesk Inventor, which is the centerpiece of Autodesk s digital prototyping strategy
Microsoft Word 2010. Quick Reference Guide. Union Institute & University
Microsoft Word 2010 Quick Reference Guide Union Institute & University Contents Using Word Help (F1)... 4 Window Contents:... 4 File tab... 4 Quick Access Toolbar... 5 Backstage View... 5 The Ribbon...
CATIA Functional Tolerancing & Annotation TABLE OF CONTENTS
TABLE OF CONTENTS Introduction...1 Functional Tolerancing and Annotation...2 Pull-down Menus...3 Insert...3 Functional Tolerancing and Annotation Workbench...4 Bottom Toolbar Changes...5 3D Grid Toolbar...5
Drawing Gantt Charts in L A TEX with TikZ The pgfgantt package
Drawing Gantt Charts in L A TEX with TikZ The pgfgantt package Wolfgang Skala April 18th, 2011 The pgfgantt package provides the ganttchart environment, which draws a Gantt chart within a TikZ picture.
Microsoft Publisher 2010 What s New!
Microsoft Publisher 2010 What s New! INTRODUCTION Microsoft Publisher 2010 is a desktop publishing program used to create professional looking publications and communication materials for print. A new
Umbrello UML Modeller Handbook
2 Contents 1 Introduction 7 2 UML Basics 8 2.1 About UML......................................... 8 2.2 UML Elements........................................ 9 2.2.1 Use Case Diagram.................................
SolidWorks Implementation Guides. Sketching Concepts
SolidWorks Implementation Guides Sketching Concepts Sketching in SolidWorks is the basis for creating features. Features are the basis for creating parts, which can be put together into assemblies. Sketch
Excel 2007: Basics Learning Guide
Excel 2007: Basics Learning Guide Exploring Excel At first glance, the new Excel 2007 interface may seem a bit unsettling, with fat bands called Ribbons replacing cascading text menus and task bars. This
Petrel TIPS&TRICKS from SCM
Petrel TIPS&TRICKS from SCM Maps: Knowledge Worth Sharing Map Annotation A map is a graphic representation of some part of the earth. In our industry, it may represent either the surface or sub surface;
Fireworks CS4 Tutorial Part 1: Intro
Fireworks CS4 Tutorial Part 1: Intro This Adobe Fireworks CS4 Tutorial will help you familiarize yourself with this image editing software and help you create a layout for a website. Fireworks CS4 is the
Working with Tables: How to use tables in OpenOffice.org Writer
Working with Tables: How to use tables in OpenOffice.org Writer Title: Working with Tables: How to use tables in OpenOffice.org Writer Version: 1.0 First edition: January 2005 First English edition: January
Microsoft Excel 2010 Tutorial
1 Microsoft Excel 2010 Tutorial Excel is a spreadsheet program in the Microsoft Office system. You can use Excel to create and format workbooks (a collection of spreadsheets) in order to analyze data and
Sources: On the Web: Slides will be available on:
C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,
Basic Excel Handbook
2 5 2 7 1 1 0 4 3 9 8 1 Basic Excel Handbook Version 3.6 May 6, 2008 Contents Contents... 1 Part I: Background Information...3 About This Handbook... 4 Excel Terminology... 5 Excel Terminology (cont.)...
Design and UML Class Diagrams. Suggested reading: Practical UML: A hands on introduction for developers http://dn.codegear.
Design and UML Class Diagrams Suggested reading: Practical UML: A hands on introduction for developers http://dn.codegear.com/article/31863 UML Distilled Ch. 3, by M. Fowler 1 Big questions What is UML?
Tutorial for Tracker and Supporting Software By David Chandler
Tutorial for Tracker and Supporting Software By David Chandler I use a number of free, open source programs to do video analysis. 1. Avidemux, to exerpt the video clip, read the video properties, and save
What You ll Learn. Why It s Important
These students are setting up a tent. How do the students know how to set up the tent? How is the shape of the tent created? How could students find the amount of material needed to make the tent? Why
DIA Creating Charts and Diagrams
DIA Creating Charts and Diagrams Dia is a vector-based drawing tool similar to Win32 OS Visio. It is suitable for graphical languages such as dataflow diagrams, entity-relationship diagrams, organization
MD5-26 Stacking Blocks Pages 115 116
MD5-26 Stacking Blocks Pages 115 116 STANDARDS 5.MD.C.4 Goals Students will find the number of cubes in a rectangular stack and develop the formula length width height for the number of cubes in a stack.
The following is an overview of lessons included in the tutorial.
Chapter 2 Tutorial Tutorial Introduction This tutorial is designed to introduce you to some of Surfer's basic features. After you have completed the tutorial, you should be able to begin creating your
Introduction to Autodesk Inventor for F1 in Schools
F1 in Schools race car Introduction to Autodesk Inventor for F1 in Schools In this course you will be introduced to Autodesk Inventor, which is the centerpiece of Autodesk s Digital Prototyping strategy
TABLE OF CONTENTS. INTRODUCTION... 5 Advance Concrete... 5 Where to find information?... 6 INSTALLATION... 7 STARTING ADVANCE CONCRETE...
Starting Guide TABLE OF CONTENTS INTRODUCTION... 5 Advance Concrete... 5 Where to find information?... 6 INSTALLATION... 7 STARTING ADVANCE CONCRETE... 7 ADVANCE CONCRETE USER INTERFACE... 7 Other important
Paragraph Formatting 4
Paragraph Formatting 4 LESSON SKILL MATRIX Skill Exam Objective Objective Number Formatting Paragraphs Set indentation. 2.2.7 Setting Line Spacing in Text and Between Paragraphs Creating and Formatting
Digital Marketing EasyEditor Guide Dynamic
Surveys ipad Segmentation Reporting Email Sign up Email marketing that works for you Landing Pages Results Digital Marketing EasyEditor Guide Dynamic Questionnaires QR Codes SMS 43 North View, Westbury
Declarative API for Defining Visualizations in Envision
Declarative API for Defining Visualizations in Envision Bachelor s Thesis Report Andrea Helfenstein Supervised by Dimitar Asenov, Prof. Peter Müller May 5, 2013 Contents 1 Introduction 1 1.1 Motivation..........................................
SURFACE AREA AND VOLUME
SURFACE AREA AND VOLUME In this unit, we will learn to find the surface area and volume of the following threedimensional solids:. Prisms. Pyramids 3. Cylinders 4. Cones It is assumed that the reader has
511 - Creating Structural Frame Designs
4 th Generation VLC courtesy of Edison2 511 - Creating Structural Frame Designs Rahul Kulkarni, Manager, Product Design, Pune Center, Siemens PLM Software #SEU13 Agenda: 511 - Creating Structural Frame
Basic AutoSketch Manual
Basic AutoSketch Manual Instruction for students Skf-Manual.doc of 3 Contents BASIC AUTOSKETCH MANUAL... INSTRUCTION FOR STUDENTS... BASIC AUTOSKETCH INSTRUCTION... 3 SCREEN LAYOUT... 3 MENU BAR... 3 FILE
SpaceClaim Introduction Training Session. A SpaceClaim Support Document
SpaceClaim Introduction Training Session A SpaceClaim Support Document In this class we will walk through the basic tools used to create and modify models in SpaceClaim. Introduction We will focus on:
SDC. Schroff Development Corporation WWW.SDCACAD.COM PUBLICATIONS. MultiMedia CD by Jack Zecher
MultiMedia CD by Jack Zecher An audioi/visual presentation of the tutorial exercises SDC PUBLICATIONS Schroff Development Corporation WWW.SDCACAD.COM AutoCAD 2002 Tutorial 2-1 Lesson 2 Geometric Construction
CATIA for Design and Engineering. Version 5 Releases 14 & 15. David S. Kelley. Central Michigan University SDC
CATIA for Design and Engineering ersion 5 Releases 4 & 5 David S. Kelley Central Michigan University SDC PUBLICATIONS Schroff Development Corporation www.schroff.com www.schroff-europe.com TUTORIAL Extruded
Training Needs Analysis
Training Needs Analysis Microsoft Office 2007 Access 2007 Course Code: Name: Chapter 1: Access 2007 Orientation I understand how Access works and what it can be used for I know how to start Microsoft Access
Chapter 23: Drafting in Worksheet View
Chapter 23: Drafting in Worksheet View Worksheet View is a powerful, 2D production drafting module. Here you can find all of the drawing and editing tools needed to create fast, accurate, detailed working
To draw a line. To create a construction line by specifying two points
Drawing Lines, Polygons and Rectangles The line is the basic object in AutoCAD. You can create a variety of lines: single lines, multiple line segments with and without arcs, multiple parallel lines, and
Geometric Optics Converging Lenses and Mirrors Physics Lab IV
Objective Geometric Optics Converging Lenses and Mirrors Physics Lab IV In this set of lab exercises, the basic properties geometric optics concerning converging lenses and mirrors will be explored. The
WHAT S NEW IN WORD 2010 & HOW TO CUSTOMIZE IT
WHAT S NEW IN WORD 2010 & HOW TO CUSTOMIZE IT The Ribbon... 2 Default Tabs... 2 Contextual Tabs... 2 Minimizing and Restoring the Ribbon... 3 Customizing the Ribbon... 3 A New Graphic Interface... 5 Live
The tikzposter class
The tikzposter class Pascal Richter, Elena Botoeva, Richard Barnard, Dirk Surmann [email protected] https://bitbucket.org/surmann/tikzposter/wiki/ January 17, 2014 Abstract This document
Elfring Fonts, Inc. PCL MICR Fonts
Elfring Fonts, Inc. PCL MICR Fonts This package contains five MICR fonts (also known as E-13B), to print magnetic encoding on checks, and six Secure Number fonts, to print check amounts. These fonts come
Merging Labels, Letters, and Envelopes Word 2013
Merging Labels, Letters, and Envelopes Word 2013 Merging... 1 Types of Merges... 1 The Merging Process... 2 Labels - A Page of the Same... 2 Labels - A Blank Page... 3 Creating Custom Labels... 3 Merged
Help Document for WWW.SAGIS.ORG. Step by step, how-to instructions for navigating and using the Savannah Area GIS viewer.
Help Document for WWW.SAGIS.ORG Step by step, how-to instructions for navigating and using the Savannah Area GIS viewer. 1 SAGIS Savannah Area GIS is focused on providing access to Geospatial data in a
LESSON 7: IMPORTING AND VECTORIZING A BITMAP IMAGE
LESSON 7: IMPORTING AND VECTORIZING A BITMAP IMAGE In this lesson we ll learn how to import a bitmap logo, transform it into a vector and perform some editing on the vector to clean it up. The concepts
How To Draw On An Ipad With A Touch Tablet (For Free) On A Blackberry Or Ipad 2 (For A Sims) On An Easter Egg (For An Sims 2) On Blackberry 2 (Blackberry)
Apex v5 Pro (Assessor) Touch Tablet Module Tutorial This Tutorial: The drawing lesson in this tutorial guides you through the same sketch as our regular v5 Pro tutorial but highlights the Touch Tablet
HOUR 9. Formatting Worksheets to Look Great
HOUR 9 Formatting Worksheets to Look Great Excel makes it easy to make even simple worksheets look professional. AutoFormat quickly formats your worksheet within the boundaries you select. If you want
StarUML Documentation
StarUML Documentation Release 2.0.0 MKLab June 24, 2016 Contents 1 Basic Concepts 3 1.1 Project.................................................. 3 1.2 Model vs. Diagram............................................
EXCEL IMPORT 18.1. user guide
18.1 user guide No Magic, Inc. 2014 All material contained herein is considered proprietary information owned by No Magic, Inc. and is not to be shared, copied, or reproduced by any means. All information
Microsoft Office 2010: Introductory Q&As PowerPoint Chapter 1
Microsoft Office 2010: Introductory Q&As PowerPoint Chapter 1 Are the themes displayed in a specific order? (PPT 6) Yes. They are arranged in alphabetical order running from left to right. If you point
Layout Tutorial. Chapter 10: Getting Started
Chapter 10: Layout Tutorial In this tutorial we will create a layout template, send a few views to a layout page, then save this document in PDF format. In this tutorial you will learn about: Creating
I ntroduction. Accessing Microsoft PowerPoint. Anatomy of a PowerPoint Window
Accessing Microsoft PowerPoint To access Microsoft PowerPoint from your home computer, you will probably either use the Start menu to select the program or double-click on an icon on the Desktop. To open
E XPLORING QUADRILATERALS
E XPLORING QUADRILATERALS E 1 Geometry State Goal 9: Use geometric methods to analyze, categorize and draw conclusions about points, lines, planes and space. Statement of Purpose: The activities in this
