Package de.FeatureModellingTool.FeatureModel.store

Examples of de.FeatureModellingTool.FeatureModel.store.FmdlParser


          fileModel.setId(project.getProjectId());
          fileModel.setName(project.getProjectName());
          fileModel.setIndex(index);
        }
        // begin д������ģ�������ļ�
        FmdlParser parser = new FmdlParserPrototype();
        StringWriter sw = new StringWriter();
        try {
          parser.saveFmdl(sw, fm);
        } catch (Exception exce) {
          exce.printStackTrace();
        }
        fileModel.setFeatureModel(sw.toString());
        // begin д��Լ��ģ�������ļ�
        sw.close();
        sw = new StringWriter();
        try {
          parser.saveCmdl(sw, cm, fm);
        } catch (Exception exec) {
          exec.printStackTrace();
        }
        fileModel.setConstraintModel(sw.toString());

        // begin д�뽻��ģ�������ļ�
        sw.close();
        sw = new StringWriter();
        try {
          parser.saveImdl(sw, im, fm);
        } catch (Exception exec) {
          exec.printStackTrace();
        }
        fileModel.setInteractionModel(sw.toString());
        // begin Write the project drawing content.
View Full Code Here


        // end д����Ŀ�����ļ�

        bufferStream.reset();

        // begin д������ģ�������ļ�
        FmdlParser parser = new FmdlParserPrototype();
        parser.saveFmdl(bufferStream, fm);
        ZipEntry fmZipEntry = new ZipEntry(fm.getName() + ".fm");
        zipOutStream.putNextEntry(fmZipEntry);
        bufferStream.writeTo(zipOutStream);
        zipOutStream.closeEntry();
        // end д������ģ�������ļ�

        bufferStream.reset();

        // begin д��Լ��ģ�������ļ�
        parser.saveCmdl(bufferStream, cm, fm);
        ZipEntry cmZipEntry = new ZipEntry(fm.getName() + ".cm");
        zipOutStream.putNextEntry(cmZipEntry);
        bufferStream.writeTo(zipOutStream);
        zipOutStream.closeEntry();
        // end д��Լ��ģ�������ļ�

        bufferStream.reset();

        // begin д�뽻��ģ�������ļ�
        parser.saveImdl(bufferStream, im, fm);
        ZipEntry imZipEntry = new ZipEntry(fm.getName() + ".im");
        zipOutStream.putNextEntry(imZipEntry);
        bufferStream.writeTo(zipOutStream);
        zipOutStream.closeEntry();
        // end д�뽻��ģ�������ļ�
View Full Code Here

              fileModel.setId(project.getProjectId());
              fileModel.setName(project.getProjectName());
              fileModel.setIndex(index);
            }
//          begin д������ģ�������ļ�
            FmdlParser parser = new FmdlParserPrototype();
            StringWriter sw = new StringWriter();
            try{
              parser.saveFmdl(sw,fm);
            }catch(Exception exce){
              exce.printStackTrace();
            }
            fileModel.setFeatureModel(sw.toString());
            // begin д��Լ��ģ�������ļ�
            sw.close();
            sw = new StringWriter();
            try{
              parser.saveCmdl(sw,cm,fm);
            }catch(Exception exec){
              exec.printStackTrace();
            }
            fileModel.setConstraintModel(sw.toString());

            // begin д�뽻��ģ�������ļ�
            sw.close();
            sw = new StringWriter();
            try{
              parser.saveImdl(sw, im, fm);
            }catch(Exception exec){
              exec.printStackTrace();
            }
            fileModel.setInteractionModel(sw.toString());
            // begin Write the project drawing content.
View Full Code Here

            errorInfo = "Exception occurs when read project index file.\n" + exception;
            return false;
        }
        //end ��ȡ��Ŀ�����ļ�

        FmdlParser parser = new FmdlParserPrototype();

        //begin ��ȡ����ģ�������ļ�
        try {
            zipEntry = zipFile.getEntry(domainName + ".fm");
            InputStream inputStream = zipFile.getInputStream(zipEntry);

            featureModel = parser.openFmdl(inputStream);

        } catch (Exception exception) {
            errorInfo = "Exception occurs when read feature-model file.\n" + exception;
            return false;
        }
        //end ��ȡ����ģ�������ļ�

        //begin ��ȡԼ��ģ�������ļ�
        try {
            zipEntry = zipFile.getEntry(domainName + ".cm");
            if (zipEntry != null) {
                InputStream inputStream = zipFile.getInputStream(zipEntry);

                parser.openCmdl(inputStream, featureModel);
            }
        } catch (Exception exception) {
            errorInfo = "Exception occurs when read constraint-model file.\n" + exception;
            return false;
        }
        //end ��ȡԼ��ģ�������ļ�

        //Question: *.im �洢ʲô��Ϣ��
        try{
            zipEntry = zipFile.getEntry(domainName + ".im");

            if (zipEntry != null) {
                InputStream inputStream = zipFile.getInputStream(zipEntry);

                parser.openImdl(inputStream, featureModel);
            }

        } catch (Exception exception) {
            errorInfo = "Exception occurs when read interaction-model file.\n" + exception;
            return false;
View Full Code Here

                bufferStream.reset();


                //begin д������ģ�������ļ�
                FmdlParser parser = new FmdlParserPrototype();
                parser.saveFmdl(bufferStream, fm);
                ZipEntry fmZipEntry = new ZipEntry(fm.getName() + ".fm");
                zipOutStream.putNextEntry(fmZipEntry);
                bufferStream.writeTo(zipOutStream);
                zipOutStream.closeEntry();
                //end д������ģ�������ļ�

                bufferStream.reset();

                //begin д��Լ��ģ�������ļ�
                parser.saveCmdl(bufferStream, cm, fm);
                ZipEntry cmZipEntry = new ZipEntry(fm.getName() + ".cm");
                zipOutStream.putNextEntry(cmZipEntry);
                bufferStream.writeTo(zipOutStream);
                zipOutStream.closeEntry();
                //end д��Լ��ģ�������ļ�

                bufferStream.reset();

                //begin д�뽻��ģ�������ļ�
                parser.saveImdl(bufferStream, im, fm);
                ZipEntry imZipEntry = new ZipEntry(fm.getName() + ".im");
                zipOutStream.putNextEntry(imZipEntry);
                bufferStream.writeTo(zipOutStream);
                zipOutStream.closeEntry();
                //end д�뽻��ģ�������ļ�
View Full Code Here

TOP

Related Classes of de.FeatureModellingTool.FeatureModel.store.FmdlParser

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.