uml建模工具中bouml的使用(整理版,中英文对照) 下载本文

Closing then re-opening the diagram the window size and the scale are reset by default. To save the current window size and scale to restore them the next time you re-open the diagram, choose set preferred size and scale in the menu of the diagram in the diagram sub-window (not possible from the menu in the browser).

关闭图,接着打开图,窗口的尺寸和比例将由默认值重置。要保存当前窗口的尺寸和比例,以便你在下一次重新打开时使用,可以使用图子窗口的关联菜单,选择set preferred size and scale 菜单项(浏览器中的菜单不可能使用)。

Export diagram picture输出图的图片 There are several way to export a diagram picture : 这儿有几种方法输出图的图片:

to print it : if needed open the diagram to show it, use the button which icon is a printer on the top left of the BOUML window

? 打印:如需,打开图以显示图,使用bouml窗口左上方的打印机图标按钮。

to copy it, for a paste in an other program : if needed open the diagram to show it, choose the entry copy visible picture part in the diagram menu (not possible from the menu in the browser). The visible part is the part of the diagram which appears depending on the diagram sub-window's scrollbars position. To copy all the elements even the non visible ones, choose copy optimal picture part. ? 复制:粘贴到其它程序:如需,打开图以显示图,可以使用图的关联菜单,选择opy visible picture part 菜单项(浏览器中不可能),可视部分是图的可见部分,依赖图子窗口的滚动条的位置。要复制所有的元素,甚至不可见的元素,选择copy optimal picture part.菜单项。 to save the picture in a PNG file : if needed open the diagram to show it, choose the entry save visible picture part (png) in the diagram menu (not possible from the menu in the browser). To get all the elements even the non visible ones because of the current size of the sub windows, choose the entry save optimal picture part (png)

- 17 -

? 保存图像为PNG文件:如需,打开图以显示图,可以使用图的关联菜单,选择save visible picture part (png) 菜单项(浏览器中不可能)。要得到所有的元素,甚至不可见的元素,选择save optimal picture part (png).菜单项。

to save the picture in a SVG file : if needed open the diagram to show it, choose the entry save visible picture part (svg) in the diagram menu (not possible from the menu in the browser). To get all the elements even the non visible ones because of the current size of the sub windows, choose the entry save optimal picture part (cvg). ? 保存图像为SVG文件:如需,打开图以显示图,可以使用图的关联菜单,选择save visible picture part (svg)菜单项(浏览器中不可能)。要得到所有的元素,甚至不可见的元素,选择save optimal picture part (cvg) 菜单项。

to use a plug-out, for instance the HTML generator. In case an exported diagram is not already opened, the scale and the size of the saved part are the default ones except if you had specify them using set preferred size and scale.

? 使用plug-out,例如HTML 生成器。在此情况下,一个输出的图不是一个打开的图,保存部分的比例和尺寸是默认值,除非你使用了set preferred size and scale 做了特别说明。

Sub package, class view, class diagram, class子包、类视图、图图和类

Now we want to design classes to generate code. 现在我们想设计类以产生代码。

For that we have first to create a class view, and why not we don't want to place it directly in the project package. First call the project menu (right mouse click on the project's name in the browser) and choose new package, name it Package3. Call the Package3 menu and choose new class view named Class view4 :

为此目的,我们首先创建一个类视图(class view),为什么不?我们不想将此视图直接放在项目包中。从项目的关联菜单中选择new package,菜单项,给包命名Package3 。从Package3 关联菜单上选择 new class view 菜单项,给类视图命名为 Class view4 :

- 18 -

A class diagram is not mandatory to define classes (except to add relations), but create a class diagram through the class view menu, then open this diagram :

要定义一类,类图不要一定需要的,除非需要加入关系。通过类视图创建一个类图,打开此图,如是:

Click on the button which icon is a class and click somewhere in the diagram (it is also possible to create the class using the class view menu in the browser), name the class C1 按类图标的按钮,在图的某一个地方点击(也可在浏览器中使用class view菜单创建一个类), 给类命名为C1

- 19 -

Because the actors are classes, they can be added in the class diagram, using a drag & drop from the browser to the diagram sub-window, or using the diagram class icon and choosing for instance Administrator hitting 'a' in the combo box or using its arrow. The actor is drawn as an actor, this a default for the classes having the stereotype actor (this depend on the drawing settings of the class, the other special cases are for the stereotypes control, boundary and entity) :

因为角色是类,它们可以加入到类图中。使用拖动方法,从浏览器中拖到图子窗口中;或者点击类图标,显示一对话框,选择一个角色 Administrator ,角色类以一个角色方式绘制,对于具有Actor范型的类,这是默认绘制方式(这依赖于类的drawing settings设置,其它的特殊类是关于范型control,boundary 和entry):

However in the normal case the goal of an actor is not to be used to generate code, and in the generation settings the stereotype actor at class level is translated to ignored in the target languages. To continue without this limitation, edit the generation settings, go in the tab stereotype and replace ignored by class in C++ and other language in the line for actor : 然而在正常情况下,角色目的不是用于产生代码的。在生成设置中在类级别上的actor范型,目标语言在产生过程中忽略actor。 以下为取消此限制,编辑generation settings ,转到 stereotype 标签,在stereotype=actor行内,用C++和其它语言设置取代 ignored。

- 20 -