Package de.FeatureModellingTool

Examples of de.FeatureModellingTool.FeatureModel


         FeatureEditor fe = de.FeatureModellingTool.FeatureModel.Manager.getFeatureEditor(fm);
         FeatureModelPropertyEditor fmpe = de.FeatureModellingTool.FeatureModel.Manager.getFeatureModelPropertyEditor(fm);
         **/

        //new way
        FeatureModel fm = (FeatureModel) fcomponent.getInterface(de.FeatureModellingTool.FeatureModel.Manager.FEATURE_MODEL_INTERFACE);
        FeatureModelEditor fme = (FeatureModelEditor) fcomponent.getInterface(de.FeatureModellingTool.FeatureModel.Manager.FEATURE_MODEL_EDITOR_INTERFACE);
        FeatureEditor fe = (FeatureEditor) fcomponent.getInterface(de.FeatureModellingTool.FeatureModel.Manager.FEATURE_EDITOR_INTERFACE);
        FeatureModelPropertyEditor fmpe = (FeatureModelPropertyEditor) fcomponent.getInterface(de.FeatureModellingTool.FeatureModel.Manager.FEATURE_MODEL_PROPERTY_EDITOR_INTERFACE);
        //

View Full Code Here


        fmt.output(doc, outStream);
    }

    public void openCmdl(InputStream inputstream, FComponent featureModel) throws IOException, JDOMException {

        FeatureModel fm = (FeatureModel) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.FEATURE_MODEL_INTERFACE);
        ConstraintModel cm = (ConstraintModel) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.CONSTRAINT_MODEL_INTERFACE);
        ConstraintModelEditor cme = (ConstraintModelEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.CONSTRAINT_MODEL_EDITOR_INTERFACE);
        CompositeConstraintEditor plce = (CompositeConstraintEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.PL_CONSTRAINT_EDITOR_INTERFACE);
        GroupConstraintEditor gce = (GroupConstraintEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.GROUP_CONSTRAINT_EDITOR_INTERFACE);
        VPConstraintEditor vpce = (VPConstraintEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.VP_CONSTRAINT_EDITOR_INTERFACE);

        //

        Namespace cmd = Namespace.getNamespace("cmd", "http://sei.pku.edu.cn/DomainEngineering/constraintmodel");

        SAXBuilder saxBuilder = new SAXBuilder(false);
        Document doc = saxBuilder.build(inputstream);

        Element root = doc.getRootElement();

        //��ȡԼ����Ϣ
        Element constraintList = root.getChild("constraintList", cmd);
        Iterator constraintIterator = constraintList.getChildren("constraint", cmd).iterator();

        while (constraintIterator.hasNext()) {
            Element constraintElement = (Element) constraintIterator.next();

            String id = constraintElement.getAttributeValue("id");
            CompositeConstraint constraint = cme.addCompositeConstraint(id);

            plce.setPLType(constraint, CompositeConstraintType.getInstance(constraintElement.getChild("plType").getTextNormalize()));
            plce.setSourceType(constraint, CompositeConstraintPortType.getInstance(constraintElement.getChild("sourceType").getTextNormalize()));
            plce.setSinkType(constraint, CompositeConstraintPortType.getInstance(constraintElement.getChild("sinkType").getTextNormalize()));
        }

        Element compositeConstraintList = constraintList.getChild("compositeConstraintList", cmd);

        if (compositeConstraintList != null) {
            Iterator compositeConstraintIterator = compositeConstraintList.getChildren("compositeConstraint", cmd).iterator();

            while (compositeConstraintIterator.hasNext()) {
                Element constraintElement = (Element) compositeConstraintIterator.next();

                String id = constraintElement.getAttributeValue("id");
                CompositeConstraint constraint = cme.addCompositeConstraint(id);

                plce.setPLType(constraint, CompositeConstraintType.getInstance(constraintElement.getChild("plType").getTextNormalize()));
                plce.setSourceType(constraint, CompositeConstraintPortType.getInstance(constraintElement.getChild("sourceType").getTextNormalize()));
                plce.setSinkType(constraint, CompositeConstraintPortType.getInstance(constraintElement.getChild("sinkType").getTextNormalize()));

            }
        }

        Element groupConstraintList = constraintList.getChild("groupConstraintList", cmd);

        if (groupConstraintList != null) {
            Iterator groupConstraintIterator = groupConstraintList.getChildren("groupConstraint", cmd).iterator();

            while (groupConstraintIterator.hasNext()) {
                Element constraintElement = (Element) groupConstraintIterator.next();

                String id = constraintElement.getAttributeValue("id");
                GroupConstraint constraint = cme.addGroupConstraint(id);

                gce.setType(constraint, GroupConstraintType.getInstance(constraintElement.getChild("groupType").getTextNormalize()));
            }
        }

        Element vpConstraintList = constraintList.getChild("vpConstraintList", cmd);

        if (vpConstraintList != null) {
            Iterator vpConstraintIterator = vpConstraintList.getChildren("vpConstraint", cmd).iterator();

            while (vpConstraintIterator.hasNext()) {
                Element constraintElement = (Element) vpConstraintIterator.next();

                String id = constraintElement.getAttributeValue("id");
                VPConstraint constraint = cme.addVPConstraint(id);

                vpce.setType(constraint, VPConstraintType.getInstance(constraintElement.getChild("vpType").getTextNormalize()));
            }
        }

        //��ȡ��ϵ��Ϣ
        Element relationList = root.getChild("relationList", cmd);
        Iterator plRelationIterator = relationList.getChildren("plRelation", cmd).iterator();

        while (plRelationIterator.hasNext()) {
            Element plRelationElement = (Element) plRelationIterator.next();

            String id = plRelationElement.getAttributeValue("id");
            String constraintID = plRelationElement.getChild("constraintID").getTextNormalize();
            String featureID = plRelationElement.getChild("featureID").getTextNormalize();
            String isSource = plRelationElement.getChild("isSource").getTextNormalize();

            Element element = plRelationElement.getChild("modifier");
            String modifier = null;
            if (element != null) {
                modifier = element.getTextNormalize();
            } else {
                modifier = CFRModifier.Affirmation.getName();
            }

            CFRelation plRelation = cme.addCFRelation(id, fm.getFeature(featureID), cm.getConstraint(constraintID), Boolean.valueOf(isSource).booleanValue(), CFRModifier.getInstance(modifier));
        }
    }
