当前位置: 首页>>代码示例>>Java>>正文


Java UMLPackage类代码示例

本文整理汇总了Java中org.eclipse.uml2.uml.UMLPackage的典型用法代码示例。如果您正苦于以下问题:Java UMLPackage类的具体用法?Java UMLPackage怎么用?Java UMLPackage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UMLPackage类属于org.eclipse.uml2.uml包,在下文中一共展示了UMLPackage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFragmentedPackageList

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
/**
 * 
 * 모델에 포함된 단편화 패키지 목록을 반환 한다.
 *  
 * @param model
 * @return TreeMap<String,Package>
 */
public static TreeMap<String, Package> getFragmentedPackageList(Package model) {

    TreeMap<String, Package> packageList = new TreeMap<String, Package>();

    SELECT statement = new SELECT(new FROM(model),
        new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
    IQueryResult result = statement.execute();

    for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
        Package pkg = (Package) ir.next();

        if (pkg == null || pkg.getQualifiedName() == null) {
            continue;
        }
        if (AdapterFactoryEditingDomain.isControlled(pkg)) {
            packageList.put(pkg.getQualifiedName(), pkg);
            continue;
        }
    }

    return packageList;
 }
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:30,代码来源:ProjectUtil.java

示例2: selectQuery

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
private static TreeMap<String, Package> selectQuery(Resource resource) {
    TreeMap<String, Package> packageList = new TreeMap<String, Package>();

    Model model = (org.eclipse.uml2.uml.Model) EcoreUtil.getObjectByType(resource.getContents(),
        UMLPackage.Literals.MODEL);

    if (model == null)
        return packageList;

    SELECT statement = new SELECT(new FROM(model),
        new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
    IQueryResult result = statement.execute();

    for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
        Package pkg = (Package) ir.next();

        if (pkg == null || pkg.getQualifiedName() == null) {
            continue;
        }

        packageList.put(String.format("%s_%s", pkg.getQualifiedName(), EcoreUtil.getURI(pkg).fragment()), pkg);
    }

    return packageList;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:26,代码来源:ModelInformationUtil.java

示例3: hasError

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
/**
 * To detect if there is error in SysML file
 * 
 * @param file
 *            file is the SysML which is going to test
 * @param resourceSet
 *            resourceSet is the EMF resourceSet
 * @return true or false.
 */
public Boolean hasError(File file, ResourceSet resourceSet) {
	String method = "SysMLChecker_hasError(): ";
	long startTime = System.currentTimeMillis();
	MyLog.info(method + "start");

	Boolean flag = false;
	URI uri = URI.createFileURI(file.getPath());

	@SuppressWarnings("unused")
	Model umlModel = UML2Util.load(resourceSet, uri, UMLPackage.Literals.MODEL);
	for (Resource umlResourceImpl : resourceSet.getResources()) {
		if (!umlResourceImpl.getErrors().isEmpty()) {
			MyLog.info(method + "there is an error inside.");
			flag = true;
		} else {

		}
	}

	umlModel = null;

	MyLog.info(method + "end with " + (System.currentTimeMillis() - startTime) + " millisecond");
	MyLog.info();
	return flag;
}
 
开发者ID:ZhengshuaiPENG,项目名称:org.lovian.eaxmireader,代码行数:35,代码来源:SysMLChecker.java

示例4: load

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
/**
 * 패키지형 객체 반환
 * 
 * @param uri
 * @return Package
 */
public static Package load(URI uri) {
    org.eclipse.uml2.uml.Package newPackage = null;
    Resource resource = null;

    try {
        if (domainModelHandler != null) {
            resource = domainModelHandler.getResourceSet().getResource(uri, true);
        } else {
            resource = getHandlerInstance().getResourceSet().getResource(uri, true);
        }
        
        newPackage = (org.eclipse.uml2.uml.Package) EcoreUtil.getObjectByType(resource.getContents(),
            UMLPackage.Literals.PACKAGE);
    } catch (WrappedException we) {
        Log.error(we);
    }

    return newPackage;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:26,代码来源:DomainModelHandlerUtil.java

示例5: init

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
/**
 * Creates, registers, and initializes the <b>Package</b> for this
 * model, and for any others upon which it depends.  Simple
 * dependencies are satisfied by calling this method on all
 * dependent packages before doing anything else.  This method drives
 * initialization for interdependent packages directly, in parallel
 * with this package, itself.
 * <p>Of this package and its interdependencies, all packages which
 * have not yet been registered by their URI values are first created
 * and registered.  The packages are then initialized in two steps:
 * meta-model objects for all of the packages are created before any
 * are initialized, since one package's meta-model objects may refer to
 * those of another.
 * <p>Invocation of this method will not affect any packages that have
 * already been initialized.
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @see #eNS_URI
 * @see #createPackageContents()
 * @see #initializePackageContents()
 * @generated
 */
public static UMLDiagramPackage init() {
    if (isInited) return (UMLDiagramPackage)EPackage.Registry.INSTANCE.getEPackage(UMLDiagramPackage.eNS_URI);

    // Obtain or create and register package
    UMLDiagramPackageImpl theUMLDiagramPackage = (UMLDiagramPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof UMLDiagramPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new UMLDiagramPackageImpl());

    isInited = true;

    // Initialize simple dependencies
    UMLPackage.eINSTANCE.eClass();
    XMLTypePackage.eINSTANCE.eClass();

    // Create package meta-data objects
    theUMLDiagramPackage.createPackageContents();

    // Initialize created meta-data
    theUMLDiagramPackage.initializePackageContents();

    // Mark meta-data to indicate it can't be changed
    theUMLDiagramPackage.freeze();

    return theUMLDiagramPackage;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:45,代码来源:UMLDiagramPackageImpl.java

示例6: init

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
/**
 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
 * 
 * <p>This method is used to initialize {@link RelationPackage#eINSTANCE} when that field is accessed.
 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @see #eNS_URI
 * @see #createPackageContents()
 * @see #initializePackageContents()
 * @generated
 */
public static RelationPackage init() {
    if (isInited) return (RelationPackage)EPackage.Registry.INSTANCE.getEPackage(RelationPackage.eNS_URI);

    // Obtain or create and register package
    RelationPackageImpl theRelationPackage = (RelationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof RelationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new RelationPackageImpl());

    isInited = true;

    // Initialize simple dependencies
    UMLPackage.eINSTANCE.eClass();

    // Create package meta-data objects
    theRelationPackage.createPackageContents();

    // Initialize created meta-data
    theRelationPackage.initializePackageContents();

    // Mark meta-data to indicate it can't be changed
    theRelationPackage.freeze();

  
    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(RelationPackage.eNS_URI, theRelationPackage);
    return theRelationPackage;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:38,代码来源:RelationPackageImpl.java

示例7: handleNewTarget

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
/**
 * handleNewTarget
 */
private void handleNewTarget() {

    oldTarget = (AbstractNode) connection.getTarget();

    diagram.getConnectionList().remove(connection);
    reconnectTarget(newTarget);
    diagram.getConnectionList().add(connection);
    ActivityEdge activity = (ActivityEdge) this.connection.getUmlModel();
    if (activity != null) {
        switch (activity.eClass().getClassifierID()) {
            case UMLPackage.CONTROL_FLOW:
                handleNewTargetForControlFlow((ControlFlow) activity);
                break;
            case UMLPackage.OBJECT_FLOW:
                handlerNewTargetForObjectFlow((ObjectFlow) activity);
                break;
            default:
                return;
        }
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:25,代码来源:ActivityReconnectConnectionCommand.java

示例8: createDiagramDataModelList

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
/**
 * Diagram 데이터 모델 리스트를 생성합니다.
 * 
 * @param pkg
 * @return List<DataModel>
 */
private List<DataModel> createDiagramDataModelList(Package pack) throws Exception {
    List<DataModel> diagramModelList = new ArrayList<DataModel>();
    EAnnotation annotation = null;
    Diagram diagram;
    for (PackageableElement element : pack.getPackagedElements()) {
        if (element.eClass() == UMLPackage.Literals.COLLABORATION) {
            annotation = element.getEAnnotation(UICoreConstant.PROJECT_CONSTANTS__DIAGRAM);
            if (annotation != null) {
                for (EObject eobj : annotation.getContents()) {
                    if (eobj.eClass() == UMLDiagramPackage.Literals.DIAGRAM) {
                        diagram = (Diagram) eobj;
                        if (diagram.getType() == DiagramType.CLASS_DIAGRAM) {
                            diagramModelList.add(createDiagramModel(diagram));
                        }
                    }
                }
            }
        }
    }

    // if (eObject.eClass() == UMLPackage.Literals.PACKAGE
    // || eObject.eClass() == UMLPackage.Literals.MODEL) {
    // Package pkg = (Package) eObject;
    // for (PackageableElement element : pkg.getPackagedElements()) {
    // diagramModelList.addAll(createDiagramDataModelList(element));
    // }
    // }

    return diagramModelList;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:37,代码来源:CreateClassDefinitionToXMLFileJob.java

示例9: createClassDataModelList

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
/**
 * Class 데이터 모델 리스트를 생성합니다.
 * 
 * @param pkg
 * @return List<DataModel>
 */
private List<DataModel> createClassDataModelList(Package pkg) {
    List<DataModel> classModelList = new ArrayList<DataModel>();

    DataModel classModel;

    List<PackageableElement> list = pkg.getPackagedElements();
    List<Class> classes = new ArrayList<Class>();
    for (PackageableElement packageableElement : list) {
        if (packageableElement.eClass() == UMLPackage.Literals.CLASS) {
            classes.add((Class) packageableElement);
        }
    }

    ProjectUtil.getSortedList(classes);
    if (!classes.isEmpty()) {
        for (Class clazz : classes) {

            classModel = new DataModel();

            setDataModel(classModel, UICoreConstant.REPORT__CLASS_NAME, clazz.getName());
            setDataModel(classModel, UICoreConstant.REPORT__CLASS_STEREOTYPE, ProjectUtil.getStereotypeLabel(clazz));
            setDataModel(classModel,
                UICoreConstant.REPORT__CLASS_DOCUMENTATION,
                getCommentToString(clazz.getOwnedComments()));
            setDataModel(classModel, UICoreConstant.REPORT__ATTRIBUTE_LIST, createAttributeDataModelList(clazz));
            setDataModel(classModel, UICoreConstant.REPORT__OPERATION_LIST, createOperationDataModelList(clazz));

            classModelList.add(classModel);
        }

    }

    return classModelList;

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:42,代码来源:CreateClassDefinitionToXMLFileJob.java

示例10: createAndInitResourceSet

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
/**
 * Creates and initializes a resource set.
 * 
 * @return The created and initialized resource set.
 */
public ResourceSet createAndInitResourceSet() {
	ResourceSet resourceSet = new ResourceSetImpl();

	URI uml2ResourcesPluginURI = URI.createURI(ExporterConfiguration.UML2_RESOURCES_PLUGIN_PATH);
	resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
	resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION,
			UMLResource.Factory.INSTANCE);

	Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();

	uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
			uml2ResourcesPluginURI.appendSegment("libraries").appendSegment(""));

	uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
			uml2ResourcesPluginURI.appendSegment("metamodels").appendSegment(""));

	uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
			uml2ResourcesPluginURI.appendSegment("profiles").appendSegment(""));

	uriMap.put(URI.createURI("pathmap://TXTUML_STDLIB/"),
			URI.createURI("platform:/plugin/hu.elte.txtuml.stdlib/src/hu/elte/txtuml/stdlib/"));

	UMLResourcesUtil.init(resourceSet);
	return resourceSet;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:31,代码来源:ResourceSetFactory.java

示例11: getValueFromValueSpecification

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
private String getValueFromValueSpecification(ValueSpecification valueSpec) {
	String source = "";
	if (valueSpec.eClass().equals(UMLPackage.Literals.LITERAL_INTEGER)) {
		source = ((Integer) ((LiteralInteger) valueSpec).getValue()).toString();
	} else if(valueSpec.eClass().equals(UMLPackage.Literals.LITERAL_REAL)) {
		source = ((Double)  ((LiteralReal) valueSpec).getValue()).toString();
	}
	else if (valueSpec.eClass().equals(UMLPackage.Literals.LITERAL_BOOLEAN)) {
		source = ((Boolean) ((LiteralBoolean) valueSpec).isValue()).toString();
	} else if (valueSpec.eClass().equals(UMLPackage.Literals.LITERAL_STRING)) {
		source = "\"" + ((LiteralString) valueSpec).getValue() + "\"";
	
	} else if(valueSpec.eClass().equals(UMLPackage.Literals.LITERAL_NULL)) {
		source = ActivityTemplates.NullPtrLiteral;
	}
	else {
		source = "UNHANDLED_VALUEPIN_VALUETYPE";
	}
	return source;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:21,代码来源:ActivityNodeResolver.java

示例12: getComponentList

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
/**
 * getComponentList
 *  
 * @param diagram
 * @param source void
 */
public static void getComponentList(Diagram diagram, List<Component> source) {

    if (null != diagram) {
        EList<AbstractNode> nodeList = diagram.getNodeList();
        for (AbstractNode abstractNode : nodeList) {
            Element element = abstractNode.getUmlModel();
            if (element != null) {
                if (element.eClass() == UMLPackage.Literals.COMPONENT) {
                    if (!source.contains(element)) {
                        source.add((Component) element);
                    }
                }
            }
        }
    }

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:24,代码来源:UMLManipulation.java

示例13: packageFragmentOfResource

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
/**
 * 
 * 리소스에 포함된 단편 개수 void
 */
public static TreeMap<String, Package> packageFragmentOfResource(Resource resource) {
    
    Model model = (org.eclipse.uml2.uml.Model) EcoreUtil.getObjectByType(resource.getContents(),
        UMLPackage.Literals.MODEL);

    TreeMap<String, Package> packageList = new TreeMap<String, Package>();

    if (model == null)
        return packageList;

    SELECT statement = new SELECT(new FROM(model),
        new WHERE(new EObjectTypeRelationCondition(UMLPackage.eINSTANCE.getPackage())));
    IQueryResult result = statement.execute();

    for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
        Package pkg = (Package) ir.next();

        if (pkg == null || pkg.getQualifiedName() == null) {
            continue;
        }
        if (AdapterFactoryEditingDomain.isControlled(pkg)) {
            packageList.put(String.format("%s_%s", pkg.getQualifiedName(), EcoreUtil.getURI(pkg).fragment()), pkg);
        }
    }

    return packageList;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:32,代码来源:ModelInformationUtil.java

示例14: diagramInfomationOfResource

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
/**
 * 
 * 리소스에 포함된 다이어그램 정보 void
 */
public static TreeMap<String, Diagram> diagramInfomationOfResource(Resource resource) {
    Model model = (org.eclipse.uml2.uml.Model) EcoreUtil.getObjectByType(resource.getContents(),
        UMLPackage.Literals.MODEL);

    TreeMap<String, Diagram> diagramList = new TreeMap<String, Diagram>();

    if (model == null)
        return diagramList;

    SELECT statement = new SELECT(new FROM(model),
        new WHERE(new EObjectTypeRelationCondition(UMLDiagramPackage.eINSTANCE.getDiagram())));
    IQueryResult result = statement.execute();

    for (Iterator<?> ir = result.iterator(); ir.hasNext();) {
        Diagram diagram = (Diagram) ir.next();
        String key = genKey(diagram);

        diagramList.put(key, diagram);
    }

    return diagramList;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:27,代码来源:ModelInformationUtil.java

示例15: applyTyped

import org.eclipse.uml2.uml.UMLPackage; //导入依赖的package包/类
@Override
protected void applyTyped(Require object) {
	if (object.eContainer() instanceof Classifier) {
		Classifier classifier = (Classifier) object.eContainer();
		if (classifier.getReferencedElement() != null && object.getInterface() != null
				&& object.getInterface().getReferencedElement() != null) {
			Element umlClassifier = classifier.getReferencedElement();
			EList<DirectedRelationship> usages = umlClassifier
					.getSourceDirectedRelationships(UMLPackage.eINSTANCE.getUsage());
			Optional<Usage> umlUsage = usages.stream().map(Usage.class::cast)
					.filter(u -> u.getSuppliers().contains(object.getInterface().getReferencedElement()))
					.filter(u -> object.getName() == null? true : u.getName().equals(object.getName()))
					.findFirst();
			if (umlUsage.isPresent()) {
				object.setReferencedElement(umlUsage.get());
			}
		}
	}

}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:21,代码来源:RequireCalculator.java


注:本文中的org.eclipse.uml2.uml.UMLPackage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。