Example #1
0
        public void testSeparationList()
        {
            JDFDoc          doc     = new JDFDoc("JDF");
            JDFNode         root    = doc.getJDFRoot();
            JDFResourcePool resPool = root.getCreateResourcePool();
            KElement        kElem   = resPool.appendResource(ElementName.COLORANTCONTROL, null, null);

            Assert.IsTrue(kElem is JDFColorantControl);
            JDFColorantControl cc   = ((JDFColorantControl)kElem);
            JDFSeparationList  co   = cc.appendColorantOrder();
            VString            seps = new VString(StringUtil.tokenize("Cyan Magenta Yellow Black", " ", false));

            co.setSeparations(seps);
            CollectionAssert.AreEqual(co.getSeparations(), seps);
            VElement vSepSpec = co.getChildElementVector(ElementName.SEPARATIONSPEC, null, null, true, 0, true);

            Assert.AreEqual(seps.Count, vSepSpec.Count);
            for (int i = 0; i < vSepSpec.Count; i++)
            {
                Assert.IsFalse(vSepSpec.item(i).hasAttribute(AttributeName.CLASS));
                Assert.IsFalse(vSepSpec.item(i) is JDFResource);
            }

            Assert.AreEqual("Cyan", co.getSeparation(0));
            co.removeSeparation("Magenta");
            Assert.AreEqual("Cyan", co.getSeparation(0));
            Assert.AreEqual("Yellow", co.getSeparation(1));
            Assert.AreEqual("Black", co.getSeparation(2));
            Assert.IsNull(co.getSeparation(3));
        }
Example #2
0
        public override void setUp()
        {
            base.setUp();
            JDFElement.setLongID(false);
            d    = new JDFDoc(ElementName.JDF);
            elem = d.getJDFRoot();
            JDFResourcePool rpool = elem.appendResourcePool();

            colControl = (JDFColorantControl)rpool.appendResource(ElementName.COLORANTCONTROL, EnumResourceClass.Parameter, null);
            colControl.setProcessColorModel("DeviceCMYK");
            colControl.setResStatus(EnumResStatus.Available, true);
            colParams = colControl.appendColorantParams();
            colPool   = colControl.appendColorPool();
            colPool.makeRootResource(null, null, true);
        }
Example #3
0
        public void testGetSeparations()
        {
            JDFDoc          doc     = new JDFDoc("JDF");
            JDFNode         root    = doc.getJDFRoot();
            JDFResourcePool resPool = root.getCreateResourcePool();
            KElement        kElem   = resPool.appendResource(ElementName.COLORANTCONTROL, null, null);

            Assert.IsTrue(kElem is JDFColorantControl);
            JDFColorantControl cc = ((JDFColorantControl)kElem);

            cc.setProcessColorModel("DeviceCMYK");
            Assert.IsTrue(cc.getSeparations().Contains("Cyan"));
            cc.appendColorantParams().appendSeparation("Snarf Blue");
            Assert.IsTrue(cc.getSeparations().Contains("Snarf Blue"));
        }