コード例 #1
0
        ///
        ///	 * <param name="xm">
        ///	 * @return </param>
        ///
        protected internal virtual JDFMedia initPlateMedia()
        {
            if (theParentNode != null)
            {
                theNode.ensureLink(theParentNode.getResource(ElementName.MEDIA, EnumUsage.Input, 0), EnumUsage.Input, null);
            }
            JDFMedia m = (JDFMedia)theNode.getCreateResource(ElementName.MEDIA, EnumUsage.Input, 0);

            if (EnumMediaType.Paper.Equals(m.getMediaType()))
            {
                m = (JDFMedia)theNode.getCreateResource(ElementName.MEDIA, EnumUsage.Input, 1);
            }
            m.setResStatus(EnumResStatus.Available, false);
            m.makeRootResource(null, theNode.getJDFRoot(), true);
            theNode.getJDFRoot().getCreateResourcePool().moveElement(m, null);
            m.setDescriptiveName("the plates to use");
            m.setMediaType(EnumMediaType.Plate);
            m.setPartUsage(EnumPartUsage.Implicit);
            if (bPartitionedPlateMedia && vParts != null)
            {
                VJDFAttributeMap vSheets = getReducedMap(new VString("Side Separation PartVersion", null));
                for (int i = 0; i < vSheets.Count; i++)
                {
                    JDFAttributeMap part = new JDFAttributeMap(vSheets[i]);
                    // JDFResource mm=
                    m.getCreatePartition(part, partIDKeys);
                }
            }
            else
            {
                m.setDimensionCM(new JDFXYPair(70, 102));
            }
            return(m);
        }
コード例 #2
0
        ///
        ///	 * <param name="icsLevel"> </param>
        ///
        protected internal virtual JDFMedia initPaperMedia()
        {
            JDFResourceLink rlM = null;

            if (thePreviousNode != null)
            {
                JDFMedia media = (JDFMedia)thePreviousNode.getResource(ElementName.MEDIA, EnumUsage.Input, 0);
                if (media != null && !EnumMediaType.Paper.Equals(media.getMediaType()))
                {
                    media = (JDFMedia)thePreviousNode.getResource(ElementName.MEDIA, EnumUsage.Input, 1);
                }
                if (media != null && !EnumMediaType.Paper.Equals(media.getMediaType()))
                {
                    media = null;
                }

                if (media == null)
                {
                    media = getMediaFromNode(thePreviousNode);
                    if (media == null)
                    {
                        VElement v = thePreviousNode.getPredecessors(true, false);
                        if (v != null)
                        {
                            int siz = v.Count;
                            for (int i = 0; i < siz; i++)
                            {
                                media = getMediaFromNode((JDFNode)v[i]);
                                if (media != null)
                                {
                                    break;
                                }
                            }
                        }
                    }
                }
                rlM = theNode.linkResource(media, EnumUsage.Input, null);
            }

            if (rlM == null && theParentNode != null)
            {
                rlM = theNode.linkResource(theParentNode.getResource(ElementName.MEDIA, EnumUsage.Input, 0), EnumUsage.Input, null);
            }

            paperMedia = (JDFMedia)theNode.getCreateResource(ElementName.MEDIA, null, 0);
            paperMedia.setDescriptiveName("the paper to print on");
            paperMedia.setResStatus(EnumResStatus.Unavailable, false);
            paperMedia.setMediaType(EnumMediaType.Paper);
            paperMedia.setDimensionCM(new JDFXYPair(70, 102));
            paperMedia.setWeight(90);
            paperMedia.setThickness(90 / 0.8);
            return(paperMedia);
        }
コード例 #3
0
        public virtual void testMediaCatalog()
        {
            JDFDoc doc = new JDFDoc(ElementName.JMF);
            JDFJMF jmf = doc.getJMFRoot();

            jmf.setSenderID("DeviceSenderID");

            JDFQuery q = jmf.appendQuery(EnumType.Resource);

            q.setXMLComment("This is the query for a catalog");

            JDFResourceQuParams rqp = q.appendResourceQuParams();

            rqp.setExact(true);
            rqp.setXMLComment("Scope=Allowed is a new attribute to describe that we want a complet list of all known resources");
            rqp.setResourceName(ElementName.MEDIA);
            //		rqp.setAttribute("Scope", "Allowed");

            JDFResponse r = q.createResponse().getResponse(0);

            r = (JDFResponse)jmf.moveElement(r, null);
            r.setXMLComment("This is the response to the query - generally it will be in it's own jmf...\nThe list of ResourceInfo + the ResourceQuParams could also be specified in a Signal.");

            for (int i = 1; i < 5; i++)
            {
                JDFResourceInfo ri = r.appendResourceInfo();
                ri.setResourceName("Media");
                JDFMedia m = (JDFMedia)ri.appendResource("Media");
                m.setDescriptiveName("Description of Media #" + i);
                m.setDimensionCM(new JDFXYPair(i * 10, 13 + i % 2 * 20));
                m.setBrand("Brand #" + i);
                m.setProductID("ProductID_" + i);
                m.setMediaType(EnumMediaType.Paper);
                m.setResStatus((i < 2 ? EnumResStatus.Available : EnumResStatus.Unavailable), false);
                ri.setXMLComment("More attributes can be added as needed; Available = loaded");
            }
            doc.write2File(sm_dirTestDataTemp + "MediaCatalog.jmf", 2, false);
            Assert.IsTrue(jmf.isValid(EnumValidationLevel.Complete));
        }