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

Java EnumerationLiteral类代码示例

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

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



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

示例1: parentIsEnumerationAndDo

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
/**
 * 상위 부모가 Enumeration 요소이고 자식 요소가 해당 Enumeration에
 * 속한다면 붙이기를 수행한다.
 * @param parent UML 요소를 붙여 넣을 부모
 * @param copied 복사된 UML 요소
 * @param original 원본 UML 요소
 * @param something 복사할 것인지 복사 가능여부만 체크할 것인지 결정하는 플래그
 * @return boolean 부모로 복사 성공 여부
 */
private static boolean parentIsEnumerationAndDo(EObject parent, EObject copied, EObject original, int something) {
    boolean result = false;
    
    Enumeration enumeration = (Enumeration) parent;
    if (copied instanceof EnumerationLiteral) {
        if (something == COPY) enumeration.getOwnedLiterals().add((EnumerationLiteral) copied);
        result = true;
        
    } else if (copied instanceof Property) {
        if (something == COPY) enumeration.getOwnedAttributes().add((Property) copied);
        result = true;
        
    } else if (copied instanceof Operation) {
        if (something == COPY) enumeration.getOwnedOperations().add((Operation) copied);
        result = true;
    }
    
    if (result && something == COPY) applyStereotypes(parent, copied, original); 
    
    return result;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:31,代码来源:ElementCopier.java


示例2: upperLiteral

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
/**
 * 선택된 Attribute를 위로 이동
 */
@SuppressWarnings("unchecked")
private void upperLiteral() {
    IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
    EList<EnumerationLiteral> literalList = null;
    if (getData() instanceof Enumeration) {
        literalList = ((Enumeration) getData()).getOwnedLiterals();
    }
    int index = 0;
    for (Iterator<EnumerationLiteral> iterator = selection.iterator(); iterator.hasNext();) {
        EnumerationLiteral next = iterator.next();
        index = literalList.indexOf(next);
        if (index > 0)
            literalList.move(index - 1, next);
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:19,代码来源:LiteralSection.java


示例3: downLiteral

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
/**
 * 선택된 Attribute를 아래로 이동
 */
@SuppressWarnings("unchecked")
private void downLiteral() {
    IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
    EList<EnumerationLiteral> literalList = null;
    if (getData() instanceof Enumeration) {
        literalList = ((Enumeration) getData()).getOwnedLiterals();
    }
    int index = 0;
    for (Iterator<EnumerationLiteral> iterator = selection.iterator(); iterator.hasNext();) {
        EnumerationLiteral next = iterator.next();
        index = literalList.indexOf(next);
        if (index < literalList.size() - 1)
            literalList.move(index + 1, next);
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:19,代码来源:LiteralSection.java


示例4: getText

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
/**
 * @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object)
 */
@Override
public String getText(Object element) {
    if (element instanceof EnumerationLiteral) {
        EnumerationLiteral enumerationLiteral = (EnumerationLiteral) element;
        switch (columnNumber) {
            case _NAME_COLUMN:
                return getTextOfName(enumerationLiteral);
            case _DEFAULT_VALUE_COLUMN:
                return getTextOfDefaultValue(enumerationLiteral);
            case _SPECIFICATION_COLUMN:
                return getTextOfSpecification(enumerationLiteral);
            default:
                return EMPTY_TEXT;
        }
    }
    return null;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:21,代码来源:LiteralSectionLabelProvider.java


示例5: renderObject

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
public boolean renderObject(Enumeration enumeration, IndentedPrintWriter writer, IRenderingSession context) {
    RenderingUtils.renderAll(context, ElementUtils.getComments(enumeration));
    TextUMLRenderingUtils.renderStereotypeApplications(writer, enumeration);
    writer.println("enumeration " + name(enumeration));
    writer.enterLevel();
    EList<EnumerationLiteral> literals = enumeration.getOwnedLiterals();
    StringBuilder builder = new StringBuilder();
    for (EnumerationLiteral enumerationLiteral : literals) {
        builder.append(name(enumerationLiteral));
        builder.append(", ");
    }
    if (builder.length() > 0) {
        builder.delete(builder.length() - 2, builder.length());
        writer.print(builder);
        writer.println();
    }
    RenderingUtils.renderAll(context, enumeration.getOwnedAttributes());
    RenderingUtils.renderAll(context, enumeration.getOwnedOperations());
    writer.exitLevel();
    writer.println("end;");
    writer.println();
    return true;
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:24,代码来源:EnumerationRenderer.java


示例6: parseEnumerationLiteral

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
protected ValueSpecification parseEnumerationLiteral(PLiteralOrIdentifier node, final Type expectedType) {
    TIdentifier identifier = ((AIdentifierLiteralOrIdentifier) node).getIdentifier();
    String literalName = identifier.getText().trim();
    Enumeration targetEnumeration = (Enumeration) expectedType;
    EnumerationLiteral enumerationValue = ((Enumeration) targetEnumeration).getOwnedLiteral(literalName);
    if (enumerationValue == null) {
        problemBuilder.addError(
                "Unknown enumeration literal '" + literalName + "' in '" + targetEnumeration.getName() + "'", node);
        throw new AbortedScopeCompilationException();
    }
    InstanceValue valueSpec = (InstanceValue) currentNamespace.getNearestPackage().createPackagedElement(null,
            IRepository.PACKAGE.getInstanceValue());
    valueSpec.setInstance(enumerationValue);
    valueSpec.setType(targetEnumeration);
    return valueSpec;
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:17,代码来源:SimpleInitializationExpressionProcessor.java


示例7: isInputPort

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
static public boolean isInputPort(Port e){
		boolean isInput=false;
		//flow port in
		for (Stereotype st : e.getAppliedStereotypes()) {
			if(st.getName().equals("DataFlowPort")){
				
				isInput= ((EnumerationLiteral)e.getValue(st, "direction")).getName().equals("in");				
			}
		}
//		if(!e.getAppliedStereotypes().isEmpty()){
//			DataFlowPort f = UMLUtil.getStereotypeApplication(e, DataFlowPort.class);
//			if(f!=null){isInput=f.getDirection().equals( DataFlowDirectionKind.IN);}
//		}
		return isInput;
	}
 
开发者ID:bmaggi,项目名称:Eclipse-Gendoc-Templates,代码行数:16,代码来源:RobotML_Queries.java


示例8: isOutputPort

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
static public boolean isOutputPort(Port e){
		boolean isOutput=false;
		//flow port out
		for (Stereotype st : e.getAppliedStereotypes()) {
			if(st.getName().equals("DataFlowPort")){
				isOutput= ((EnumerationLiteral)e.getValue(st, "direction")).getName().equals("out");				
			}
		}
//		if(!e.getAppliedStereotypes().isEmpty()){
//			DataFlowPort f = UMLUtil.getStereotypeApplication(e, DataFlowPort.class);
//			if(f!=null){isOutput=f.getDirection().equals(DataFlowDirectionKind.OUT);}
//		}
		return isOutput;
	}
 
开发者ID:bmaggi,项目名称:Eclipse-Gendoc-Templates,代码行数:15,代码来源:RobotML_Queries.java


示例9: isInOutPort

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
static public boolean isInOutPort(Port e){
		boolean isInOut=false;
		//flow port inout
		for (Stereotype st : e.getAppliedStereotypes()) {
			if(st.getName().equals("DataFlowPort")){
				isInOut= ((EnumerationLiteral)e.getValue(st, "direction")).getName().equals("inout");				
			}
		}
//		if(!e.getAppliedStereotypes().isEmpty()){
//			DataFlowPort f = UMLUtil.getStereotypeApplication(e, DataFlowPort.class);
//			if(f!=null){isInOut=f.getDirection().equals(DataFlowDirectionKind.INOUT);}
//		}
		return isInOut;
	}
 
开发者ID:bmaggi,项目名称:Eclipse-Gendoc-Templates,代码行数:15,代码来源:RobotML_Queries.java


示例10: getStringRepresentation

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
public static String getStringRepresentation(Object obj) {
	String value = "";
	if(obj instanceof EnumerationLiteral) {
		value = ((EnumerationLiteral) obj).getName();
	} else if(obj instanceof PrimitiveType) {
		// TODO: CHECK!
		value = ((PrimitiveType) obj).toString();
	} else if(obj instanceof LiteralString) {
		value = ((LiteralString) obj).getValue();
	} else {
		value = obj.toString();
	}
	return value;
}
 
开发者ID:alexander-bergmayr,项目名称:caml2tosca,代码行数:15,代码来源:ToscaUtil.java


示例11: createFigure

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
protected IFigure createFigure() {
    NotationNode literalModel = (NotationNode) getModel();
    EnumerationLiteral enumerationLiteral = (EnumerationLiteral) literalModel.getUmlModel();
    Image image = UiCorePlugin.getDefault().getImageForUMLElement(enumerationLiteral);
    label = new Label(enumerationLiteral.getName(), image);
    label.setForegroundColor(ColorConstants.black);
    label.setBorder(new MarginBorders(0, 5, 0, 0));
    label.setToolTip(new Label(label.getText()));

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


示例12: refreshVisuals

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
 */
@Override
protected void refreshVisuals() {
    try {
        NotationNode literalModel = (NotationNode) getModel();
        EnumerationLiteral enumerationLiteral = (EnumerationLiteral) literalModel.getUmlModel();
        Image image = UiCorePlugin.getDefault().getImageForUMLElement(enumerationLiteral);
        label.setIcon(image);
        label.setText(enumerationLiteral.getLabel());
        label.setToolTip(new Label(label.getText()));

    } catch (Exception e) {
        Log.error("AttributeEditPart refreshVisuals() Error " + e);
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:18,代码来源:EnumerationLiteralEditPart.java


示例13: getModelChildren

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractEditPart#getModelChildren()
 */
@SuppressWarnings("unchecked")
@Override
protected List getModelChildren() {

    NotationNode literals = (NotationNode) this.getModel();
    Element element = literals.getUmlModel();
    if (element == null) {
        element = ((AbstractNode) literals.getParent()).getUmlModel();
    }
    EList<EnumerationLiteral> literalList;
    if (element instanceof Enumeration) {
        literalList = ((Enumeration) element).getOwnedLiterals();
    } else {
        return null;
    }

    List<NotationNode> list = new ArrayList<NotationNode>();
    for (EnumerationLiteral enumerationLiteral : literalList) {

        NotationNode literalModel = UMLDiagramFactory.eINSTANCE.createNotationNode();
        literalModel.setNodeType(NodeType.ENUMERATION_LITERAL);
        literalModel.setParent(literals);
        literalModel.setUmlModel(enumerationLiteral);

        list.add(literalModel);
    }
    return list;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:32,代码来源:EnumerationLiteralsEditPart.java


示例14: getType

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
private EnumerationLiteral getType(Property p, String type) {
    if ((type.equals(UICoreConstant.EXCEL_IO_IMPORT_TYPE_INT16))
        || (type.equals(UICoreConstant.EXCEL_IO_IMPORT_TYPE_INTEGER))) {
        type = UICoreConstant.EXCEL_IO_IMPORT_TYPE_INT;
    }

    if (type.equals(UICoreConstant.EXCEL_IO_IMPORT_TYPE_BIG_DECIMAL)) {
        type = UICoreConstant.EXCEL_IO_IMPORT_TYPE_DECIMAL;
    }

    if (type.equals(UICoreConstant.EXCEL_IO_IMPORT_TYPE_BYTE_ARRAY)) {
        type = UICoreConstant.EXCEL_IO_IMPORT_TYPE_BINARY;
    }

    EnumerationLiteral value = null;
    Object[] enumerationList = ((Enumeration) ((Property) p).getType()).getOwnedLiterals().toArray();

    for (Object enumeration : enumerationList) {
        EnumerationLiteral e = (EnumerationLiteral) enumeration;
        if (e.getName().equals(type)) {
            value = e;
        }
    }

    return value;

    // byteArray, varString => 없음 (default : string으로 함)
    // int16, integer => int
    // string,long,float,double,decimal,varBinary => 존재

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


示例15: removeLiteral

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
/**
 * 테이블 뷰어에서 선택된 하나 이상의 리터럴을 삭제.
 */
@SuppressWarnings("unchecked")
private void removeLiteral() {
    IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
    EList<EnumerationLiteral> literalList = null;
    if (getData() instanceof Enumeration) {
        literalList = ((Enumeration) getData()).getOwnedLiterals();
    }
    for (Iterator<EnumerationLiteral> iterator = selection.iterator(); iterator.hasNext();) {
        literalList.remove(iterator.next());
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:15,代码来源:LiteralSection.java


示例16: createLiteral

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
/**
 * 하나의 리터럴을 생성함.
 */
private void createLiteral() {
    uniqueName = (UMLManager.getPackagedUniqueName(this.getData(),
        UMLMessage.getMessage(UMLMessage.UML_ENUMERATIONLITERAL)));
    EnumerationLiteral literal = UMLHelper.createEnumerationLiteral();
    literal.setName(uniqueName);
    if (getData() instanceof Enumeration) {
        ((Enumeration) getData()).getOwnedLiterals().add(literal);
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:13,代码来源:LiteralSection.java


示例17: getColumnText

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
/**
 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
 *      int)
 */
public String getColumnText(Object element, int columnIndex) {
    String result = ""; //$NON-NLS-1$

    if (element != null) {
        if (element instanceof EnumerationLiteral) {
            switch (columnIndex) {
                case 0:
                    break;
                case 1:
                    result = ((EnumerationLiteral) element).getName();
                    break;
                default:
                    break;
            }
        } else if (element instanceof EEnumLiteral) {
            switch (columnIndex) {
                case 0:
                    break;
                case 1:
                    result = ((EEnumLiteral) element).getName();
                    break;
                default:
                    break;
            }
        }
    }

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


示例18: getElements

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
/**
 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
 */
public Object[] getElements(Object inputElement) {
    List<EnumerationLiteral> literalList;
    if (inputElement instanceof Enumeration) {
        literalList = ((Enumeration) inputElement).getOwnedLiterals();
        List<Object> objectList = new ArrayList<Object>();
        for (int i = 0; i < literalList.size(); i++) {
            objectList.add(literalList.get(i));
        }
        return objectList.toArray();
    }
    return null;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:16,代码来源:LiteralSectionContentProvider.java


示例19: createEnumerationModel

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
private FHIMInformationModel.Enumeration createEnumerationModel(Enumeration enumeration) {
    String name = enumeration.getName();
    FHIMInformationModel.Enumeration enumerationModel = new FHIMInformationModel.Enumeration(name);

    EList<EnumerationLiteral> literals = enumeration.getOwnedLiterals();
    for (EnumerationLiteral literal : literals) {
        String literalName = literal.getName();
        LOG.debug("    literal: " + literalName);
        enumerationModel.addLiteral(literalName);
    }
    return enumerationModel;
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:13,代码来源:UML2ModelConverter.java


示例20: caseAClassAttributeIdentifierExpression

import org.eclipse.uml2.uml.EnumerationLiteral; //导入依赖的package包/类
@Override
public void caseAClassAttributeIdentifierExpression(AClassAttributeIdentifierExpression node) {
    String typeIdentifier = TextUMLCore.getSourceMiner().getQualifiedIdentifier(node.getMinimalTypeIdentifier());
    Classifier targetClassifier = (Classifier) getRepository().findNamedElement(typeIdentifier,
            IRepository.PACKAGE.getClassifier(), namespaceTracker.currentNamespace(null));
    if (targetClassifier == null) {
        problemBuilder.addError("Class reference expected: '" + typeIdentifier + "'",
                node.getMinimalTypeIdentifier());
        throw new AbortedStatementCompilationException();
    }
    String attributeIdentifier = TextUMLCore.getSourceMiner().getIdentifier(node.getIdentifier());
    Property attribute = FeatureUtils.findAttribute(targetClassifier, attributeIdentifier, false, true);
    if (attribute != null) {
        buildReadStaticStructuralFeature(targetClassifier, attribute, node);
        return;
    }
    if (targetClassifier instanceof Enumeration) {
        EnumerationLiteral enumerationValue = ((Enumeration) targetClassifier).getOwnedLiteral(attributeIdentifier);
        if (enumerationValue != null) {
            InstanceValue valueSpec = (InstanceValue) namespaceTracker.currentPackage().createPackagedElement(null,
                    IRepository.PACKAGE.getInstanceValue());
            valueSpec.setInstance(enumerationValue);
            valueSpec.setType(targetClassifier);
            buildValueSpecificationAction(valueSpec, node);
            return;
        }
    }
    if (targetClassifier instanceof StateMachine) {
        Vertex state = StateMachineUtils.getState((StateMachine) targetClassifier, attributeIdentifier);
        if (state != null) {
            ValueSpecification stateReference = MDDExtensionUtils.buildVertexLiteral(
                    namespaceTracker.currentPackage(), state);
            buildValueSpecificationAction(stateReference, node);
            return;
        }
    }
    problemBuilder.addProblem(new UnknownAttribute(targetClassifier.getName(), attributeIdentifier, true),
            node.getIdentifier());
    throw new AbortedStatementCompilationException();
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:41,代码来源:BehaviorGenerator.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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