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


Java Type.getName方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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 Entry) {
            String name = "";
            Lifeline lifeline = (Lifeline) ((Entry) element).getKey();
            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;
                }
            }
            
            AbstractConnection connection = (AbstractConnection) ((Entry) element).getValue();
            
            if(connection != null) {
                int order = orderedAllConnectionList.indexOf(connection) +1;
                name = name +  " (" + UMLMessage.LABEL_RELATED_MESSAGE + ": " + order + ":"+ ((Message) connection.getUmlModel()).getName() + ")";
            }
            
            return name;
        }
        return "";
    }
    
    return "";
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:35,代码来源:CoveredLifelineByMessageLabelProvider.java

示例5: getTypeFromInputPin

import org.eclipse.uml2.uml.Type; //导入方法依赖的package包/类
public String getTypeFromInputPin(InputPin inputPin) {
	Type type = inputPin.getType();
	String targetTypeName = "UNKNOWN_TARGET_TYPE_NAME";
	if (type != null) {
		targetTypeName = type.getName();
	} else if (inputPin.eClass().equals(UMLPackage.Literals.INPUT_PIN)) {
		targetTypeName = getTypeFromSpecialAcivityNode(inputPin.getIncomings().get(0).getSource());
	} else if (inputPin.eClass().equals(UMLPackage.Literals.VALUE_PIN)) {
		// ValueSpecification valueSpec = ((ValuePin) inputPin_).getValue();
	}
	return targetTypeName;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:13,代码来源:ActivityNodeResolver.java

示例6: createAttributeModel

import org.eclipse.uml2.uml.Type; //导入方法依赖的package包/类
private Attribute createAttributeModel(Property property) {
    String name = property.getName();
    LOG.debug("Attribute: " + name);

    // Attribute type.
    Type type = property.getType();
    String typeName = type.getName();
    FHIMInformationModel.Type typeModel = getTypeModel(typeName);

    Attribute attributeModel = new Attribute(name, typeModel);

    // Default value.
    ValueSpecification valueSpec = property.getDefaultValue();
    String defaultValue = (valueSpec != null ? valueSpec.stringValue() : null);
    if (defaultValue != null) {
        attributeModel.setDefaultValue(defaultValue);
    }

    // Multiplicity.
    int lower = property.getLower();
    int upper = property.getUpper();
    Multiplicity multiplicity = new Multiplicity(lower, upper);
    attributeModel.setMultiplicity(multiplicity);

    // Visibility.
    VisibilityKind visibility = property.getVisibility();
    attributeModel.setVisibility(visibility);

    return attributeModel;
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:31,代码来源:UML2ModelConverter.java

示例7: getQualifiedNameIfNeeded

import org.eclipse.uml2.uml.Type; //导入方法依赖的package包/类
public static String getQualifiedNameIfNeeded(final Type type, final Namespace namespace) {
    String typeReference;
    if (type != null && type.getName() != null) {
        typeReference = getQualifiedNameIfNeeded((NamedElement) type, namespace);
    } else
        typeReference = "any";
    return typeReference;
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:9,代码来源:TextUMLRenderingUtils.java

示例8: getTypeName

import org.eclipse.uml2.uml.Type; //导入方法依赖的package包/类
public static String getTypeName(Type type) {
    if (type == null)
        return "<any>";
    if (type.getName() != null)
        return type.getName();
    if (type instanceof Behavior)
        return computeSignatureName(type);
    if (MDDExtensionUtils.isSignature(type))
        return computeSignatureName(type);
    return "Unknown " + type.eClass().getName();
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:12,代码来源:MDDUtil.java

示例9: createLifeline

import org.eclipse.uml2.uml.Type; //导入方法依赖的package包/类
/**
 * Lifeline 생성
 * 
 * @param sourceInteraction
 * @param ruleSet
 */
private void createLifeline(Interaction sourceInteraction, MDADesignerTransformationData data) throws Exception {
    // 선택한 Source(분석모델)요소와 RuleSet이 존재하지 않는다면
    if (sourceInteraction == null || !SemanticModelHandlerUtil.isValid(data)) {
        return;
    }

    // String targetModelURI = ruleSet.getTargetModelLocation();
    Interaction targetInteraction = null;
    String lifelineName = null;
    List<Type> targetLifeLineTypeList = null;

    // Target(설계모델) 인터랙션 위치를 찾고
    // targetInteraction =
    // SemanticModelHandlerUtil.findTargetInteraction(data.getTargetModel(),
    // sourceInteraction);
    targetInteraction = SemanticModelHandlerUtil.findTargetInteraction(data.getTargetModelURI(), sourceInteraction);
    if (targetInteraction == null) {
        return;
    }

    for (Lifeline sourceLifeline : SemanticModelHandlerUtil.getLifelines(sourceInteraction)) {
        // null 확인
        if (sourceLifeline == null || sourceLifeline.getRepresents() == null) {
            return;
        }

        // Source Lifeline이 Target 으로 전개된 Type들을 가져와서
        targetLifeLineTypeList = SemanticModelHandlerUtil.getTargetLifeLineTypeList(sourceInteraction.eResource(), 
                sourceLifeline, data);

        // Type들이 존재한다면.
        if (targetLifeLineTypeList != null && targetLifeLineTypeList.size() > 0) {
            // 생성된 Target Type의 갯수만큼
            for (Type lifelineType : targetLifeLineTypeList) {
                lifelineName = lifelineType.getName();
                // BehaviorRule에 있는 경우에 대해서만 라이프라인 생성.
                if (existInTypeSet(typeSet, lifelineType) && targetInteraction != null && lifelineName != null
                    && lifelineType != null) {
                    // Target 인터랙션에 Lifeline을 추가
                    SemanticModelHandlerUtil.addLifeline(targetInteraction, lifelineName, lifelineType);
                }
            }
        }
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:52,代码来源:SemanticModelHandler.java

示例10: refreshVisuals

import org.eclipse.uml2.uml.Type; //导入方法依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
 */
@Override
public void refreshVisuals() {
    try {
        String strLifelineName = UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING;
        LifeLineNameHeader header = (LifeLineNameHeader) getModel();
        LifeLineNode lifeLineNode = header.getLifeLine();
        Lifeline lifeline = (Lifeline) lifeLineNode.getUmlModel();
        LifeLineNameHeaderFigure figure = (LifeLineNameHeaderFigure) getFigure();
        figure.setName(lifeline.getName());
        if (lifeline.getRepresents() != null) {
            Type type = lifeline.getRepresents().getType();
            if (type != null) {
                String stereoTypeName = ProjectUtil.getStereotypeLabel(type);
                String typeName = type.getName();
                //                if(stereoTypeName != null && !"".equals(stereoTypeName)) { //$NON-NLS-1$                 
                //                    figure.setName(stereoTypeName + figure.getName() + ":" + typeName); //$NON-NLS-1$                    
                // } else {
                //                    figure.setName(figure.getName() + ":" + typeName); //$NON-NLS-1$                    
                // }
                if (SequenceUtil.checkLifelineVisibility()) {
                    strLifelineName = figure.getName();
                } else {
                    strLifelineName = UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING;
                }
                if (stereoTypeName != null && !UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING.equals(stereoTypeName)) {                 
                    figure.setName(strLifelineName + UICoreConstant.PROJECT_CONSTANTS__COLON + typeName);
                    figure.setStereotype(stereoTypeName);
                } else {
                    figure.setName(strLifelineName + UICoreConstant.PROJECT_CONSTANTS__COLON + typeName);     
                    figure.setStereotype(UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING);
                }
            }
        }

        int verticalScrollPoint = 0;

        if (getParent() != null && getViewer() != null && getViewer().getControl() != null
            && ((FigureCanvas) getViewer().getControl()).getVerticalBar() != null) {
            verticalScrollPoint = ((FigureCanvas) getViewer().getControl()).getVerticalBar().getSelection();
        }

        if (header.isVisible()) {
            figure.setSize(lifeLineNode.getWidth(), FigureConstant.FIGURE_LIFELINE_HEAD_HEIGHT);
        } else {
            figure.setSize(0, 0);
        }

        figure.setLocation(new Point(lifeLineNode.getX(), verticalScrollPoint));

    } catch (Exception e) {
        Log.error(UMLMessage.MESSAGE_LIFELINE_NAME_HEADER_EDIT_PART_REFRESH_VISUALS_ERROR + e);
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:57,代码来源:LifeLineNameHeaderEditPart.java

示例11: refreshVisuals

import org.eclipse.uml2.uml.Type; //导入方法依赖的package包/类
/**
 * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
 */
@Override
protected void refreshVisuals() {
    try {
        String strLifelineName = UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING;
        NotationNode notationNode = (NotationNode) getParent().getModel();
        Lifeline lifeline = (Lifeline) notationNode.getUmlModel();
        LifeLineNameFigure figure = (LifeLineNameFigure) getFigure();

        List<Figure> figures = figure.getChildren();
        for (Figure childFigure : figures) {
            if (childFigure instanceof CollapsedLabel) {
                ((CollapsedLabel) childFigure).setText(UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING);
                ((CollapsedLabel) childFigure).repaint();
                
            } else if (childFigure instanceof Label) {
                ((Label) childFigure).setText(UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING);
            }
        }

        figure.setName(lifeline.getName());
        figure.setLocation(new Point(notationNode.getX(), notationNode.getY()));
        figure.setSize(notationNode.getWidth(), FigureConstant.FIGURE_LIFELINE_HEAD_HEIGHT);
        figure.getLabel()
            .setIcon(IConstantImageRegistry.eInstance.getSmallIcon(IConstantImageRegistry.ICONNAME_LIFELINE));
        figure.getLabel().setBackgroundColor(new Color(null, getFontColor()));
        figure.getLabel().setForegroundColor(new Color(null, getFontColor()));
        figure.getNameLabel2().setBackgroundColor(new Color(null, getFontColor()));
        figure.getNameLabel2().setForegroundColor(new Color(null, getFontColor()));
        figure.getStereoTypeLabel().setBackgroundColor(new Color(null, getFontColor()));
        figure.getStereoTypeLabel().setForegroundColor(new Color(null, getFontColor()));

        if (lifeline.getRepresents() != null) {
            Type type = lifeline.getRepresents().getType();

            if (type != null) {
                String stereoTypeName = ProjectUtil.getStereotypeLabel(type);
                String typeName = type.getName();
                if (type instanceof org.eclipse.uml2.uml.Component) {
                    figure.getLabel()
                        .setIcon(IConstantImageRegistry.eInstance.getSmallIcon(IConstantImageRegistry.ICONNAME_COMPONENT));
                } else if (type instanceof org.eclipse.uml2.uml.Class) {
                    figure.getLabel()
                        .setIcon(IConstantImageRegistry.eInstance.getSmallIcon(IConstantImageRegistry.ICONNAME_CLASS));
                } else if (type instanceof org.eclipse.uml2.uml.Actor) {
                    figure.getLabel()
                        .setIcon(IConstantImageRegistry.eInstance.getSmallIcon(IConstantImageRegistry.ICONNAME_ACTOR));
                } else if (type instanceof org.eclipse.uml2.uml.Interface) {
                    figure.getLabel()
                        .setIcon(IConstantImageRegistry.eInstance.getSmallIcon(IConstantImageRegistry.ICONNAME_INTERFACE));
                }

                if (SequenceUtil.checkLifelineVisibility()) {
                    strLifelineName = figure.getName();
                } else {
                    strLifelineName = UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING;
                }
                if (stereoTypeName != null && !UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING.equals(stereoTypeName)) {                 
                    figure.setName(strLifelineName + UICoreConstant.PROJECT_CONSTANTS__COLON + typeName);
                    figure.setStereotype(stereoTypeName);
                } else {
                    figure.setName(strLifelineName + UICoreConstant.PROJECT_CONSTANTS__COLON + typeName);     
                    figure.setStereotype(UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING);
                }
            }
        }

        getFigure().setBackgroundColor(new Color(null, getFillColor()));

    } catch (Exception e) {
        Log.error(UMLMessage.MESSAGE_LIFELINE_NAME_EDIT_PART_REFRESH_VISUALS_ERROR + e);
    }

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

示例12: findConverter

import org.eclipse.uml2.uml.Type; //导入方法依赖的package包/类
private static Converter findConverter(Type basicType) {
    String typeKey = basicType.getName();
    return converters.containsKey(typeKey) ? converters.get(typeKey) : NOOP_CONVERTER;
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:5,代码来源:BasicTypeUtils.java

示例13: isBasicType

import org.eclipse.uml2.uml.Type; //导入方法依赖的package包/类
public static boolean isBasicType(Type toCheck) {
    String typeKey = toCheck.getName();
    return converters.containsKey(typeKey) && IRepository.TYPES_NAMESPACE.equals(toCheck.getPackage().getName());
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:5,代码来源:BasicTypeUtils.java

示例14: isBlobType

import org.eclipse.uml2.uml.Type; //导入方法依赖的package包/类
public static boolean isBlobType(Type toCheck) {
    String typeKey = toCheck.getName();
    return converters.containsKey(typeKey) && IRepository.MEDIA_NAMESPACE.equals(toCheck.getPackage().getName());
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:5,代码来源:BasicTypeUtils.java


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