• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Type类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getTargetSenderLifeline

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * find target sender
 * 
 * @param sourceInteraction
 * @param targetInteraction
 * @param senderDataName
 * @param source
 * @param transformationData
 * @return
 */
public static Lifeline getTargetSenderLifeline(Interaction sourceInteraction, Interaction targetInteraction, String senderDataName,
                                               Lifeline source, MDADesignerTransformationData transformationData) {
    if (!isValid(transformationData) || source == null) {
        return null;
    }

    List<Type> targetTypeList = getTargetLifeLineTypeList(sourceInteraction.eResource(), source, transformationData);
    List<BehaviorTransformationDetailData> behaviorTransformationDetailDataList = findSenderTransformationRule(source,
        transformationData.getRuleSet());
    for (Iterator<BehaviorTransformationDetailData> iter = behaviorTransformationDetailDataList.iterator(); iter.hasNext();) {
        BehaviorTransformationDetailData behaviorTransformationDetailData = iter.next();
        String dataName = behaviorTransformationDetailData.getTargetRelation().getSource().getDataName();
        if (dataName.equals(senderDataName)) {
            return getLifelineByDataNameAndTypeList(targetInteraction,
                dataName,
                transformationData.getRuleSet(),
                targetTypeList);
        }
    }

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


示例2: getTargetReceiverLifeline

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * find target receiver
 * 
 * @param sourceInteraction 
 * @param targetInteraction
 * @param receiverDataName
 * @param source
 * @param transformationData
 * @return
 */
public static Lifeline getTargetReceiverLifeline(Interaction sourceInteraction, Interaction targetInteraction, String receiverDataName,
                                                 Lifeline source, MDADesignerTransformationData transformationData) {
    if (transformationData == null || source == null) {
        return null;
    }
    List<Type> targetTypeList = getTargetLifeLineTypeList(sourceInteraction.eResource(), source, transformationData);

    List<BehaviorTransformationDetailData> behaviorTransformationDetailDataList = findReceiverTransformationRule(source,
        transformationData.getRuleSet());
    for (Iterator<BehaviorTransformationDetailData> iter = behaviorTransformationDetailDataList.iterator(); iter.hasNext();) {
        BehaviorTransformationDetailData behaviorTransformationDetailData = iter.next();
        String dataName = behaviorTransformationDetailData.getTargetRelation().getTarget().getDataName();
        if (dataName.equals(receiverDataName)) {
            return getLifelineByDataNameAndTypeList(targetInteraction,
                dataName,
                transformationData.getRuleSet(),
                targetTypeList);
        }
    }

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


示例3: getSourceStructureTransformationDataList

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * find a list of related SourceStructureTransformationData for lifeline
 * 
 * @param sourceLifeline
 * @param ruleSet
 * @return
 */
public static List<SourceStructureTransformationData> getSourceStructureTransformationDataList(
                                                                                               Lifeline sourceLifeline,
                                                                                               RuleSet ruleSet) {
    if (sourceLifeline == null || sourceLifeline.getRepresents() == null
        || sourceLifeline.getRepresents().getType() == null) {
        return null;
    }

    Type type = sourceLifeline.getRepresents().getType();
    EList<SourceStructureTransformationData> sourceStructureTransformationDataList = ruleSet.getStructureRules();
    SourceStructureTransformationData sourceStructureTransformationData = null;
    List<SourceStructureTransformationData> result = new ArrayList<SourceStructureTransformationData>();

    for (Iterator<SourceStructureTransformationData> iter = sourceStructureTransformationDataList.iterator(); iter.hasNext();) {
        sourceStructureTransformationData = iter.next();

        if (isAppliedStereotype(type, sourceStructureTransformationData.getSourceType().getSourceName())) {
            result.add(sourceStructureTransformationData);
        }
    }

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


示例4: existInTypeSet

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * 라이프라인의 타입이 BehaviorRule에 해당 유무 반환.
 * 
 * @param typeSet
 * @param lifelineType
 * @return boolean
 */
private boolean existInTypeSet(Set<String> typeSet, Type lifelineType) {
    if (null == typeSet || typeSet.size() == 0) {
        return false;
    }
    if (typeSet.contains(ManagerConstant.UML_TYPE_LITERAL)) {
        if (null != lifelineType) {
            return true;
        }
    }
    if (typeSet.contains(ManagerConstant.UML_ACTOR_LITERAL)) {
        if (lifelineType instanceof Actor) {
            return true;
        }
    }

    EList<Stereotype> stereotypes = lifelineType.getAppliedStereotypes();
    for (Stereotype stereotype : stereotypes) {
        if (typeSet.contains(stereotype.getName())) {
            return true;
        }
    }

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


示例5: createAssociation

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * 클래스간 관계 생성
 * 
 * @param type1
 * @param end1IsNavigable
 * @param end1Aggregation
 * @param end1Name
 * @param end1LowerBound
 * @param end1UpperBound
 * @param type2
 * @param end2IsNavigable
 * @param end2Aggregation
 * @param end2Name
 * @param end2LowerBound
 * @param end2UpperBound
 * @return Association
 */
public static Association createAssociation(Type type1, boolean end1IsNavigable, AggregationKind end1Aggregation,
                                            String end1Name, int end1LowerBound, int end1UpperBound, Type type2,
                                            boolean end2IsNavigable, AggregationKind end2Aggregation,
                                            String end2Name, int end2LowerBound, int end2UpperBound) {

    Association association = type1.createAssociation(end1IsNavigable,
        end1Aggregation,
        end1Name,
        end1LowerBound,
        end1UpperBound,
        type2,
        end2IsNavigable,
        end2Aggregation,
        end2Name,
        end2LowerBound,
        end2UpperBound);
    return association;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:36,代码来源:ClassDiagramUtil.java


示例6: applyTypePreference

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * 환경설정에서 유형을 경로 전체를 보여줄 지, 이름만 보여줄 지 설정 정보를 체크하여 적절한 문자열을 리턴.
 * 
 * @param typeName
 * @return String
 */
public static String applyTypePreference(Type type) {

    String result;
    if (null == type) {
        return null;
    }

    IPreferenceStore store = PreferenceUtil.INSTANCE.getPreferenceStore();
    if (store.getBoolean(ManagerConstant.PREFERENCE_CONSTANT_KEY__NEXCORE_TOOL_UML_REPORT_PRINT_PATH_ALL)) {
        result = type.getQualifiedName();
    } else {
        result = type.getName();
    }
    return result;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:22,代码来源:ReportContentManager.java


示例7: refreshChildren

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * @see nexcore.tool.uml.ui.property.section.TemplateTextSection#refreshChildren()
 */
@Override
public void refreshChildren() {
    if (null == this.text || this.text.isDisposed()) {
        return;
    }
    String str = this.get();
    if (null != str && !str.equals(this.text.getText())) {
        this.text.setText(str);
    } else if (str == null) {
        this.text.setText("");
    }

    Property property = (Property) getData();
    Type type = property.getType();
    
    if(type instanceof org.eclipse.uml2.uml.Class) {
        this.text.setEnabled(false);
    } else {
        this.text.setEnabled(true);            
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:25,代码来源:DefaultValueGeneralSection.java


示例8: addType

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * 
 * void
 */
private void addType() {
    dialog = new TypeSelectDialog(addButton.getShell(), TypeSelectDialogType.RAISED_EXCEPTION, getData());
    dialog.setTitle(UMLMessage.LABEL_SELECT_ELEMENT);
    if (dialog.open() == TypeSelectDialog.OK) {
        DomainUtil.run(new TransactionalAction() {
            /**
             * @see nexcore.tool.uml.manager.transaction.TransactionalAction#doExecute()
             */
            @Override
            public void doExecute() {
                getData().getRaisedExceptions().add((Type) dialog.getFirstResult());
            }
        });
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:20,代码来源:ExceptionsSection.java


示例9: createSelectTypeDialog

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * createSelectTypeDialog
 *  
 * @param applicableTypeList void
 */
private void createSelectTypeDialog(ArrayList<Type> applicableTypeList) {
    TypeSelectDialog dialog = new TypeSelectDialog(null, TypeSelectDialogType.RETURN_TYPE, getData());
    dialog.setElements(applicableTypeList.toArray());
    int returnCode = dialog.open();
    switch (returnCode) {
        case Window.OK:
            selectedElement = (Element) dialog.getFirstResult();
        case Window.CANCEL:
            return;
        case IDialogConstants.FINISH_ID:
            return;
        default:
            return;
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:21,代码来源:NameOfNotationGeneralSection.java


示例10: settingTypeToLabelOfType

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * 유형을 표시하는 레이블에 해당 속성 모델의 유형을 세팅함.
 * 
 * @param selectedType
 *            void
 */
private void settingTypeToLabelOfType() {
    ConnectableElement represents = getData().getRepresents();
    String name = UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING;
    Image image = null;
    if (represents != null && represents instanceof Property) {
        Property property = (Property) represents;
        Type type = property.getType();
        if (type != null) {
            name = type.getName();
            image = UICoreConstant.UMLSECTION_CONSTANTS__ADAPTER_FACTORY_LABEL_PROVIDER.getImage(type);
        }
    }
    if (!typeNameLabel.isDisposed()) {
        typeNameLabel.setImage(image);
        typeNameLabel.setText(name);
        typeNameLabel.getParent().pack();
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:25,代码来源:TypeOfLifelineGeneralSection.java


示例11: getTypeList

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

    typeList.clear();
    typeList.add(pType);

    if (pType instanceof Class) {
        Class clazz = (Class) pType;
        List<Interface> interfaces = clazz.getAllImplementedInterfaces();
        typeList.addAll(interfaces);
    }

    typeCombo.removeAll();
    for (Type t : typeList) {
        typeCombo.add(t.getName());
    }
    typeCombo.select(0);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:22,代码来源:CreateOperationDialog.java


示例12: getColumnText

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
 */
public String getColumnText(Object element, int columnIndex) {
    if(columnIndex == 0) {
        if (element instanceof Lifeline) {
            String name = "";
            Lifeline lifeline = (Lifeline) element;
            name = lifeline.getName();
            if (lifeline.getRepresents() != null) {
                Type type = lifeline.getRepresents().getType();
                if (type != null) {
                    String typeName = type.getName();    
                    if (!SequenceUtil.checkLifelineVisibility()) {
                        name = "";
                    }
                    name = name + ":" + typeName;
                }
            }
            return name;
        }
        return "";
    }
    
    return "";
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:27,代码来源:CoveredLifelineLabelProvider.java


示例13: activate

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#activate()
 */
@Override
public void activate() {
    if (!isActive()) {
        super.activate();
        NotationNode model = (NotationNode) getModel();
        model.eAdapters().add(this);
        if (this.getParent().getModel() instanceof NotationNode) {
            AbstractView viewModel = (AbstractView) this.getParent().getModel();
            viewModel.getUmlModel().eAdapters().add(this);
            if (viewModel.getUmlModel() instanceof Lifeline
                && ((Lifeline) viewModel.getUmlModel()).getRepresents() != null
                && ((Lifeline) viewModel.getUmlModel()).getRepresents().getType() != null) {
                Type type = ((Lifeline) viewModel.getUmlModel()).getRepresents().getType();
                type.eAdapters().add(this);
            }
        }
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:22,代码来源:AbstractLifeLineCompartmentEditPart.java


示例14: deactivate

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#deactivate()
 */
@Override
public void deactivate() {
    if (isActive()) {
        super.deactivate();
        NotationNode model = (NotationNode) getModel();
        model.eAdapters().remove(this);
        if (this.getParent().getModel() instanceof NotationNode) {
            AbstractView viewModel = (AbstractView) this.getParent().getModel();
            viewModel.getUmlModel().eAdapters().remove(this);
            if (viewModel.getUmlModel() instanceof Lifeline
                && ((Lifeline) viewModel.getUmlModel()).getRepresents() != null
                && ((Lifeline) viewModel.getUmlModel()).getRepresents().getType() != null) {
                Type type = ((Lifeline) viewModel.getUmlModel()).getRepresents().getType();
                type.eAdapters().remove(this);
            }
        }
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:22,代码来源:AbstractLifeLineCompartmentEditPart.java


示例15: activate

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#activate()
 */
public void activate() {
    if (!isActive()) {
        EObject model = ((LifeLineNameHeader) getModel()).getLifeLine();
        model.eAdapters().add(this);
        model = ((AbstractNode) model).getUmlModel();
        if (null == model) {
            return;
        }
        model.eAdapters().add(this);
        if (model instanceof Lifeline && ((Lifeline) model).getRepresents() != null
            && ((Lifeline) model).getRepresents().getType() != null) {
            Type type = ((Lifeline) model).getRepresents().getType();
            type.eAdapters().add(this);
        }
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:20,代码来源:LifeLineNameHeaderEditPart.java


示例16: createOperation

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * Lifeline의 Type에 새 Operation을 생성. (생성된 operation을 Type에 붙이는 것은 transaction
 * 때문에 execute()에서 처리) void
 * 
 * @param type
 */
public static Operation createOperation(Type pType) {

    Operation operation = null;
    CreateOperationDialog dialog = new CreateOperationDialog(RealizationPlugin.getShell(), pType);
    if (dialog.open() == Window.OK) {

        String operationName = dialog.getOperationName();
        Type type = dialog.getSelectedType();

        operation = UMLHelper.createOperation();
        if (operationName.equals(UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING)) {
            NamedElement namedElement = (NamedElement) operation;
            namedElement.setName(UMLManager.getPackagedUniqueName((Namespace) type, namedElement.getName()));
        } else {
            operation.setName(operationName);
        }
    }
    return operation;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:26,代码来源:SequenceUtil.java


示例17: applyTyped

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
@Override
protected void applyTyped(Port object) {
	if (object.eContainer() instanceof Component) {
		Component component = (Component) object.eContainer();
		if (component.getReferencedElement() != null && object.getRealizedClassifier() != null
				&& object.getRealizedClassifier().getReferencedElement() != null && object.getName() != null) {
			org.eclipse.uml2.uml.Component umlComponent = (org.eclipse.uml2.uml.Component) component
					.getReferencedElement();
			Type umlType = (Type) object.getRealizedClassifier().getReferencedElement();
			Optional<org.eclipse.uml2.uml.Port> umlPort = Optional
					.ofNullable(umlComponent.getOwnedPort(object.getName(), umlType));

			if (umlPort.isPresent()) {
				object.setReferencedElement(umlPort.get());
			}
		}
	}

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


示例18: applyTyped

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
@Override
protected void applyTyped(Port object) {
	if (object.getReferencedElement() != null) {
		 org.eclipse.uml2.uml.Port umlPort = object.getReferencedElement();
		 Type umlType = umlPort.getType();
		if(umlType != null) {
			UMLReferencingElementFinder finder = UMLReferencingElementFinder
					.create(EcoreUtil.getRootContainer(object));
			Optional<Classifier> type = finder.findElement(umlType, Classifier.class);
			if (type.isPresent()) {
				object.setRealizedClassifier(type.get());
			}
		}
		
		if(!object.isSetConjugated())
			object.setConjugated(umlPort.isConjugated());
		
		
	}

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


示例19: match

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
/**
 * Matches the given textual with the given UML association based on the involved member end types.
 * 
 * @param txtAssociation
 *            The textual association.
 * @param umlAssociation
 *            The UML association.
 * @return True if all types match. False otherwise.
 */
public static boolean match(XtextAssociation txtAssociation, Association umlAssociation) {
    Optional<List<org.eclipse.uml2.uml.Classifier>> txtUMLTypes = findUMLTypes(txtAssociation);
    if (!txtUMLTypes.isPresent()) {
        return false;
    }
    List<Type> umlUMLTypes = umlAssociation.getMemberEnds().stream().map(Property::getType)
            .collect(Collectors.toList());
    if (txtUMLTypes.get().size() != umlUMLTypes.size() || txtUMLTypes.get().stream().anyMatch(Objects::isNull)) {
        return false;
    }

    for (int i = 0; i < txtUMLTypes.get().size(); ++i) {
        if (txtUMLTypes.get().get(i) != umlUMLTypes.get(mapIndexTxt2Uml(i, txtUMLTypes.get().size()))) {
            return false;
        }
    }
    return true;
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:28,代码来源:AssociationMatcher.java


示例20: validateCooperateModel

import org.eclipse.uml2.uml.Type; //导入依赖的package包/类
@Override
public boolean validateCooperateModel(IValidationContext ctx, Association target) {
    Collection<java.lang.Class<?>> relevantEndTypes = Arrays.asList(Class.class, Interface.class);
    if (!target.getEndTypes().stream().allMatch(
            testType -> relevantEndTypes.stream().anyMatch(relevantType -> relevantType.isInstance(testType)))) {
        // The association is not in a class diagram and therefore not relevant for this constraint
        return true;
    }

    if (!StringUtils.isBlank(target.getName())) {
        return true;
    }

    Collection<Type> wantedTypes = getTypes(target);
    return target.getNearestPackage().getMembers().stream().filter(Association.class::isInstance)
            .map(Association.class::cast).filter(a -> a != target).allMatch(a -> !getTypes(a).equals(wantedTypes));
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:18,代码来源:ClassDiagramAssociationConstraint.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BodyKind类代码示例发布时间:2022-05-22
下一篇:
Java LoopController类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap