Esempio n. 1
0
        ///
        ///	 * <param name="icsLevel"> </param>
        ///
        protected internal virtual void initPreviewSep()
        {
            if (theParentNode != null)
            {
                theNode.ensureLink(theParentNode.getResource(ElementName.PREVIEW, EnumUsage.Output, 0), EnumUsage.Output, null);
            }
            JDFPreview pv = (JDFPreview)theNode.getCreateResource(ElementName.PREVIEW, EnumUsage.Output, 0);

            pv.setResStatus(EnumResStatus.Incomplete, false);
            pv.setPreviewUsage(EnumPreviewUsage.Separation);
            pv.setPartUsage(EnumPartUsage.Explicit);
            pv.setPreviewFileType(EnumPreviewFileType.PNG);

            if (vParts != null)
            {
                for (int i = 0; i < vParts.Count; i++)
                {
                    JDFAttributeMap part  = vParts[i];
                    JDFPreview      pvp   = (JDFPreview)pv.getCreatePartition(part, partIDKeys);
                    int             ncols = "Front".Equals(part.get("Side")) ? nCols[0] : nCols[1];

                    for (int j = 0; j < ncols; j++)
                    {
                        pvp.getCreatePartition(EnumPartIDKey.Separation, cols.stringAt(j), partIDKeys);
                        pvp.setResStatus(EnumResStatus.Incomplete, false);
                    }
                }
            }
        }
Esempio n. 2
0
        ///
        ///	 <summary> *  </summary>
        ///
        private void makeReadyPreview()
        {
            JDFPreview pv = (JDFPreview)theNode.getResource(ElementName.PREVIEW, EnumUsage.Input, 0);
            VElement   v  = pv == null ? new VElement() : pv.getLeaves(false);

            for (int i = 0; i < v.Count; i++)
            {
                JDFPreview pvp = (JDFPreview)v[i];
                setPreviewURL(pvp);
                pvp.setResStatus(EnumResStatus.Available, true);
            }
        }
Esempio n. 3
0
 ///
 ///	 <summary> * prepare a preview partition  </summary>
 ///	 * <param name="previewPartition"> </param>
 ///
 private void preparePreview(JDFPreview previewPartition)
 {
     if (previewAvailable)
     {
         setPreviewURL(previewPartition);
         previewPartition.setResStatus(EnumResStatus.Available, false);
     }
     else
     {
         previewPartition.setResStatus(EnumResStatus.Incomplete, false);
     }
 }
Esempio n. 4
0
        ///
        ///	 * <param name="icsLevel"> </param>
        ///
        protected internal virtual void initPreview()
        {
            JDFResourceLink rlP = null;

            if (theNode.getCombinedProcessIndex(EnumType.InkZoneCalculation, 0) < 0)
            {
                return;
            }
            if (thePreviousNode != null)
            {
                rlP = theNode.linkResource(thePreviousNode.getResource(ElementName.PREVIEW, EnumUsage.Output, 0), EnumUsage.Input, null);
            }
            if (rlP == null && theParentNode != null)
            {
                rlP = theNode.linkResource(theParentNode.getResource(ElementName.PREVIEW, EnumUsage.Input, 0), EnumUsage.Input, null);
            }

            JDFPreview pv = (JDFPreview)theNode.getCreateResource(ElementName.PREVIEW, EnumUsage.Input, 0);

            pv.setResStatus(EnumResStatus.Incomplete, false);
            pv.setPreviewUsage(EnumPreviewUsage.Separation);
            pv.setPartUsage(EnumPartUsage.Explicit);
            pv.setPreviewFileType(bPPF ? EnumPreviewFileType.CIP3Single : EnumPreviewFileType.PNG);

            VJDFAttributeMap reducedMap = bPPF ? getReducedMap(new VString("Side Separation", " ")) : vParts;

            if (reducedMap != null)
            {
                int size = reducedMap.Count;
                for (int i = 0; i < size; i++)
                {
                    JDFAttributeMap part             = new JDFAttributeMap(reducedMap[i]);
                    JDFPreview      previewPartition = (JDFPreview)pv.getCreatePartition(part, partIDKeys);
                    if (bPPF)
                    {
                        preparePreview(previewPartition);
                    }
                    else
                    {
                        for (int j = 0; j < getNCols(); j++)
                        {
                            part.put(EnumPartIDKey.Separation, cols.stringAt(j));
                            JDFPreview sepPreview = (JDFPreview)previewPartition.getCreatePartition(part, partIDKeys);
                            preparePreview(sepPreview);
                        }
                    }
                }
            }
        }
