Esempio n. 1
0
        public virtual void testInlineRefelement()
        {
            JDFDoc          d     = JDFTestCaseBase.creatXMDoc();
            JDFNode         n     = d.getJDFRoot();
            JDFExposedMedia xm    = (JDFExposedMedia)n.getMatchingResource("ExposedMedia", JDFNode.EnumProcessUsage.AnyInput, null, 0);
            JDFAttributeMap mPart = new JDFAttributeMap("SignatureName", "Sig1");

            mPart.put("SignatureName", "S12234");
            mPart.put("SheetName", "S12");
            mPart.put("Side", "Front");
            JDFExposedMedia xmPart = (JDFExposedMedia)xm.getCreatePartition(mPart, null);
            JDFMedia        m      = xm.getMedia();

            m = (JDFMedia)m.makeRootResource(null, null, true);
            m.setGrainDirection(EnumGrainDirection.XDirection);
            xmPart.refElement(m);
            Assert.AreEqual(xmPart.getMedia(), m);
            mPart.put("Side", "Back");
            xmPart = (JDFExposedMedia)xm.getCreatePartition(mPart, null);
            JDFMedia medPart = (JDFMedia)m.getCreatePartition(mPart, xm.getPartIDKeys());

            xmPart.refElement(medPart);
            Assert.AreEqual(xmPart.getMedia(), medPart);
            JDFRefElement re          = (JDFRefElement)xmPart.getElement("MediaRef");
            JDFMedia      inlineMedia = (JDFMedia)re.inlineRef();

            Assert.IsNull(xmPart.getElement_KElement("MediaRef", null, 0));
            Assert.AreEqual(EnumGrainDirection.XDirection, inlineMedia.getGrainDirection());
            Assert.AreEqual(xmPart.getMedia(), inlineMedia);
            Assert.IsFalse(inlineMedia.hasAttribute("ID"));
        }
Esempio n. 2
0
        public virtual void testGetElement_KElement()
        {
            JDFDoc          d    = new JDFDoc("JDF");
            JDFNode         root = d.getJDFRoot();
            JDFExposedMedia xm   = (JDFExposedMedia)root.addResource("ExposedMedia", null, EnumUsage.Input, null, null, null, null);
            JDFMedia        m    = xm.appendMedia();

            m.makeRootResource(null, null, true);
            Assert.IsNull(xm.getElement_KElement("Media", null, 0));
            Assert.IsNotNull(xm.getElement_JDFElement("Media", null, 0));
        }