Exemple #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"));
        }