Exemple #1
0
        private void ConvertPSMAssociation(PSMAssociation psmAssociation, PSMAssociationViewHelper psmAssociationViewHelper)
        {
            EvoX.Model.PSM.PSMAssociation evoxPSMAssociation;
            if (!TranslatedAlready(psmAssociation, out evoxPSMAssociation))
            {
                PSMAssociationMember parent = (PSMAssociationMember)ElementRef(psmAssociation.Parent);
                PSMAssociationMember child  = (PSMAssociationMember)ElementRef(psmAssociation.Child);
                evoxPSMAssociation = new EvoX.Model.PSM.PSMAssociation(evoxProject, parent, child, psmSchema);
                associationOrder[evoxPSMAssociation] = psmAssociation.ComponentIndex();
                translatedElements[psmAssociation]   = evoxPSMAssociation;
            }

            PSMClass childPSMClass = psmAssociation.Child as PSMClass;

            if (childPSMClass != null && childPSMClass.HasElementLabel)
            {
                evoxPSMAssociation.Name = childPSMClass.ElementName;
            }
            else
            {
                evoxPSMAssociation.Name = null;
            }
            PSMClassUnion psmClassUnion = psmAssociation.Child as PSMClassUnion;

            if (psmClassUnion != null)
            {
                evoxPSMAssociation.Name = null;
            }

            evoxPSMAssociation.Lower = ConvertToUint(psmAssociation.Lower);
            evoxPSMAssociation.Upper = ConvertToUnlimitedInt(psmAssociation.Upper);
        }
Exemple #2
0
        private EvoX.Model.PSM.PSMAssociation CreateLeadingAssociation(PSMSubordinateComponent subordinate, PSMAssociationMember childAssociationMember)
        {
            if (!(subordinate.Parent is PSMAssociation))
            {
                PSMAssociationMember          parent         = (PSMAssociationMember)translatedElements[subordinate.Parent];
                EvoX.Model.PSM.PSMAssociation psmAssociation = new EvoX.Model.PSM.PSMAssociation(
                    evoxProject, parent, childAssociationMember, psmSchema);
                psmAssociation.Name = null;
                associationOrder[psmAssociation] = subordinate.ComponentIndex();
                return(psmAssociation);
            }

            else
            {
                return(null);
            }
        }
Exemple #3
0
        private EvoX.Model.PSM.PSMAssociation CreateLeadingAssociationForUnionComponents(PSMAssociationChild associationChild, PSMAssociationMember childAssociationMember)
        {
            PSMAssociationMember parent = (PSMAssociationMember)translatedElements[associationChild.ParentUnion];

            EvoX.Model.PSM.PSMAssociation psmAssociation = new EvoX.Model.PSM.PSMAssociation(
                evoxProject, parent, childAssociationMember, psmSchema);
            PSMClass psmClass = associationChild as PSMClass;

            if (psmClass != null && psmClass.HasElementLabel)
            {
                psmAssociation.Name = psmClass.ElementName;
            }
            else
            {
                psmAssociation.Name = null;
            }
            associationOrder[psmAssociation] = associationChild.ComponentIndex();
            return(psmAssociation);
        }
Exemple #4
0
        private void ConvertPSMClass(PSMClass psmClass, PSMElementViewHelper psmElementViewHelper)
        {
            EvoX.Model.PSM.PSMClass evoxPSMClass;
            if (!TranslatedAlready(psmClass, out evoxPSMClass))
            {
                evoxPSMClass = new EvoX.Model.PSM.PSMClass(evoxProject, psmSchema, false);
                translatedElements[psmClass] = evoxPSMClass;
            }

            evoxPSMClass.Name = psmClass.Name;

            if (xcasePSMDiagram.Roots.Contains(psmClass))
            {
                if (psmClass.HasElementLabel)
                {
                    EvoX.Model.PSM.PSMAssociation rootAssociation = new EvoX.Model.PSM.PSMAssociation(
                        evoxProject, psmSchema.PSMSchemaClass, evoxPSMClass, psmSchema);
                    rootAssociation.Name = psmClass.ElementName;
                    associationOrder[rootAssociation] = xcasePSMDiagram.Roots.Where(r => r is PSMClass && ((PSMClass)r).HasElementLabel).ToList().IndexOf(psmClass);
                }
                else
                {
                    psmSchema.RegisterPSMRoot(evoxPSMClass);
                }
            }

            if (psmClass.RepresentedClass != null)
            {
                evoxPSMClass.Interpretation = (EvoX.Model.PIM.PIMClass)translatedElements[psmClass.RepresentedClass];
            }

            foreach (PSMAttribute attribute in psmClass.PSMAttributes)
            {
                ConvertPSMAttribute(evoxPSMClass, attribute, false);
            }
        }