public virtual void testEnumerations() { JDFDoc d = new JDFDoc(ElementName.JDF); JDFNode r = d.getJDFRoot(); JDFColorPool cp = (JDFColorPool)r.addResource("ColorPool", null, EnumUsage.Input, null, null, null, null); JDFColor col = cp.appendColor(); col.setColorName(EnumNamedColor.Red); Assert.IsTrue(col.getColorName() == EnumNamedColor.Red, "named color get"); Assert.IsTrue(col.getAttribute(AttributeName.COLORNAME) == "Red", "named color get raw"); }
/// /// * <param name="icsLevel"> </param> /// protected internal virtual void makeReadyColorantControl() { JDFColorantControl cc = (JDFColorantControl)theExpandedNode.getCreateResource(ElementName.COLORANTCONTROL, EnumUsage.Input, 0); JDFColorPool cp = cc.getCreateColorPool(); for (int i = 0; i < getNCols(); i++) { string name = cols.stringAt(i); JDFColor c = cp.getCreateColorWithName(name, null); c.setActualColorName(colsActual.stringAt(i)); } }
/// /// <summary> * zapp any direct links to colorpool </summary> /// protected internal override void initColorantControl() { base.initColorantControl(); JDFColorPool cp = (JDFColorPool)theNode.getResource(ElementName.COLORPOOL, EnumUsage.Input, 0); if (cp != null) { JDFResourceLink rl = theNode.getLink(cp, EnumUsage.Input); if (rl != null) { rl.deleteNode(); } } }
public override void setUp() { try { base.setUp(); } catch (Exception) { // } JDFDoc d = new JDFDoc("JDF"); JDFNode n = d.getJDFRoot(); n.setType("Interpreting", false); cp = (JDFColorPool)n.addResource("ColorPool", null, EnumUsage.Input, null, null, null, null); cp.appendColorWithName("Cyan", "true"); cp.appendColorWithName("Grün", "Grün"); ((JDFColor)cp.appendElement("jdf:Color", JDFElement.getSchemaURL())).setName("foo"); }
/// /// <summary> * (31) create inter-resource link to refTarget </summary> /// * <param name="refTarget"> the element that is referenced </param> /// public virtual void refColorPool(JDFColorPool refTarget) { refElement(refTarget); }
/// /// * <param name="icsLevel"> </param> /// protected internal virtual void initColorantControl() { JDFResourceLink ccLink = null; if (thePreviousNode != null) { ccLink = theNode.linkResource(thePreviousNode.getResource(ElementName.COLORANTCONTROL, EnumUsage.Input, 0), EnumUsage.Input, null); } if (ccLink == null && theParentNode != null) { ccLink = theNode.linkResource(theParentNode.getResource(ElementName.COLORANTCONTROL, EnumUsage.Input, 0), EnumUsage.Input, null); } JDFColorantControl cc = (JDFColorantControl)(ccLink == null ? (JDFColorantControl)theNode.getCreateResource(ElementName.COLORANTCONTROL, EnumUsage.Input, 0) : ccLink.getTarget()); cc.setResStatus(EnumResStatus.Available, false); JDFColorPool cp = (JDFColorPool)theNode.getJDFRoot().getChildByTagName(ElementName.COLORPOOL, null, 0, null, false, false); if (cp == null) { cp = (JDFColorPool)theNode.getCreateResource(ElementName.COLORPOOL, EnumUsage.Input, 0); if (theParentNode != null) { theParentNode.getCreateResourcePool().moveElement(cp, null); } } cc.refColorPool(cp); for (int i = 4; i < getNCols(); i++) { cc.getCreateColorantParams().appendSeparation(cols.stringAt(i)); } for (int i = 0; i < getNCols(); i++) { string name = cols.stringAt(i); JDFColor c = cp.getCreateColorWithName(name, null); if (i == 0) { c.setCMYK(new JDFCMYKColor(1, 0, 0, 0)); } if (i == 1) { c.setCMYK(new JDFCMYKColor(0, 1, 0, 0)); } if (i == 2) { c.setCMYK(new JDFCMYKColor(0, 0, 1, 0)); } if (i == 3) { c.setCMYK(new JDFCMYKColor(0, 0, 0, 1)); } } cc.setProcessColorModel("DeviceCMYK"); if (nCols[0] != nCols[1]) { for (int ii = 0; ii < 2; ii++) { JDFColorantControl ccP = (JDFColorantControl)cc.addPartition(EnumPartIDKey.Side, ii == 0 ? "Front" : "Back"); VString colsP = new VString(); for (int iii = 0; iii < nCols[ii]; iii++) { colsP.Add(cols.stringAt(iii)); } JDFSeparationList co = ccP.getCreateColorantOrder(); co.setSeparations(colsP); } } else { JDFSeparationList co = cc.getCreateColorantOrder(); co.setSeparations(cols); } }