View Full Code Here

            CFRelation plRelation = cme.addCFRelation(id, fm.getFeature(featureID), cm.getConstraint(constraintID), Boolean.valueOf(isSource).booleanValue(), CFRModifier.getInstance(modifier));
        }
    }

    public void openImdl(InputStream inputstream, FComponent featureModel) throws IOException, JDOMException {
        FeatureModel fm = (FeatureModel) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.FEATURE_MODEL_INTERFACE);
        InteractionModel im = (InteractionModel) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.INTERACTION_MODEL_INTERFACE);
        InteractionModelEditor ime = (InteractionModelEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.INTERACTION_MODEL_EDITOR_INTERFACE);

        ResourceComponentEditor rce = (ResourceComponentEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.RESOURCE_COMPONENT_EDITOR_INTERFACE);
View Full Code Here

         FeatureEditor fe = de.FeatureModellingTool.FeatureModel.Manager.getFeatureEditor(fm);
         FeatureModelPropertyEditor fmpe = de.FeatureModellingTool.FeatureModel.Manager.getFeatureModelPropertyEditor(fm);
         **/

        //new way
        FeatureModel fm = (FeatureModel) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.FEATURE_MODEL_INTERFACE);
        FeatureModelEditor fme = (FeatureModelEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.FEATURE_MODEL_EDITOR_INTERFACE);
        FeatureEditor fe = (FeatureEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.FEATURE_EDITOR_INTERFACE);
        FeatureModelPropertyEditor fmpe = (FeatureModelPropertyEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.FEATURE_MODEL_PROPERTY_EDITOR_INTERFACE);
        //

