Atitit.uml2 api 的编程代码实现设计uml开发 使用eclipse jar java 版本

1. clipse提供了UML的底层Java包, 1

2. MDTUML2Getting Started with UML21

3. 要使用的jar2

4. 矢量绘图系统 java2

5. JpGraph 3.0.72

6. Code4

7. Ref8

1. clipse提供了UML的底层Java包,

就是说用纯代码可以构建一个UML模型,当构建完之后需要保存到磁盘上以备以后使用,该UML模型是以XML格式存放在磁盘上的,这篇文章正式演示了这个用纯UML的底层API创建UML模型的。

2. MDTUML2Getting Started with UML2

1. Contents

1. Summary

1. Prerequisites

2. Introduction

3. Getting Started

4. Creating Models

5. Creating Packages

6. Creating Primitive Types

7. Creating Enumerations

8. Creating Enumeration Literals

9. Creating Classes

10. Creating Generalizations

11. Creating Attributes

12. Creating Associations

13. Saving Models

14. Conclusion

15. References

["E:\\jar2\\org.eclipse.emf.ecore_2.10.1.v20140901-1043.jar//org.eclipse.emf.ecore.resource.ResourceSet.class",

"E:\\jar2\\org.eclipse.emf.ecore_2.10.2.v20150123-0348.jar//org.eclipse.emf.ecore.resource.ResourceSet.class","

E:\\jar2\\org.eclipse.emf.ecore_2.9.1.v20130827-0309 (2).jar//org.eclipse.emf.ecore.resource.ResourceSet.class",

"E:\\jar2\\org.eclipse.emf.ecore_2.9.1.v20130827-0309 (3).jar//org.eclipse.emf.ecore.resource.ResourceSet.class",

"E:\\jar2\\org.eclipse.emf.ecore_2.9.1.v20130827-0309.jar//org.eclipse.emf.ecore.resource.ResourceSet.class","

E:\\jar2\\sdk-common.jar//com.android.ide.common.res2.ResourceSet.class"]

--f

3. 要使用的jar

Elcipse哈面儿的emf,gef,uml关键字的jar

作者:: 绰号:老哇的爪子 ( 全名::Attilax akbar al rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 汉字名:艾龙,  EMAIL:1466519819@qq.com

转载请注明来源: http://blog.csdn.net/attilax

4. 矢量绘图系统 java

5. JpGraph 3.0.7

JpGraph专门提供图表的类库。它使得作图变成了一件非常简单的事情,你只需从数据库中取出相关数据,定义标题,图表类型,然后的事情就交给JpGraph,只需掌握为数不多的JpGraph内置函数(可以参照JpGraph附带例子学习),就可以画出非常炫目的图表!

Graphical Editor Framework (GEF)
       GEF允许开发者使用已有的应用模型简便的开发出一个图形化编辑器。GEF可以使开发者快速的将现有的模型移植到一个图形化编辑的环境中。这个图形化环境是基于SWT的绘图插件“draw2d”。GEF是基于MVC框架的,他可以使开发者方便的实现drop/drag、undo/redo、move、delete、resize等图形编辑器的基本功能。GEF非常适合用于开发流程编辑器、GUI Builder、UML图编辑器、workflow编辑器、甚至是像html这种所见即所得的文本编辑器。但是需要注意的是GEF开发的软件必须工作与Eclipse环境下,即作为plug-in程序,如果希望脱离Eclipse平台作为独立软件运行,可以参考Eclipse 3系列正在开发的rich client platform(RCP)。结合GEF和RCP就可以开发出运行与Eclipse平台外的图形编辑器。

EMF(Eclipse Model Framework)
      Eclipse Modeling Framework旨在提供一种简便设计和实现结构化模型的框架,emf提供代码生成工具以使得开发者可以把精力集中在模型本身而不是它的实现细节上,这个框架根本的概念是:元数据(meta-data),代码生成(code generation),默认序列化(dafault serialization)
      emf项目的最初目的是实现omg(Object Management Group)的一个元对象工具。同时emf是Ecilpse系列工具目前对mda的部分实现。
      emf可以用于描述和建立模型,在这些定义的基础上java code可以被自动生成,这些实现的模型则可以被作为任何java程序开发的基础。这就是emf所要解决的问题。
      目前为止emf只是mda部分实现,所以它不包括用于混合xml,eai,ejbs,web services等技术的企业级应用所需的map。

EMF(Eclipse Modelling Framework)是Eclipse MDA(Model Driven Architecture)的重要组成部分,可以将模型转换成高效的,正确的,易于定制的Java代码。

GMF(Graphical Modeling Framework )

The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for developing graphical editors based on EMF and GEF.

GEF, 全称: Graphical Editor Framework, 它是一套图像编辑框架, 用于开发图形应用, 如果你在Eclipse中使用过基于图形设计的应用, 例如UML建模, 可视化软件界面设计(VE)等, 它们基本上都是基于GEF而开发出来的.

大部分GEF应用都是跟EMF合作完成的, EMF可以生成图形模型和源代码, 通过建立规则来对图形应用进行约束, 使其简化了开发.... 但由于毕竟GEF和EMF是两个独立的项目, 他们之间冗余的东西也不少, 因此Eclipse人为了使它们更好地应用到程序中, 开发了GMF(Graphical Modeling Framework)框架, 这个在The Eclipse Technology Project中可以找到.

6. Code

package umlPrj;

import java.io.IOException;

import org.eclipse.emf.ecore.resource.Resource;

import org.eclipse.emf.ecore.resource.ResourceSet;

import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;

import org.eclipse.uml2.uml.LiteralUnlimitedNatural;

import org.eclipse.uml2.uml.Model;

import org.eclipse.uml2.uml.PrimitiveType;

import org.eclipse.uml2.uml.Property;

import org.eclipse.uml2.uml.Type;

import org.eclipse.uml2.uml.UMLFactory;

import org.eclipse.uml2.uml.resource.UMLResource;

import org.eclipse.uml2.uml.resources.util.UMLResourcesUtil;

import org.eclipse.emf.common.util.URI;

public class umlTest {

public static void main(String[] args) {

Model epo2Model = createModel("epo2");

org.eclipse.uml2.uml.Package barPackage = UMLFactory.eINSTANCE

.createPackage();

// PrimitiveType intPrimitiveType = createPrimitiveType(epo2Model,

// "int");

org.eclipse.uml2.uml.Class supplierClass = createClass(epo2Model,

"Supplier", false);

// createAttribute(supplierClass, "name", PrimitiveType, 0, 1);

String fileExtension = UMLResource.FILE_EXTENSION;//zosh .uml

String f = "";//args[0];

f="attilaxUmlOutputFolder";

save(epo2Model, URI.createFileURI(f).appendSegment("UmlFileMainname").appendFileExtension(fileExtension));

}

protected static Model createModel(String name) {

Model model = UMLFactory.eINSTANCE.createModel();

model.setName(name);

out("Model '" + model.getQualifiedName() + "' created.");

return model;

}

private static void out(String string) {

System.out.println(string);

}

protected static org.eclipse.uml2.uml.Package createPackage(

org.eclipse.uml2.uml.Package nestingPackage, String name) {

org.eclipse.uml2.uml.Package package_ = nestingPackage

.createNestedPackage(name);

out("Package '" + package_.getQualifiedName() + "' created.");

return package_;

}

protected static PrimitiveType createPrimitiveType(

org.eclipse.uml2.uml.Package package_, String name) {

PrimitiveType primitiveType = (PrimitiveType) package_

.createOwnedPrimitiveType(name);

out("Primitive type '" + primitiveType.getQualifiedName()

+ "' created.");

return primitiveType;

}

protected static org.eclipse.uml2.uml.Class createClass(

org.eclipse.uml2.uml.Package package_, String name,

boolean isAbstract) {

org.eclipse.uml2.uml.Class class_ = package_.createOwnedClass(name,

isAbstract);

out("Class '" + class_.getQualifiedName() + "' created.");

return class_;

}

protected static Property createAttribute(

org.eclipse.uml2.uml.Class class_, String name, Type type,

int lowerBound, int upperBound) {

Property attribute = class_.createOwnedAttribute(name, type,

lowerBound, upperBound);

out("Attribute '%s' : %s [%s..%s] created.", //

attribute.getQualifiedName(), // attribute name

type.getQualifiedName(), // type name

lowerBound, // no special case for multiplicity lower bound

(upperBound == LiteralUnlimitedNatural.UNLIMITED) ? "*" // special

// case

// for

// unlimited

// bound

: upperBound);

return attribute;

}

private static void out(String string, String qualifiedName,

String qualifiedName2, int lowerBound, Object object) {

// TODO Auto-generated method stub

}

protected static void save(org.eclipse.uml2.uml.Package package_, URI uri) {

// Create a resource-set to contain the resource(s) that we are saving

ResourceSet resourceSet = new ResourceSetImpl();

// Initialize registrations of resource factories, library models,

// profiles, Ecore metadata, and other dependencies required for

// serializing and working with UML resources. This is only necessary in

// applications that are not hosted in the Eclipse platform run-time, in

// which case these registrations are discovered automatically from

// Eclipse extension points.

UMLResourcesUtil.init(resourceSet);

// Create the output resource and add our model package to it.

Resource resource = resourceSet.createResource(uri);

resource.getContents().add(package_);

// And save

try {

resource.save(null); // no save options needed

out("Done.");

} catch (IOException ioe) {

throw new RuntimeException(ioe);

}

}

private static void err(String message) {

// TODO Auto-generated method stub

}

}

7. Ref

MDT UML2 Getting Started with UML2及我自己的一些理解 - xiaogugood的专栏 - 博客频道 - CSDN.NET.htm

使用 UML API 編輯 UML 循序圖.htm

使用 UML API 编辑 UML 序列图.htm

MDT UML2 Getting Started with UML2 - Eclipsepedia.htm

UML建模工具开发实践_图文_百度文库.htm

转载于:https://www.cnblogs.com/attilax/p/5963568.html

Atitit.uml2 api 的编程代码实现设计uml开发 使用eclipse jar java 版本相关推荐

  1. eclipse mdt java工程_Atitit.uml2 api 的编程代码实现设计uml开发 使用eclipse jar java 版本...

    Atitit.uml2 api 的编程代码实现设计uml开发 使用eclipse jar java版本 1.clipse提供了UML的底层Java包, 就是说用纯代码可以构建一个UML模型,当构建完之 ...

  2. 重构:改善既有代码的设计(软件开发的不朽经典)

    重构:改善既有代码的设计(软件开发的不朽经典) 基本信息 作者: (美)Martin Fowler   译者: 熊节[同译者作品] 丛书名: 图灵程序设计丛书 出版社:人民邮电出版社 ISBN:978 ...

  3. 是先设计mysql表再进行php代码_MySQL设计与开发规范_MySQL

    1 目的 本规范的主要目的是希望规范数据库设计与开发,尽量避免由于数据库设计与开发不当而产生的麻烦:同时好的规范,在执行的时候可以培养出好的习惯,好的习惯是软件质量的很好保证. 2 适用范围 本规划的 ...

  4. JAVA常用API或编程工具002---SpringSource Tool Suite:基于Eclipse的Spring应用开发环境

    Spring Tool Suite(STS) 是一个基于Eclipse针对Spring应用量身定制的开发环境.提供了开发 Spring 应用必须的编码.调试.运行和部署功能.STS 在最新的 Ecli ...

  5. java开发高端说法_关于Java代码的设计和开发注意事项,下列哪些说法符合《集合开发规约》:...

    案例分析一:假定CPU的主频是500MHz.硬盘采用DMA方式进行数据传送,其数据传输率为4MB/s, 每次DMA传输的数据量为8KB, 要求没有任何数据传输被错过. 如果CPU在DMA初始化设置和启 ...

  6. java局域网聊天代码_简单的局域网聊天程序(java版本的)

    局域网聊天程序,首先我已经默认你的电脑已经配置好的java开发的一些环境,所需代码有两个java的源代码,他们分别是1:Server_Test.java-------2:Socket_Test.jav ...

  7. python接口自动化测试框架实战从设计到开发_【B0753】[java视频教程]Python接口自动化测试框架设计到开发完整版视频教程 it教程...

    Java视频教程名称:Python接口自动化测试框架设计到开发完整版视频教程   java自学网[javazx.com]  Python视频教程   it教程 Java自学网收集整理 java论坛&q ...

  8. Atitit.提升 升级类库框架后的api代码兼容性设计指南

    Atitit.提升 升级类库框架后的api代码兼容性设计指南 1. 增加api直接增加,版本号在注释上面增加1 2. 废弃api,使用主见@dep1 3. 修改api,1 4. 修改依赖import, ...

  9. atitit.跨语言执行cmd cli api的原理及兼容性设计草案

    atitit.跨语言执行cmd cli api的原理及兼容性设计草案 1. 标准输入,标准输出,标准错误与重新定向1 2. 常见问题2 2.1. 执行bat文件2 2.2. 执行bat文件  /c   ...

最新文章

  1. 每秒处理10万订单乐视集团支付架构--转
  2. 如何用Python发送通知到微信?
  3. LeetCode MySQL 1821. 寻找今年具有正收入的客户
  4. pythontuple([1、2、3)_Python 进阶之路 (三) Tuple元组使用指南
  5. h5页面嵌入android app时遇到的问题
  6. Linux 使用正则表达式的常用命令
  7. unity3d collider自动调整大小_3dmax室内模型导入Unity3d快速烘焙光照【2020】
  8. 【ElasticSearch】Es 源码之 SearchTransportService 源码解读
  9. 区块链 Solidity中uint转string 数字转字符串
  10. 西门子S7-200的PLC,CPU224XP的模拟量接线怎样接
  11. petalinux 设备树驱动GPIOLED
  12. Vue----组件注册
  13. 今天拿到软件设计师证书
  14. Dev-C++ 的下载、安装和配置
  15. 免费可练习接口测试的开放接口
  16. 中乾文化,如何树立正确的财富观?
  17. java计算机毕业设计校园快递联盟系统源程序+mysql+系统+lw文档+远程调试
  18. 深圳大数据学习:高阶函数--【千锋】
  19. 《西游》被测破15亿 笑点超泰囧
  20. rx560d linux 图形设计,关系steam linux版游戏 使用体会和个人建议

热门文章

  1. js鼠标事件大全-Javascript鼠标事件大全
  2. linux dns服务无效,Linux下搭建DNS服务器及踩坑
  3. html5坦克游戏ppt说明,HTML5制作的坦克游戏
  4. mysql56 配置内存_【mysql】mysql 内存配置调优
  5. 程序员薪资怎么论高级还是初级_Java程序员的薪水取决于年龄还是技术?
  6. 苹果自带的清理软件_苹果电脑清理软件哪个好|电脑|苹果电脑|mac|旧文件
  7. KNN(一)--简单KNN原理及实现
  8. 人脸检测(四)--CART原理及实现
  9. cookie分号后面没有值_Cookie的属性(cookie的设置、获取和删除)
  10. Ad-Hoc Query入门