UML图中,可以将一个包(package)或者是另一个图(Diagram)中的元素(Element)复制到另一个图中。这种复制在另一个图的含义有如下几种方式,可在复制的时候作出选择
| 1 | Link - Paste the element as a simple link: in this case theone
element is represented in the Project Browser and in any diagram to which it has been added; changes to the element are reflected in all diagrams in which it is shown 链接-简单地将一个元素链接到一个图中。在这种情况下,被复制元素会显示在它所添加的项目浏览器和图中;任何对这个元素的改变都会映射到它所链接的项目或图中。 |
| Instance - Paste acopy of the element as a separate instance of the original
element, classified by the original element; this is useful when creating multiple instances of a Class in a Sequence diagram or Communication diagram 实例-把它当作与被复制元素的一个独立的实例复制到目标图中,它与原始的元素是同一种类型;这种方法通常在序列图或通信图中创建一个类的多个实例时使用。 |
| Invocation - Paste a copy of a State Machine or Activity element as an invocation of the source element; the resulting element is a State object or Action - respectively
- with the source element as its classifier 调用-复制一个状态机或者活动元素的副本作为被复制元素的调用;目标元素是将原始元素作为它的类型的状态对象或一个动作。 |
| · | Property - Paste acopy of the element as a separate Object instance 特性- 把目标元素当作一个独立的对象实例的一个副本。 |
| · | Attribute - (Available when dragging a classifier onto an element that supports attributes) Create a new attribute classified by the dragged classifier; the attribute
is automatically selected in in-place editing so that you can add the attribute name 属性- (只有当将一个类型拖到一个支持属性的元素上时才有效)通过类的拖拽创建一个新的类属性;这个属性会被自动添加到目标元素中,并且在目标元素中会有一个内部属性产生,并让你为这个属性命名。 |
| · | Child - Paste the element as a child of the copied element - that is, as a new element (which you are prompted to name) with a Generalization connector back to the copied
element; this is very useful when you have a Class library or framework from which you inherit new forms - for example, you can paste a Hashtable as "MyHashtable" which automatically becomes a child of the original Hashtable Used with the Override Parent Operations feature, this is a quick way to create new structures based on frameworks such as the Java SDK and the .NET SDK 子类-复制一个元素作为原始元素的子类,也就是说作为一个新的元素(将会有对话框弹出提示你为这个新的元素命名),这个元素与被复制的元素是继承的关系;,在以下情况下,这种方法是经常会被用到的:当你有一个类库或者是框架是继承已有的平台或框架。例如,你可以粘贴一个“Hashtable”作为“MyHashtable”,这个哈希表会继承原哈希表。 与重写父类方法,这是一个基于已有平台创建一个新框架的快捷方式。 |
文章是释文的EA的帮助文档,有翻译不到位的地方,请各位提出来加以改正。
本文介绍了在UML图中如何复制包或元素到其他图表,并详细阐述了不同复制方式的含义。内容源于EA的帮助文档翻译,欢迎读者指正翻译误差。
1万+

被折叠的 条评论
为什么被折叠?



