Revision 42

View differences:

branches/modelio3.8.x/src/main/java/org/modelio/module/cpswarm/propertypage/AssociationPropertyPage.java
36 36

  
37 37
/**
38 38
 * This class handles the properties common to all SysML stereotypes
39
 * 
39 40
 * @author ebrosse
40 41
 */
41 42
@objid ("0b840cfb-9b4e-46ed-b684-74dfd62c7ceb")
42 43
public class AssociationPropertyPage implements IPropertyContent {
43 44
    /**
44 45
     * Constructor CommonPropertyPage
46
     * 
45 47
     * @author ebrosse
46 48
     */
47 49
    @objid ("c9a0a5cd-7252-4bd1-b0a6-abce80ba61d6")
......
52 54
    @Override
53 55
    public void update(ModelElement element, IModulePropertyTable table) {
54 56
        AssociationEnd end = (AssociationEnd) element;
55
        if (end.getAggregation().equals(AggregationKind.KINDISAGGREGATION))
57
        if (end.getAggregation().equals(AggregationKind.KINDISAGGREGATION)) {
56 58
            end = end.getOpposite();
57
            
58
        table.addProperty("Number", end.getMultiplicityMax());
59
        }
60
        table.addProperty("Role", end.getName());
61
        table.addProperty("Cardinality", end.getMultiplicityMax());
59 62
    }
60 63

  
61 64
    @objid ("d5a73b75-a4a1-433b-84b8-5a9e4d753f2c")
62 65
    @Override
63 66
    public int changeProperty(ModelElement element, int row, String value) {
64 67
        AssociationEnd end = (AssociationEnd) element;
65
        if (end.getAggregation().equals(AggregationKind.KINDISAGGREGATION))
68
        if (end.getAggregation().equals(AggregationKind.KINDISAGGREGATION)) {
66 69
            end = end.getOpposite();
67
        end.setMultiplicityMax(value);
68
        end.setMultiplicityMin(value);
70
        }
71
        switch (row) {
72
        case 1:
73
            end.setName(value);
74
            break;
75
        case 2:
76
            end.setMultiplicityMax(value);
77
            end.setMultiplicityMin(value);
78
            break;
79
        default:
80
            break;
81
        }
69 82
        return 1;
70 83
    }
71 84

  

Also available in: Unified diff