本文整理汇总了Java中org.eclipse.uml2.uml.Type类的典型用法代码示例。如果您正苦于以下问题:Java Type类的具体用法?Java Type怎么用?Java Type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Type类属于org.eclipse.uml2.uml包,在下文中一共展示了Type类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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());
}
});
}
}
示例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;
}
}
示例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();
}
}
示例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);
}
示例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 "";
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}