Package de.FeatureModellingTool.GraphicalEditor.store

Examples of de.FeatureModellingTool.GraphicalEditor.store.AdaptedStandardStorageFormat


        }
        fileModel.setInteractionModel(sw.toString());
        // begin Write the project drawing content.
        sw.close();
        List<DrawModel> drawings = new ArrayList<DrawModel>();
        AdaptedStandardStorageFormat storef = new AdaptedStandardStorageFormat();
        try {
          for (int i = 0; i < drawingViews.length; i++) {
            sw = new StringWriter();
            storef.store(sw, drawingViews[i].getDrawing());
            drawings.add(new DrawModel(drawingViews[i].getDrawing()
                .getId(), drawingViews[i].getDrawing()
                .getTitle(), sw.toString()));
            sw.close();
          }
View Full Code Here


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

        AdaptedStandardStorageFormat reader = new AdaptedStandardStorageFormat();

        //�������viewNameArray.length��draw�ļ�.
        if (viewNameArray.length > 0) {
            //begin ��ȡͼԪ��Ϣ�ļ�
            try {
                drawingArray = new Drawing[viewNameArray.length];
                for (int i = 0; i < viewNameArray.length; i++) {
                    DrawModel draw = dataSrc.getDrawModel(viewNameArray[i]);
                    InputStream input = new ByteArrayInputStream(draw.getContent().getBytes());
//                    InputStream input = new StringBufferInputStream(draw.getContent());
                    drawingArray[i] = reader.restore(input);
                    drawingArray[i].setId(draw.getId());
                }

            } catch (Exception exception) {
                errorInfo = "Exception occurs when read project graphic file.\n" + exception;
View Full Code Here

        // end д�뽻��ģ�������ļ�

        bufferStream.reset();

        // begin д����Ŀ��ͼ�ļ�
        AdaptedStandardStorageFormat store = new AdaptedStandardStorageFormat();
        for (int i = 0; i < drawingViews.length; i++) {
          store.store(bufferStream, drawingViews[i].getDrawing());
          ZipEntry viewZipEntry = new ZipEntry(
              (String) drawingViews[i].getDrawing().getTitle()
                  + ".draw");
          zipOutStream.putNextEntry(viewZipEntry);
          bufferStream.writeTo(zipOutStream);
          zipOutStream.closeEntry();

          bufferStream.reset();
        }
        // end д����Ŀ��ͼ�ļ�

        bufferStream.reset();

        // begin д��������Ϣ
        GroupMap informationMap = (GroupMap) ProjectManagerImplementation.this
            .getContext()
            .getValue(
                de.FeatureModellingTool.ProjectManager.ConstantDefinition.INFOMATION_MAP);

        Iterator iterator = informationMap.keySet().iterator();
        while (iterator.hasNext()) {
          String id = (String) iterator.next();
          Set set = informationMap.get(id);

          if (set != null) {
            Iterator valueIterator = set.iterator();
            while (valueIterator.hasNext()) {
              Drawing drawing = (Drawing) valueIterator.next();
              store.store(bufferStream, drawing);
              ZipEntry drawingEntry = new ZipEntry(id + "\\"
                  + drawing.getTitle() + ".draw");
              zipOutStream.putNextEntry(drawingEntry);
              bufferStream.writeTo(zipOutStream);
              zipOutStream.closeEntry();
View Full Code Here

            }
            fileModel.setInteractionModel(sw.toString());
            // begin Write the project drawing content.
            sw.close();
            List<DrawModel> drawings  =new ArrayList<DrawModel>();
            AdaptedStandardStorageFormat storef =  new AdaptedStandardStorageFormat();
            try{
              for(int i = 0 ;i<drawingViews.length;i++){
                sw = new StringWriter();
                storef.store(sw, drawingViews[i].getDrawing());
                drawings.add(new DrawModel(drawingViews[i].getDrawing().getId(),drawingViews[i].getDrawing().getTitle(),sw.toString()));
                sw.close();
              }
              fileModel.setDraws(drawings);
            }catch(Exception exec){
View Full Code Here

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

        AdaptedStandardStorageFormat reader = new AdaptedStandardStorageFormat();

        if (viewNameArray.length > 0) {
            //begin ��ȡͼԪ��Ϣ�ļ�
            try {
                drawingArray = new Drawing[viewNameArray.length];
                for (int i = 0; i < viewNameArray.length; i++) {
                    zipEntry = zipFile.getEntry(viewNameArray[i] + ".draw");
                    InputStream inputStream = zipFile.getInputStream(zipEntry);
                    drawingArray[i] = reader.restore(inputStream);
                }

            } catch (Exception exception) {
                errorInfo = "Exception occurs when read project graphic file.\n" + exception;
                return false;
            }
            //end ��ȡͼԪ��Ϣ�ļ�
        } else {
           drawingArray = new Drawing[0];
        }

        //begin ��ȡ������Ϣ
        informationMap = new GroupTreeMap();

        Enumeration enumeration = zipFile.entries();

        while (enumeration.hasMoreElements()) {
            ZipEntry entry = (ZipEntry) enumeration.nextElement();

            String entryName = entry.getName();

            if (entryName.endsWith(".draw")) {
                int index = entryName.indexOf('\\');

                if (index > 0) {
                    try {
                        String id = entryName.substring(0, index);
                        InputStream inputStream = zipFile.getInputStream(entry);
                        Drawing drawing = reader.restore(inputStream);
                        informationMap.add(id, drawing);
                    } catch (Exception exception) {
                        errorInfo = "Exception occurs when read information.\n" + exception;
                        exception.printStackTrace();
                        return false;
View Full Code Here

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

        AdaptedStandardStorageFormat reader = new AdaptedStandardStorageFormat();

        //�������viewNameArray.length��draw�ļ�.
        if (viewNameArray.length > 0) {
            //begin ��ȡͼԪ��Ϣ�ļ�
            try {
                drawingArray = new Drawing[viewNameArray.length];
                for (int i = 0; i < viewNameArray.length; i++) {
                    DrawModel draw = dataSrc.getDrawModel(viewNameArray[i]);
                    InputStream input = new StringBufferInputStream(draw.getContent());
                    drawingArray[i] = reader.restore(input);
                    drawingArray[i].setId(draw.getId());
                }

            } catch (Exception exception) {
                errorInfo = "Exception occurs when read project graphic file.\n" + exception;
View Full Code Here

                //end д�뽻��ģ�������ļ�

                bufferStream.reset();

                //begin д����Ŀ��ͼ�ļ�
                AdaptedStandardStorageFormat store = new AdaptedStandardStorageFormat();
                for (int i = 0; i < drawingViews.length; i++) {
                    store.store(bufferStream, drawingViews[i].getDrawing());
                    ZipEntry viewZipEntry = new ZipEntry((String) drawingViews[i].getDrawing().getTitle() + ".draw");
                    zipOutStream.putNextEntry(viewZipEntry);
                    bufferStream.writeTo(zipOutStream);
                    zipOutStream.closeEntry();

                    bufferStream.reset();
                }
                //end д����Ŀ��ͼ�ļ�

                bufferStream.reset();

                //begin д��������Ϣ
                GroupMap informationMap = (GroupMap) ProjectManagerImplementation.this.getContext().getValue(de.FeatureModellingTool.ProjectManager.ConstantDefinition.INFOMATION_MAP);

                Iterator iterator = informationMap.keySet().iterator();
                while (iterator.hasNext()) {
                    String id = (String) iterator.next();
                    Set set = informationMap.get(id);

                    if (set != null) {
                        Iterator valueIterator = set.iterator();
                        while (valueIterator.hasNext()) {
                            Drawing drawing = (Drawing) valueIterator.next();
                            store.store(bufferStream, drawing);
                            ZipEntry drawingEntry = new ZipEntry(id + "\\" + drawing.getTitle() + ".draw");
                            zipOutStream.putNextEntry(drawingEntry);
                            bufferStream.writeTo(zipOutStream);
                            zipOutStream.closeEntry();
View Full Code Here

TOP

Related Classes of de.FeatureModellingTool.GraphicalEditor.store.AdaptedStandardStorageFormat

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.