本文整理汇总了Java中org.eclipse.uml2.uml.Enumeration类的典型用法代码示例。如果您正苦于以下问题:Java Enumeration类的具体用法?Java Enumeration怎么用?Java Enumeration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Enumeration类属于org.eclipse.uml2.uml包,在下文中一共展示了Enumeration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: parentIsEnumerationAndDo
import org.eclipse.uml2.uml.Enumeration; //导入依赖的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.Enumeration; //导入依赖的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.Enumeration; //导入依赖的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: generateElementsToBeAdded
import org.eclipse.uml2.uml.Enumeration; //导入依赖的package包/类
/**
* Returns the types of elements that are to be added
* @return Returns the types of elements that are to be added
*/
private List<java.lang.Class<? extends Element>> generateElementsToBeAdded() {
List<java.lang.Class<? extends Element>> nodes = new LinkedList<>(Arrays.asList(
Class.class,
Component.class,
DataType.class,
Enumeration.class,
InformationItem.class,
InstanceSpecification.class,
Interface.class,
Model.class,
Package.class,
PrimitiveType.class
));
if(PreferencesManager.getBoolean(PreferencesManager.CLASS_DIAGRAM_CONSTRAINT_PREF))
nodes.add(Constraint.class);
if(PreferencesManager.getBoolean(PreferencesManager.CLASS_DIAGRAM_COMMENT_PREF))
nodes.add(Comment.class);
if(PreferencesManager.getBoolean(PreferencesManager.CLASS_DIAGRAM_SIGNAL_PREF))
nodes.add(Signal.class);
return nodes;
}
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:28,代码来源:ClassDiagramElementsManager.java
示例5: renderObject
import org.eclipse.uml2.uml.Enumeration; //导入依赖的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.Enumeration; //导入依赖的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: remove
import org.eclipse.uml2.uml.Enumeration; //导入依赖的package包/类
public static void remove(final Element element) {
final Collection<EObject> theStereotypeApplications = new ArrayList<>();
theStereotypeApplications.addAll(element.getStereotypeApplications());
final TreeIterator<EObject> contents = EcoreUtil.getAllProperContents(element, true);
while (contents.hasNext()) {
final EObject next = contents.next();
if (next instanceof Element) {
theStereotypeApplications.addAll(((Element) next).getStereotypeApplications());
}
}
for (final EObject theStereotypeApplication : theStereotypeApplications) {
getBaseElement(theStereotypeApplication).unapplyStereotype(getStereotype(theStereotypeApplication));
}
getMany(UMLPackage.Literals.ENUMERATION__OWNED_LITERAL,
EcoreExt.<Enumeration> get(UMLPackage.Literals.ENUMERATION_LITERAL__ENUMERATION, element)).remove(element);
element.destroy();
}
开发者ID:GRA-UML,项目名称:tool,代码行数:18,代码来源:UMLExt.java
示例8: visit
import org.eclipse.uml2.uml.Enumeration; //导入依赖的package包/类
@Override
public boolean visit(EnumDeclaration enumDeclaration) {
if (enumDeclaration.isPackageMemberTypeDeclaration()) {
if (currentPackage != null) {
String identifier = enumDeclaration.getName().getIdentifier();
if (currentPackage.getPackagedElement(identifier) == null) {
Enumeration enumeration = currentPackage.createOwnedEnumeration(identifier);
currentClassifier = enumeration;
@SuppressWarnings("rawtypes")
List enumConstants = enumDeclaration.enumConstants();
for (Object object : enumConstants) {
if (object instanceof EnumConstantDeclaration) {
EnumConstantDeclaration enumConstantDeclaration = (EnumConstantDeclaration)object;
enumeration.createOwnedLiteral(enumConstantDeclaration.getName().getIdentifier());
}
}
}
}
}
return super.visit(enumDeclaration);
}
开发者ID:hmarchadour,项目名称:2uml,代码行数:23,代码来源:CompilationUnitASTVisitor.java
示例9: category
import org.eclipse.uml2.uml.Enumeration; //导入依赖的package包/类
/**
* @see org.eclipse.jface.viewers.ViewerComparator#category(java.lang.Object)
*/
@Override
public int category(Object object) {
int base = 0;
if (object instanceof ITreeNode) {
object = ((ITreeNode) object).getEObject();
}
if (object instanceof Diagram) {
return base + 2;
} else if (object instanceof Collaboration) {
return base + 5;
} else if (object instanceof org.eclipse.uml2.uml.Package) {
return base + 10;
} else if (object instanceof org.eclipse.uml2.uml.Class) {
return base + 20;
} else if (object instanceof Interface) {
return base + 30;
} else if (object instanceof DataType) {
return base + 40;
} else if (object instanceof Enumeration) {
return base + 50;
} else if (object instanceof Actor) {
return base + 60;
} else if (object instanceof UseCase) {
return base + 70;
} else if (object instanceof Property) {
return base + 80;
} else if (object instanceof Operation) {
return base + 90;
} else {
return super.category(object);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:37,代码来源:UMLSorter.java
示例10: category
import org.eclipse.uml2.uml.Enumeration; //导入依赖的package包/类
/**
* @see org.eclipse.jface.viewers.ViewerComparator#category(java.lang.Object)
*/
@Override
public int category(Object object) {
int base = 0;
if (object instanceof ITreeNode) {
EObject eobject = ((ITreeNode) object).getEObject();
if (eobject instanceof Diagram) {
return base + 2;
} else if (eobject instanceof Collaboration) {
return base + 5;
} else if (eobject instanceof org.eclipse.uml2.uml.Package) {
return base + 10;
} else if (eobject instanceof org.eclipse.uml2.uml.Class) {
return base + 20;
} else if (eobject instanceof Interface) {
return base + 30;
} else if (eobject instanceof DataType) {
return base + 40;
} else if (eobject instanceof Enumeration) {
return base + 50;
} else if (eobject instanceof Actor) {
return base + 60;
} else if (eobject instanceof UseCase) {
return base + 70;
} else {
return 100;
}
} else {
return super.category(object);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:35,代码来源:NameSorter.java
示例11: execute
import org.eclipse.uml2.uml.Enumeration; //导入依赖的package包/类
/**
* UML 요소가 복사할 수 있는지 체크하거나 복사 후 결과값을 반환
* @param parent UML 요소를 붙여 넣을 부모
* @param copied 복사된 UML 요소
* @param original 원본 UML 요소
* @param something 복사할 것인지 복사 가능여부만 체크할 것인지 결정하는 플래그
* @return boolean 복사 성공 여부를 반환
*/
// 패턴화 대상
private static boolean execute(EObject parent, EObject copied, EObject original, int something) {
if (parent instanceof Package)
return parentIsPackageAndDo(parent, copied, original, something);
else if (parent instanceof Operation)
return parentIsOperationAndDo(parent, copied, original, something);
else if (parent instanceof Interaction) // Class 보다 먼저 검사해야 함
return parentIsInteractionAndDo(parent, copied, original, something);
else if (parent instanceof Component) // Class 보다 먼저 검사해야 함
return parentIsComponentAndDo(parent, copied, original, something);
else if (parent instanceof Activity) // Class 보다 먼저 검사해야 함
return parentIsActivityAndDo(parent, copied, original, something);
else if (parent instanceof Class)
return parentIsClassAndDo(parent, copied, original, something);
else if (parent instanceof Collaboration)
return parentIsCollaborationAndDo(parent, copied, original, something);
else if (parent instanceof Artifact)
return parentIsArtifactAndDo(parent, copied, original, something);
else if (parent instanceof Enumeration)
return parentIsEnumerationAndDo(parent, copied, original, something);
else if (parent instanceof Interface)
return parentIsInterfaceAndDo(parent, copied, original, something);
else if (parent instanceof Signal)
return parentIsSignalAndDo(parent, copied, original, something);
return false;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:36,代码来源:ElementCopier.java
示例12: parentIsInterfaceAndDo
import org.eclipse.uml2.uml.Enumeration; //导入依赖的package包/类
/**
* 상위 부모가 Interface 요소이고 자식 요소가 해당 Interface에
* 속한다면 붙이기를 수행한다.
* @param parent UML 요소를 붙여 넣을 부모
* @param copied 복사된 UML 요소
* @param original 원본 UML 요소
* @param something 복사할 것인지 복사 가능여부만 체크할 것인지 결정하는 플래그
* @return boolean 부모로 복사 성공 여부
*/
private static boolean parentIsInterfaceAndDo(EObject parent, EObject copied, EObject original, int something) {
boolean result = false;
Interface interfaze = (Interface) parent;
if (copied instanceof Property) {
if (something == COPY) interfaze.getOwnedAttributes().add((Property) copied);
result = true;
} else if (copied instanceof Operation) {
if (something == COPY) interfaze.getOwnedOperations().add((Operation) copied);
result = true;
} else if (copied instanceof Reception) {
if (something == COPY) interfaze.getOwnedReceptions().add((Reception) copied);
result = true;
} else if (copied instanceof Class) {
if (something == COPY) interfaze.getNestedClassifiers().add((Class) copied);
result = true;
} else if (copied instanceof Enumeration) {
if (something == COPY) interfaze.getNestedClassifiers().add((Enumeration) copied);
result = true;
} else if (copied instanceof Collaboration) {
if (something == COPY) interfaze.getNestedClassifiers().add((Collaboration) copied);
result = true;
} else if (copied instanceof CollaborationUse) {
if (something == COPY) interfaze.getCollaborationUses().add((CollaborationUse) copied);
result = true;
}
if (result && something == COPY) applyStereotypes(parent, copied, original);
return result;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:47,代码来源:ElementCopier.java
示例13: getModelChildren
import org.eclipse.uml2.uml.Enumeration; //导入依赖的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: category
import org.eclipse.uml2.uml.Enumeration; //导入依赖的package包/类
/**
* @see org.eclipse.jface.viewers.ViewerComparator#category(java.lang.Object)
*/
@Override
public int category(Object object) {
int base = 0;
if (object instanceof ITreeNode) {
EObject eobject = ((ITreeNode) object).getEObject();
if (eobject instanceof Diagram) {
return base + 2;
} else if (eobject instanceof Collaboration) {
return base + 5;
} else if (eobject instanceof org.eclipse.uml2.uml.Package) {
return base + 10;
} else if (eobject instanceof org.eclipse.uml2.uml.Class) {
return base + 20;
} else if (eobject instanceof Interface) {
return base + 30;
} else if (eobject instanceof DataType) {
return base + 40;
} else if (eobject instanceof Enumeration) {
return base + 50;
} else if (eobject instanceof Actor) {
return base + 60;
} else if (eobject instanceof UseCase) {
return base + 70;
} else if (eobject instanceof Property) {
return base + 80;
} else if (eobject instanceof Operation) {
return base + 90;
} else {
return 100;
}
} else if (object instanceof ClosedTreeNode) {
return 100;
} else {
return super.category(object);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:41,代码来源:ExplorerSorter.java
示例15: getType
import org.eclipse.uml2.uml.Enumeration; //导入依赖的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
示例16: removeLiteral
import org.eclipse.uml2.uml.Enumeration; //导入依赖的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
示例17: createLiteral
import org.eclipse.uml2.uml.Enumeration; //导入依赖的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
示例18: getElements
import org.eclipse.uml2.uml.Enumeration; //导入依赖的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: createEnumeration
import org.eclipse.uml2.uml.Enumeration; //导入依赖的package包/类
private Enumeration createEnumeration(Package pkg, FHIMInformationModel.Enumeration enumerationModel) {
String name = enumerationModel.getName();
Enumeration enumeration = pkg.createOwnedEnumeration(name);
LOG.debug("Enumeration: " + enumeration.getName());
// EnumerationLiterals.
for (String literal : enumerationModel.getLiterals()) {
createEnumerationLiteral(enumeration, literal);
}
return enumeration;
}
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:14,代码来源:Model2UMLConverter.java
示例20: createEnumerationModel
import org.eclipse.uml2.uml.Enumeration; //导入依赖的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
注:本文中的org.eclipse.uml2.uml.Enumeration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论