コード例 #1
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);
        }