本文整理汇总了Java中org.eclipse.uml2.uml.DataType类的典型用法代码示例。如果您正苦于以下问题:Java DataType类的具体用法?Java DataType怎么用?Java DataType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataType类属于org.eclipse.uml2.uml包,在下文中一共展示了DataType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: removeOperation
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
/**
* 테이블 뷰어에서 선택된 하나 이상의 오퍼레이션을 삭제.
*/
@SuppressWarnings("unchecked")
private void removeOperation() {
IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
EList<Operation> operationList = null;
if (getData() instanceof org.eclipse.uml2.uml.Class) {
operationList = ((org.eclipse.uml2.uml.Class) getData()).getOwnedOperations();
} else if (getData() instanceof Interface) {
operationList = ((Interface) getData()).getOwnedOperations();
} else if (getData() instanceof DataType) {
operationList = ((DataType) getData()).getOwnedOperations();
}
for (Iterator<Operation> iterator = selection.iterator(); iterator.hasNext();) {
operationList.remove(iterator.next());
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:19,代码来源:OperationSection.java
示例2: upperOperation
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
/**
* 테이블 뷰어에서 선택된 하나 이상의 오퍼레이션을 위로 이동.
*/
@SuppressWarnings("unchecked")
private void upperOperation() {
IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
EList<Operation> operationList = null;
if (getData() instanceof org.eclipse.uml2.uml.Class) {
operationList = ((org.eclipse.uml2.uml.Class) getData()).getOwnedOperations();
} else if (getData() instanceof Interface) {
operationList = ((Interface) getData()).getOwnedOperations();
} else if (getData() instanceof DataType) {
operationList = ((DataType) getData()).getOwnedOperations();
}
int index = 0;
for (Iterator<Operation> iterator = selection.iterator(); iterator.hasNext();) {
Operation next = iterator.next();
index = operationList.indexOf(next);
if (index > 0)
operationList.move(index - 1, next);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:23,代码来源:OperationSection.java
示例3: downOperation
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
/**
* 테이블 뷰어에서 선택된 하나 이상의 오퍼레이션을 아래로 이동.
*/
@SuppressWarnings("unchecked")
private void downOperation() {
IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
EList<Operation> operationList = null;
if (getData() instanceof org.eclipse.uml2.uml.Class) {
operationList = ((org.eclipse.uml2.uml.Class) getData()).getOwnedOperations();
} else if (getData() instanceof Interface) {
operationList = ((Interface) getData()).getOwnedOperations();
} else if (getData() instanceof DataType) {
operationList = ((DataType) getData()).getOwnedOperations();
}
int index = 0;
for (Iterator<Operation> iterator = selection.iterator(); iterator.hasNext();) {
Operation next = iterator.next();
index = operationList.indexOf(next);
if (index < operationList.size() - 1)
operationList.move(index + 1, next);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:23,代码来源:OperationSection.java
示例4: removeAttribute
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
/**
* 테이블 뷰어에서 선택된 하나 이상의 속성을 삭제.
*/
@SuppressWarnings("unchecked")
private void removeAttribute() {
IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
EList<Property> attributeList = null;
if (getData() instanceof StructuredClassifier) {
attributeList = ((StructuredClassifier) getData()).getOwnedAttributes();
} else if (getData() instanceof Interface) {
attributeList = ((Interface) getData()).getOwnedAttributes();
} else if (getData() instanceof DataType) {
attributeList = ((DataType) getData()).getOwnedAttributes();
} else if (getData() instanceof Signal) {
attributeList = ((Signal) getData()).getOwnedAttributes();
}
for (Iterator<Property> iterator = selection.iterator(); iterator.hasNext();) {
attributeList.remove(iterator.next());
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:21,代码来源:AttributeSection.java
示例5: upperAttribute
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
/**
* 선택된 Attribute를 위로 이동
*/
@SuppressWarnings("unchecked")
private void upperAttribute() {
IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
EList<Property> attributeList = null;
if (getData() instanceof StructuredClassifier) {
attributeList = ((StructuredClassifier) getData()).getOwnedAttributes();
} else if (getData() instanceof Interface) {
attributeList = ((Interface) getData()).getOwnedAttributes();
} else if (getData() instanceof DataType) {
attributeList = ((DataType) getData()).getOwnedAttributes();
} else if (getData() instanceof Signal) {
attributeList = ((Signal) getData()).getOwnedAttributes();
}
int index = 0;
for (Iterator<Property> iterator = selection.iterator(); iterator.hasNext();) {
Property next = iterator.next();
index = attributeList.indexOf(next);
if (index > 0)
attributeList.move(index - 1, next);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:25,代码来源:AttributeSection.java
示例6: downAttribute
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
/**
* 선택된 Attribute를 아래로 이동
*/
@SuppressWarnings("unchecked")
private void downAttribute() {
IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
EList<Property> attributeList = null;
if (getData() instanceof StructuredClassifier) {
attributeList = ((StructuredClassifier) getData()).getOwnedAttributes();
} else if (getData() instanceof Interface) {
attributeList = ((Interface) getData()).getOwnedAttributes();
} else if (getData() instanceof DataType) {
attributeList = ((DataType) getData()).getOwnedAttributes();
} else if (getData() instanceof Signal) {
attributeList = ((Signal) getData()).getOwnedAttributes();
}
int index = 0;
for (Iterator<Property> iterator = selection.iterator(); iterator.hasNext();) {
Property next = iterator.next();
index = attributeList.indexOf(next);
if (index < attributeList.size() - 1)
attributeList.move(index + 1, next);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:25,代码来源:AttributeSection.java
示例7: generateElementsToBeAdded
import org.eclipse.uml2.uml.DataType; //导入依赖的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
示例8: Uml2ToCppExporter
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
public Uml2ToCppExporter(List<Element> modelRoot, Pair<RuntimeType, Map<String, ThreadPoolConfiguration>> config,
boolean addRuntimeOption, boolean overWriteMainFileOption, Boolean testing) {
this.modelRoot = modelRoot;
classExporter = new ClassExporter();
classExporter.setTesting(testing);
dataTypeExporter = new DataTypeExporter();
abstractOperationExporter = new OnlyAbstractOperationExporter();
threadManager = new ThreadHandlingManager(config);
classes = new ArrayList<Class>();
dataTypes = new ArrayList<DataType>();
classNames = new LinkedList<String>();
stateMachineOwners = new HashSet<String>();
options = new Options(addRuntimeOption, overWriteMainFileOption);
CppExporterUtils.getTypedElements(dataTypes, UMLPackage.Literals.DATA_TYPE, modelRoot);
classes = CppExporterUtils.getAllModelCLass(modelRoot);
}
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:21,代码来源:Uml2ToCppExporter.java
示例9: renderObject
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
public boolean renderObject(DataType dataType, IndentedPrintWriter writer, IRenderingSession context) {
RenderingUtils.renderAll(context, ElementUtils.getComments(dataType));
TextUMLRenderingUtils.renderStereotypeApplications(writer, dataType);
if (dataType.isAbstract())
writer.print("abstract ");
writer.print("datatype " + name(dataType));
List<Generalization> generalizations = dataType.getGeneralizations();
StringBuilder specializationList = new StringBuilder();
for (Generalization generalization : generalizations)
specializationList.append(TextUMLRenderingUtils.getQualifiedNameIfNeeded(generalization.getGeneral(),
dataType.getNamespace()) + ", ");
if (specializationList.length() > 0) {
specializationList.delete(specializationList.length() - 2, specializationList.length());
writer.print(" specializes ");
writer.print(specializationList);
}
writer.println();
writer.enterLevel();
RenderingUtils.renderAll(context, dataType.getOwnedAttributes());
RenderingUtils.renderAll(context, dataType.getOwnedOperations());
writer.exitLevel();
writer.println("end;");
writer.println();
return true;
}
开发者ID:abstratt,项目名称:textuml,代码行数:26,代码来源:DataTypeRenderer.java
示例10: getSubSystem
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
static public List<NamedElement> getSubSystem(Classifier c){
LinkedList<NamedElement> sub_syst_found = new LinkedList<NamedElement>();
for(Property prop : c.getAllAttributes()){
if((prop.getType() instanceof Classifier) && !(prop instanceof Port) && !( prop.getType() instanceof DataType)){
sub_syst_found.add((NamedElement)prop);
}
}
return sub_syst_found;
}
开发者ID:bmaggi,项目名称:Eclipse-Gendoc-Templates,代码行数:10,代码来源:RobotML_Queries.java
示例11: displayNamedElement
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
static public String displayNamedElement(NamedElement e){
String s="";
if(e instanceof org.eclipse.uml2.uml.Port){
//afficher port
s+="Port ";
for(Stereotype st : e.getAppliedStereotypes())
s+=e.getValue(st, "direction");
s+=" : ";
s+=((Property)e).getType().getName();
s+=" : ";
s+=e.getName();
}else if(((Property)e).getType() instanceof org.eclipse.uml2.uml.DataType){
//afficher attribut
s+="DataType : ";
s+=e.getName() + " : ";
s+=((Property)e).getType().getName();
}
else if(((Property) e).getType() instanceof org.eclipse.uml2.uml.Class){
//afficher sous systeme
s+="Sub System : ";
s+=e.getName();
s+=" : ";
s+=((Property)e).getType().getName();
}
return s;
}
开发者ID:bmaggi,项目名称:Eclipse-Gendoc-Templates,代码行数:28,代码来源:RobotML_Queries.java
示例12: setProperty
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
/**
* setProperty
*
* @param parent
* @param property void
*/
private static void setProperty(NamedElement parent, Property property) {
if (parent instanceof StructuredClassifier) {
((StructuredClassifier) parent).getOwnedAttributes().add(property);
} else if (parent instanceof Interface) {
((Interface) parent).getOwnedAttributes().add(property);
} else if (parent instanceof Artifact) {
((Artifact) parent).getOwnedAttributes().add(property);
} else if (parent instanceof DataType) {
((DataType) parent).getOwnedAttributes().add(property);
} else if (parent instanceof Signal) {
((Signal) parent).getOwnedAttributes().add(property);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:20,代码来源:UMLManager.java
示例13: category
import org.eclipse.uml2.uml.DataType; //导入依赖的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
示例14: category
import org.eclipse.uml2.uml.DataType; //导入依赖的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
示例15: getModelChildren
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
/**
* @see org.eclipse.gef.editparts.AbstractEditPart#getModelChildren()
*/
@SuppressWarnings("unchecked")
@Override
protected List getModelChildren() {
NotationNode propertiesModel = (NotationNode) this.getModel();
Element element = propertiesModel.getUmlModel();
if (element == null) {
element = ((AbstractNode) propertiesModel.getParent()).getUmlModel();
}
EList<Property> propertyList;
if (element instanceof StructuredClassifier) {
propertyList = ((StructuredClassifier) element).getOwnedAttributes();
} else if (element instanceof Interface) {
propertyList = ((Interface) element).getOwnedAttributes();
} else if (element instanceof DataType) {
propertyList = ((DataType) element).getOwnedAttributes();
} else if (element instanceof Signal) {
propertyList = ((Signal) element).getOwnedAttributes();
} else {
return null;
}
List<NotationNode> list = new ArrayList<NotationNode>();
for (Property property : propertyList) {
if (null == property.getAssociation()) {
NotationNode propertyModel = UMLDiagramFactory.eINSTANCE.createNotationNode();
propertyModel.setNodeType(NodeType.ATTRIBUTE);
propertyModel.setParent(propertiesModel);
propertyModel.setUmlModel(property);
list.add(propertyModel);
}
}
return list;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:40,代码来源:AttributesEditPart.java
示例16: getModelChildren
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
/**
* @see org.eclipse.gef.editparts.AbstractEditPart#getModelChildren()
*/
@SuppressWarnings("unchecked")
@Override
protected List getModelChildren() {
NotationNode operationsModel = (NotationNode) this.getModel();
Element element = operationsModel.getUmlModel();
if (element == null) {
element = ((AbstractNode) operationsModel.getParent()).getUmlModel();
}
EList<Operation> operationList;
if (element instanceof org.eclipse.uml2.uml.Class) {
operationList = ((org.eclipse.uml2.uml.Class) element).getOwnedOperations();
} else if (element instanceof Interface) {
operationList = ((Interface) element).getOwnedOperations();
} else if (element instanceof DataType) {
operationList = ((DataType) element).getOwnedOperations();
} else if (element instanceof Component) {
operationList = ((Component) element).getOwnedOperations();
} else {
return null;
}
List<NotationNode> list = new ArrayList<NotationNode>();
for (Operation operation : operationList) {
NotationNode operationModel = UMLDiagramFactory.eINSTANCE.createNotationNode();
operationModel.setNodeType(NodeType.OPERATION);
operationModel.setParent(operationsModel);
operationModel.setUmlModel(operation);
list.add(operationModel);
}
return list;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:38,代码来源:OperationsEditPart.java
示例17: category
import org.eclipse.uml2.uml.DataType; //导入依赖的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
示例18: createOperation
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
/**
* 하나의 오퍼레이션을 생성함.
*/
private void createOperation() {
uniqueName = (UMLManager.getPackagedUniqueName(this.getData(), UMLMessage.getMessage(UMLMessage.UML_OPERATION)));
Operation operation = UMLHelper.createOperation();
operation.setName(uniqueName);
if (getData() instanceof org.eclipse.uml2.uml.Class) {
((org.eclipse.uml2.uml.Class) getData()).getOwnedOperations().add(operation);
} else if (getData() instanceof Interface) {
((Interface) getData()).getOwnedOperations().add(operation);
} else if (getData() instanceof DataType) {
((DataType) getData()).getOwnedOperations().add(operation);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:16,代码来源:OperationSection.java
示例19: createAttribute
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
/**
* 하나의 속성을 생성함.
*/
private void createAttribute() {
uniqueName = (UMLManager.getPackagedUniqueName(this.getData(), UMLMessage.getMessage(UMLMessage.UML_PROPERTY)));
Property property = UMLHelper.createProperty();
property.setName(uniqueName);
if (getData() instanceof StructuredClassifier) {
((StructuredClassifier) getData()).getOwnedAttributes().add(property);
} else if (getData() instanceof Interface) {
((Interface) getData()).getOwnedAttributes().add(property);
} else if (getData() instanceof DataType) {
((DataType) getData()).getOwnedAttributes().add(property);
} else if (getData() instanceof Signal) {
((Signal) getData()).getOwnedAttributes().add(property);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:18,代码来源:AttributeSection.java
示例20: testAttribute
import org.eclipse.uml2.uml.DataType; //导入依赖的package包/类
@Test
public void testAttribute() throws Exception {
Model model = model("hu.elte.txtuml.export.uml2.tests.models.attribute");
Class testClass = cls(model, "TestClass");
property(testClass, "byte_prim", "Integer");
property(testClass, "byte_boxed", "Integer");
property(testClass, "short_prim", "Integer");
property(testClass, "short_boxed", "Integer");
property(testClass, "int_prim", "Integer");
property(testClass, "int_boxed", "Integer");
property(testClass, "long_prim", "Integer");
property(testClass, "long_boxed", "Integer");
property(testClass, "bool_prim", "Boolean");
property(testClass, "bool_boxed", "Boolean");
property(testClass, "string", "String");
property(testClass, "dt", "Reals");
Property privateAttribute = property(testClass, "private_attribute", "Integer");
assertEquals(VisibilityKind.PRIVATE_LITERAL, privateAttribute.getVisibility());
Property protectedAttribute = property(testClass, "protected_attribute", "Integer");
assertEquals(VisibilityKind.PROTECTED_LITERAL, protectedAttribute.getVisibility());
Property publicAttribute = property(testClass, "public_attribute", "Integer");
assertEquals(VisibilityKind.PUBLIC_LITERAL, publicAttribute.getVisibility());
assertNull(testClass.getAttribute("external_attribute", null));
DataType reals = dataType(model, "Reals");
property(reals, "double_prim", "Real");
property(reals, "double_boxed", "Real");
property(reals, "float_prim", "Real");
property(reals, "float_boxed", "Real");
}
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:34,代码来源:TestStructure.java
注:本文中的org.eclipse.uml2.uml.DataType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论