View Full Code Here

        fmt.output(doc, outStream);
    }

    public void openCmdl(InputStream inputstream, FComponent featureModel) throws IOException, JDOMException {

        FeatureModel fm = (FeatureModel) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.FEATURE_MODEL_INTERFACE);
        ConstraintModel cm = (ConstraintModel) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.CONSTRAINT_MODEL_INTERFACE);
        ConstraintModelEditor cme = (ConstraintModelEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.CONSTRAINT_MODEL_EDITOR_INTERFACE);
        CompositeConstraintEditor plce = (CompositeConstraintEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.PL_CONSTRAINT_EDITOR_INTERFACE);
        GroupConstraintEditor gce = (GroupConstraintEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.GROUP_CONSTRAINT_EDITOR_INTERFACE);
        VPConstraintEditor vpce = (VPConstraintEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.VP_CONSTRAINT_EDITOR_INTERFACE);

        //

        Namespace cmd = Namespace.getNamespace("cmd", "http://sei.pku.edu.cn/DomainEngineering/constraintmodel");

        SAXBuilder saxBuilder = new SAXBuilder(false);
        Document doc = saxBuilder.build(inputstream);

        Element root = doc.getRootElement();

        //��ȡԼ����Ϣ
        Element constraintList = root.getChild("constraintList", cmd);
        Iterator constraintIterator = constraintList.getChildren("constraint", cmd).iterator();

        while (constraintIterator.hasNext()) {
            Element constraintElement = (Element) constraintIterator.next();

            String id = constraintElement.getAttributeValue("id");
            CompositeConstraint constraint = cme.addCompositeConstraint(id);

            plce.setPLType(constraint, CompositeConstraintType.getInstance(constraintElement.getChild("plType").getTextNormalize()));
            plce.setSourceType(constraint, CompositeConstraintPortType.getInstance(constraintElement.getChild("sourceType").getTextNormalize()));
            plce.setSinkType(constraint, CompositeConstraintPortType.getInstance(constraintElement.getChild("sinkType").getTextNormalize()));
        }

        Element compositeConstraintList = constraintList.getChild("compositeConstraintList", cmd);

        if (compositeConstraintList != null) {
            Iterator compositeConstraintIterator = compositeConstraintList.getChildren("compositeConstraint", cmd).iterator();

            while (compositeConstraintIterator.hasNext()) {
                Element constraintElement = (Element) compositeConstraintIterator.next();

                String id = constraintElement.getAttributeValue("id");
                CompositeConstraint constraint = cme.addCompositeConstraint(id);

                plce.setPLType(constraint, CompositeConstraintType.getInstance(constraintElement.getChild("plType").getTextNormalize()));
                plce.setSourceType(constraint, CompositeConstraintPortType.getInstance(constraintElement.getChild("sourceType").getTextNormalize()));
                plce.setSinkType(constraint, CompositeConstraintPortType.getInstance(constraintElement.getChild("sinkType").getTextNormalize()));

            }
        }

        Element groupConstraintList = constraintList.getChild("groupConstraintList", cmd);

        if (groupConstraintList != null) {
            Iterator groupConstraintIterator = groupConstraintList.getChildren("groupConstraint", cmd).iterator();

            while (groupConstraintIterator.hasNext()) {
                Element constraintElement = (Element) groupConstraintIterator.next();

                String id = constraintElement.getAttributeValue("id");
                GroupConstraint constraint = cme.addGroupConstraint(id);

                gce.setType(constraint, GroupConstraintType.getInstance(constraintElement.getChild("groupType").getTextNormalize()));
            }
        }

        Element vpConstraintList = constraintList.getChild("vpConstraintList", cmd);

        if (vpConstraintList != null) {
            Iterator vpConstraintIterator = vpConstraintList.getChildren("vpConstraint", cmd).iterator();

            while (vpConstraintIterator.hasNext()) {
                Element constraintElement = (Element) vpConstraintIterator.next();

                String id = constraintElement.getAttributeValue("id");
                VPConstraint constraint = cme.addVPConstraint(id);

                vpce.setType(constraint, VPConstraintType.getInstance(constraintElement.getChild("vpType").getTextNormalize()));
            }
        }

        //��ȡ��ϵ��Ϣ
        Element relationList = root.getChild("relationList", cmd);
        Iterator plRelationIterator = relationList.getChildren("plRelation", cmd).iterator();

        while (plRelationIterator.hasNext()) {
            Element plRelationElement = (Element) plRelationIterator.next();

            String id = plRelationElement.getAttributeValue("id");
            String constraintID = plRelationElement.getChild("constraintID").getTextNormalize();
            String featureID = plRelationElement.getChild("featureID").getTextNormalize();
            String isSource = plRelationElement.getChild("isSource").getTextNormalize();

            Element element = plRelationElement.getChild("modifier");
            String modifier = null;
            if (element != null) {
                modifier = element.getTextNormalize();
            } else {
                modifier = CFRModifier.Affirmation.getName();
            }

            CFRelation plRelation = cme.addCFRelation(id, fm.getFeature(featureID), cm.getConstraint(constraintID), Boolean.valueOf(isSource).booleanValue(), CFRModifier.getInstance(modifier));
        }
    }
View Full Code Here

            CFRelation plRelation = cme.addCFRelation(id, fm.getFeature(featureID), cm.getConstraint(constraintID), Boolean.valueOf(isSource).booleanValue(), CFRModifier.getInstance(modifier));
        }
    }

    public void openImdl(InputStream inputstream, FComponent featureModel) throws IOException, JDOMException {
        FeatureModel fm = (FeatureModel) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.FEATURE_MODEL_INTERFACE);
        InteractionModel im = (InteractionModel) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.INTERACTION_MODEL_INTERFACE);
        InteractionModelEditor ime = (InteractionModelEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.INTERACTION_MODEL_EDITOR_INTERFACE);

        ResourceComponentEditor rce = (ResourceComponentEditor) featureModel.getInterface(de.FeatureModellingTool.FeatureModel.Manager.RESOURCE_COMPONENT_EDITOR_INTERFACE);
View Full Code Here

TOP

Related Classes of de.FeatureModellingTool.FeatureModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.