Esempio n. 5
0
        ///
        ///     <summary> * Get all Preview from the current element
        ///     *  </summary>
        ///     * <returns> Collection<JDFPreview> </returns>
        ///
        public virtual ICollection <JDFPreview> getAllPreview()
        {
            List <JDFPreview> v = new List <JDFPreview>();

            JDFPreview kElem = (JDFPreview)getFirstChildElement(ElementName.PREVIEW, null);

            while (kElem != null)
            {
                v.Add(kElem);

                kElem = (JDFPreview)kElem.getNextSiblingElement(ElementName.PREVIEW, null);
            }

            return(v);
        }
Esempio n. 6
0
        ///
        ///	 * <param name="previewLeaf"> </param>
        ///
        private void setPreviewURL(JDFPreview previewLeaf)
        {
            DirectoryInfo share = UrlUtil.urlToFile(previewShare).Directory;
            FileInfo      file;

            if (bPPF)
            {
                file = new FileInfo(previewLeaf.getSheetName() + ".ppf");
            }
            else
            {
                file = new FileInfo(previewLeaf.getSheetName() + "_" + previewLeaf.getSide().getName().Substring(0, 1) + "_" + previewLeaf.getSeparation() + ".png");
            }
            file = FileUtil.getFileInDirectory(share, file);
            previewLeaf.setURL(UrlUtil.fileToUrl(file, false));
            previewLeaf.setPreviewUsage(EnumPreviewUsage.Separation);
            previewLeaf.setPreviewFileType(EnumPreviewFileType.CIP3Single);
        }
Esempio n. 7
0
        public virtual void testDieLayoutStrip()
        {
            JDFBinderySignature bs = stripParams.appendBinderySignature();

            bs.setBinderySignatureType(EnumBinderySignatureType.Die);
            JDFDieLayout dl = bs.appendDieLayout();
            JDFStation   s  = dl.appendStation();

            s.setStationAmount(12);
            s.setStationName("MyStation");
            JDFSignatureCell[] scs = new JDFSignatureCell[3];
            JDFPreview         pv0 = (JDFPreview)n.addResource(ElementName.PREVIEW, null, null, null, null, null, null);

            string[] index = { "0 ~ 2", "3 ~ 8", "9 ~ 11" };
            for (int i = 0; i < 3; i++)
            {
                JDFSignatureCell sc = scs[i] = bs.appendSignatureCell();
                sc.setStationName("MyStation");
                JDFPreview pv = (JDFPreview)pv0.addPartition(EnumPartIDKey.CellIndex, index[i]);
                pv.setURL("file://foo" + i + ".vrml");
                pv.setAttribute("PreviewFileType", "VRML");
                pv.setAttribute("PreviewUsage", "Animation");
                sc.refElement(pv);
            }

            scs[0].setXMLComment("This represents 3 times pageList 0");
            scs[0].setDescriptiveName("Strawberry lid");
            scs[0].setFrontPages(new JDFIntegerList("0 0 0"));

            scs[1].setFrontPages(new JDFIntegerList("1 1 1 1 1 1"));
            scs[1].setXMLComment("This represents 6 times pageList 1");
            scs[1].setDescriptiveName("Raspberry lid");

            scs[2].setFrontPages(new JDFIntegerList("2 2 2"));
            scs[2].setXMLComment("This represents 3 times pageList 2");
            scs[2].setDescriptiveName("Blueberry lid");

            d.write2File(sm_dirTestDataTemp + "DieStationStrip.jdf", 2, false);
        }
Esempio n. 8
0
        ///
        ///	 * <param name="icsLevel"> </param>
        ///
        protected internal virtual void initPreviewComp()
        {
            if (theParentNode != null)
            {
                theNode.ensureLink(theParentNode.getResource(ElementName.PREVIEW, EnumUsage.Output, 0), EnumUsage.Output, null);
            }
            JDFPreview pv = (JDFPreview)theNode.getCreateResource(ElementName.PREVIEW, EnumUsage.Output, 0);

            pv.setResStatus(EnumResStatus.Incomplete, false);
            pv.setPreviewUsage(EnumPreviewUsage.Viewable);
            pv.setPartUsage(EnumPartUsage.Explicit);
            pv.setPreviewFileType(EnumPreviewFileType.PNG);

            if (vParts != null)
            {
                VJDFAttributeMap vRedParts = getReducedMap(new VString("Separation", null));
                for (int i = 0; i < vRedParts.Count; i++)
                {
                    JDFAttributeMap part = vParts[i];
                    JDFPreview      pvp  = (JDFPreview)pv.getCreatePartition(part, partIDKeys);
                    pvp.setResStatus(EnumResStatus.Incomplete, false);
                }
            }
        }