本文整理汇总了Java中org.eclipse.uml2.uml.Property.getUpperValue方法的典型用法代码示例。如果您正苦于以下问题:Java Property.getUpperValue方法的具体用法?Java Property.getUpperValue怎么用?Java Property.getUpperValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.uml2.uml.Property
的用法示例。
在下文中一共展示了Property.getUpperValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMultiplicity
import org.eclipse.uml2.uml.Property; //导入方法依赖的package包/类
/**
* 다중성 유형을 리턴.
*
* @param property
* @return String
*/
private String getMultiplicity(Property property) {
if (property.getUpperValue() != null && property.getLowerValue() != null) {
if (isSingleStar(property)) {
return MultiplicityType.SINGLE_STAR.toString();
} else if (isZeroToUnique(property)) {
return MultiplicityType.ZERO_TO_UNIQUE.toString();
} else if (isUnique(property)) {
return MultiplicityType.UNIQUE.toString();
} else if (isUniqueToSingleStar(property)) {
return MultiplicityType.UNIQUE_TO_SINGLE_STAR.toString();
} else {
// 숫자를 직접 입력한 경우
return property.getUpperValue().stringValue();
}
} else {
return MultiplicityType.UNIQUE.toString();
}
}
示例2: activate
import org.eclipse.uml2.uml.Property; //导入方法依赖的package包/类
/**
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#activate()
*/
public void activate() {
if (!isActive()) {
super.activate();
EObject model = (EObject) getModel();
model.eAdapters().add(adapter);
Element umlModel;
// AbstractConnection connection = (AbstractConnection) getModel();
// connection.getSource().eAdapters().add(classAdapter);
// connection.getTarget().eAdapters().add(classAdapter);
if (model instanceof Relation) {
model = ((AbstractConnection) getModel()).getUmlModel();
if (null != model) {
model.eAdapters().add(adapter);
Property property;
if (model instanceof Association) {
for (Iterator<Property> iter = ((Association) model).getMemberEnds().iterator(); iter.hasNext();) {
property = iter.next();
property.eAdapters().add(adapter);
if (property.getUpperValue() != null) {
property.getUpperValue().eAdapters().add(adapter);
}
if (property.getLowerValue() != null) {
property.getLowerValue().eAdapters().add(adapter);
}
}
}
model = ((AbstractConnection) getModel()).getSource();
model.eAdapters().add(adapter);
model = ((AbstractConnection) getModel()).getTarget();
model.eAdapters().add(adapter);
umlModel = ((Relation) getModel()).getUmlModel();
for (EAnnotation eAnnotation : ((Element) umlModel).getEAnnotations()) {
eAnnotation.eAdapters().add(adapter);
}
}
}
}
}
示例3: deactivate
import org.eclipse.uml2.uml.Property; //导入方法依赖的package包/类
/**
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#deactivate()
*/
public void deactivate() {
if (isActive()) {
super.deactivate();
EObject model = (EObject) getModel();
model.eAdapters().remove(adapter);
Element umlModel;
// AbstractConnection connection = (AbstractConnection) getModel();
// connection.getSource().eAdapters().remove(classAdapter);
// connection.getTarget().eAdapters().remove(classAdapter);
Property property;
if (model instanceof Relation) {
model = ((AbstractConnection) getModel()).getUmlModel();
if (null != model) {
model.eAdapters().remove(adapter);
if (model instanceof Association) {
for (Iterator<Property> iter = ((Association) model).getMemberEnds().iterator(); iter.hasNext();) {
property = iter.next();
property.eAdapters().remove(adapter);
if (property.getUpperValue() != null) {
property.getUpperValue().eAdapters().remove(adapter);
}
if (property.getLowerValue() != null) {
property.getLowerValue().eAdapters().remove(adapter);
}
}
}
model = ((AbstractConnection) getModel()).getSource();
model.eAdapters().remove(adapter);
model = ((AbstractConnection) getModel()).getTarget();
model.eAdapters().remove(adapter);
umlModel = ((Relation) getModel()).getUmlModel();
for (EAnnotation eAnnotation : ((Element) umlModel).getEAnnotations()) {
eAnnotation.eAdapters().remove(adapter);
}
}
}
}
}