本文整理汇总了Java中org.eclipse.uml2.uml.VisibilityKind类的典型用法代码示例。如果您正苦于以下问题:Java VisibilityKind类的具体用法?Java VisibilityKind怎么用?Java VisibilityKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VisibilityKind类属于org.eclipse.uml2.uml包,在下文中一共展示了VisibilityKind类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setElementInfo
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
* setElementInfo
* void
*/
private void setElementInfo() {
if (viewModel.getNodeType().equals(NodeType.ATTRIBUTE)) {
Property property = (Property) viewModel.getUmlModel();
if (newText.contains("-")) {
property.setVisibility(VisibilityKind.PRIVATE_LITERAL);
} else if (newText.contains("+")) {
property.setVisibility(VisibilityKind.PUBLIC_LITERAL);
} else if (newText.contains("~")) {
property.setVisibility(VisibilityKind.PACKAGE_LITERAL);
} else if (newText.contains("#")) {
property.setVisibility(VisibilityKind.PROTECTED_LITERAL);
}
} else if (viewModel.getNodeType().equals(NodeType.ATTRIBUTE)) {
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:23,代码来源:DirectEditCommand.java
示例2: setVisibility
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
*
* void
*/
private void setVisibility() {
if (this.get().equals(VisibilityKind.PUBLIC_LITERAL)) {
this.publicButton.setSelection(true);
this.privateButton.setSelection(false);
this.protectedButton.setSelection(false);
this.packageButton.setSelection(false);
} else if (this.get().equals(VisibilityKind.PRIVATE_LITERAL)) {
this.publicButton.setSelection(false);
this.privateButton.setSelection(true);
this.protectedButton.setSelection(false);
this.packageButton.setSelection(false);
} else if (this.get().equals(VisibilityKind.PROTECTED_LITERAL)) {
this.publicButton.setSelection(false);
this.privateButton.setSelection(false);
this.protectedButton.setSelection(true);
this.packageButton.setSelection(false);
} else if (this.get().equals(VisibilityKind.PACKAGE_LITERAL)) {
this.publicButton.setSelection(false);
this.privateButton.setSelection(false);
this.protectedButton.setSelection(false);
this.packageButton.setSelection(true);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:28,代码来源:TemplateRadioButtonSection.java
示例3: getOperationVisibility
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
* operation의 visibility를 UML 표기법에 따라 String으로 리턴한다.
*
* @param operation
* @return String
*/
public static String getOperationVisibility(Operation operation) {
String visibility = UICoreConstant.PROJECT_CONSTANTS__EMPTY_STRING;
VisibilityKind kind = operation.getVisibility();
if (VisibilityKind.PUBLIC_LITERAL.equals(kind)) {
visibility = "+";
} else if (VisibilityKind.PROTECTED_LITERAL.equals(kind)) {
visibility = "#";
} else if (VisibilityKind.PRIVATE_LITERAL.equals(kind)) {
visibility = "-";
} else if (VisibilityKind.PACKAGE_LITERAL.equals(kind)) {
visibility = "~";
}
return visibility;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:22,代码来源:SequenceUtil.java
示例4: eSet
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CmpPackage.PROPERTY__NAME:
setName((String)newValue);
return;
case CmpPackage.PROPERTY__VISIBILITY:
setVisibility((VisibilityKind)newValue);
return;
case CmpPackage.PROPERTY__STATIC:
setStatic((Boolean)newValue);
return;
case CmpPackage.PROPERTY__TYPE:
setType((Classifier)newValue);
return;
}
super.eSet(featureID, newValue);
}
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:24,代码来源:PropertyImpl.java
示例5: eSet
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CmpPackage.PORT__VISIBILITY:
setVisibility((VisibilityKind)newValue);
return;
case CmpPackage.PORT__REFERENCED_ELEMENT:
setReferencedElement((org.eclipse.uml2.uml.Port)newValue);
return;
case CmpPackage.PORT__REALIZED_CLASSIFIER:
setRealizedClassifier((de.cooperateproject.modeling.textual.component.cmp.Classifier<Classifier>)newValue);
return;
case CmpPackage.PORT__CONJUGATED:
setConjugated((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:25,代码来源:PortImpl.java
示例6: eSet
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ClsPackage.PROPERTY__NAME:
setName((String)newValue);
return;
case ClsPackage.PROPERTY__VISIBILITY:
setVisibility((VisibilityKind)newValue);
return;
case ClsPackage.PROPERTY__TYPE:
setType((Classifier)newValue);
return;
}
super.eSet(featureID, newValue);
}
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:21,代码来源:PropertyImpl.java
示例7: createAttributes
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
private String createAttributes(VisibilityKind modifyer) {
StringBuilder source = new StringBuilder("");
for (Property attribute : structuredElement.getOwnedAttributes()) {
if (attribute.getVisibility().equals(modifyer)) {
String type = UKNOWN_TYPE;
if (attribute.getType() != null) {
type = attribute.getType().getName();
}
if (isSimpleAttribute(attribute)) {
source.append(VariableTemplates.propertyDecl(type, attribute.getName(), attribute.getDefault()));
} else {
dependencyExporter.addDependency(type);
}
}
}
return source.toString();
}
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:20,代码来源:StructuredElementExporter.java
示例8: createOperationDeclarations
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
private String createOperationDeclarations(VisibilityKind modifier) {
StringBuilder source = new StringBuilder("");
for (Operation operation : structuredElement.getOwnedOperations()) {
if (operation.getVisibility().equals(modifier) && pred.test(operation)) {
String returnType = getReturnType(operation.getReturnResult());
if (!CppExporterUtils.isConstructor(operation)) {
source.append(operationDecl(operation));
}
if (returnType != null) {
dependencyExporter.addDependency(returnType);
}
dependencyExporter.addDependencies(getOperationParamTypes(operation));
}
}
return source.toString();
}
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:18,代码来源:StructuredElementExporter.java
示例9: assignModifiersForElementBasedOnDeclaration
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
public static void assignModifiersForElementBasedOnDeclaration(NamedElement element, BodyDeclaration declaration) {
int modifiers = declaration.getModifiers();
VisibilityKind visibility = VisibilityProvider.getVisibilityOfNamedElementFromModifiers(element, modifiers);
element.setVisibility(visibility);
boolean isAbstract = Modifier.isAbstract(modifiers);
boolean isStatic = Modifier.isStatic(modifiers);
if (element instanceof Classifier) {
Classifier classifierElem = (Classifier) element;
classifierElem.setIsAbstract(isAbstract);
}
if (element instanceof BehavioralFeature) {
BehavioralFeature featureElem = (BehavioralFeature) element;
featureElem.setIsStatic(isStatic);
featureElem.setIsAbstract(isAbstract);
}
if (element instanceof Property) {
Property propertyElem = (Property) element;
propertyElem.setIsStatic(isStatic);
}
}
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:23,代码来源:ElementModifiersAssigner.java
示例10: getVisibility
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
private VisibilityKind getVisibility(Collection<? extends RefexChronicleBI<?>> attributeAnnotations)
throws ValidationException, IOException {
/** TODO (artf231829) - BAC
StringMember visibilityAnnotation = getSingleAnnotation(attributeAnnotations,
FHIMMetadataBinding.FHIM_VISIBILITY_REFSET, StringMember.class);
// If none, abort.
if (visibilityAnnotation == null) {
return null;
}
String name = visibilityAnnotation.getString1();
return VisibilityKind.valueOf(name);
**/
return null;
}
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:17,代码来源:FHIMExporter.java
示例11: caseALoadDecl
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
@Override
public final void caseALoadDecl(ALoadDecl node) {
super.caseALoadDecl(node);
final TUri uriNode = node.getUri();
String uriText = uriNode.getText();
// remove brackets
final String uri = uriText.substring(2).substring(0, uriText.length() - 4);
// defer package resolution
getRefTracker().add(new IDeferredReference() {
public void resolve(IBasicRepository repository) {
// TODO maybe allow package loading IBasicRepository to avoid
// casting
Package loaded = ((IRepository) repository).loadPackage(URI.createURI(uri));
if (loaded != null)
namespaceTracker.currentPackage().createPackageImport(loaded, VisibilityKind.PRIVATE_LITERAL);
else
problemBuilder.addProblem(new CannotLoadFromLocation(uri), uriNode);
}
}, IReferenceTracker.Step.PACKAGE_IMPORTS);
}
开发者ID:abstratt,项目名称:textuml,代码行数:21,代码来源:StructureGenerator.java
示例12: applyProfiles
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
private void applyProfiles() {
for (NameReference profileName : this.profilesApplied)
new ReferenceSetter<Profile>(profileName, getParentProduct(), getContext(),
IReferenceTracker.Step.PROFILE_APPLICATIONS) {
@Override
protected void link(Profile profile) {
if (!profile.isDefined())
getContext().getProblemTracker().add(
new InternalProblem("Profile '" + profile.getName() + "' not defined"));
else {
if (!getProduct().getAppliedProfiles().contains(profile))
getProduct().applyProfile(profile);
if (!getProduct().getImportedPackages().contains(profile))
getProduct().createPackageImport(profile, VisibilityKind.PRIVATE_LITERAL);
}
}
};
}
开发者ID:abstratt,项目名称:textuml,代码行数:19,代码来源:PackageBuilder.java
示例13: getProperOperations
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
* visibility를 체크해서 적합한 operation들만 list로 리턴한다.
*
* @param allOperations
* @return List<Operation>
*/
private static List<Operation> getProperOperations(EList<Operation> allOperations) {
List<Operation> result = new ArrayList<Operation>();
for (Operation operation : allOperations) {
if (VisibilityKind.PRIVATE_LITERAL.equals(operation.getVisibility())) {
continue;
}
result.add(operation);
}
return result;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:18,代码来源:SequenceManagerUtil.java
示例14: createProperty
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
*
* Propertuy 생성
*
* @param name
* @return org.eclipse.uml2.uml.Property
*/
public static org.eclipse.uml2.uml.Property createProperty(String name) {
org.eclipse.uml2.uml.Property property = FACTORY.createProperty();
property.setName(name);
property.setVisibility(VisibilityKind.PRIVATE_LITERAL);
property.setLower(1);
property.setUpper(1);
property.setAggregation(AggregationKind.NONE_LITERAL);
return property;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:17,代码来源:UMLHelper.java
示例15: createAssociation
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
*
*
* @return org.eclipse.uml2.uml.Association
*/
public static org.eclipse.uml2.uml.Association createAssociation() {
Association association = FACTORY.createAssociation();
association.setName(EMPTY_NAME);
association.setVisibility(VisibilityKind.PRIVATE_LITERAL);
return association;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:12,代码来源:UMLHelper.java
示例16: createDependency
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
*
*
* @return org.eclipse.uml2.uml.Dependency
*/
public static org.eclipse.uml2.uml.Dependency createDependency() {
org.eclipse.uml2.uml.Dependency dependency = FACTORY.createDependency();
dependency.setName(EMPTY_NAME);
dependency.setVisibility(VisibilityKind.PUBLIC_LITERAL);
return dependency;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:12,代码来源:UMLHelper.java
示例17: createOperation
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
*
*
* @return Operation
*/
public static Operation createOperation() {
org.eclipse.uml2.uml.Operation operation = FACTORY.createOperation();
operation.setName(UMLMessage.getMessage(UMLMessage.UML_OPERATION));
operation.setVisibility(VisibilityKind.PUBLIC_LITERAL);
return operation;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:12,代码来源:UMLHelper.java
示例18: getSelectedVisibilityKind
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
*
*
* @return VisibilityKind
*/
private VisibilityKind getSelectedVisibilityKind() {
if (this.publicButton.getSelection()) {
return VisibilityKind.PUBLIC_LITERAL;
} else if (this.privateButton.getSelection()) {
return VisibilityKind.PRIVATE_LITERAL;
} else if (this.protectedButton.getSelection()) {
return VisibilityKind.PROTECTED_LITERAL;
} else if (this.packageButton.getSelection()) {
return VisibilityKind.PACKAGE_LITERAL;
}
return null;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:18,代码来源:TemplateRadioButtonSection.java
示例19: set
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
* @see nexcore.tool.uml.ui.property.section.TemplateRadioButtonSection#set(org.eclipse.uml2.uml.VisibilityKind)
*/
@Override
protected void set(final VisibilityKind value) {
if (value.equals(VisibilityKind.PUBLIC_LITERAL)) {
getData().setVisibility(VisibilityKind.PUBLIC_LITERAL);
} else if (value.equals(VisibilityKind.PRIVATE_LITERAL)) {
getData().setVisibility(VisibilityKind.PRIVATE_LITERAL);
} else if (value.equals(VisibilityKind.PROTECTED_LITERAL)) {
getData().setVisibility(VisibilityKind.PROTECTED_LITERAL);
} else if (value.equals(VisibilityKind.PACKAGE_LITERAL)) {
getData().setVisibility(VisibilityKind.PACKAGE_LITERAL);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:16,代码来源:VisibilityGeneralSection.java
示例20: widgetSelected
import org.eclipse.uml2.uml.VisibilityKind; //导入依赖的package包/类
/**
* @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
public void widgetSelected(final SelectionEvent e) {
DomainUtil.run(new TransactionalAction() {
/**
* @see nexcore.tool.uml.manager.transaction.TransactionalAction#doExecute()
*/
@Override
public void doExecute() {
Button button = (Button) e.getSource();
if (button.getSelection()) {
String text = button.getText();
VisibilityKind kind = property.getVisibility();
if (text.equals(VisibilityType.PUBLIC.toString())) {
if (!kind.equals(VisibilityKind.PUBLIC_LITERAL)) {
property.setVisibility(VisibilityKind.PUBLIC_LITERAL);
}
} else if (text.equals(VisibilityType.PROTECTED.toString())) {
if (!kind.equals(VisibilityKind.PROTECTED_LITERAL)) {
property.setVisibility(VisibilityKind.PROTECTED_LITERAL);
}
} else if (text.equals(VisibilityType.PRIVATE.toString())) {
if (!kind.equals(VisibilityKind.PRIVATE_LITERAL)) {
property.setVisibility(VisibilityKind.PRIVATE_LITERAL);
}
} else {
if (!kind.equals(VisibilityKind.PACKAGE_LITERAL)) {
property.setVisibility(VisibilityKind.PACKAGE_LITERAL);
}
}
}
}
});
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:36,代码来源:AssociationGeneralSection.java
注:本文中的org.eclipse.uml2.uml.VisibilityKind类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论