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