Exemplo n.º 1
0
        private PageMaster GetNextPageMaster(string pageSequenceName,
                                             int currentPageNumber,
                                             bool thisIsFirstPage,
                                             bool isEmptyPage)
        {
            PageMaster pageMaster = null;

            PageSequenceMaster sequenceMaster =
                this.layoutMasterSet.getPageSequenceMaster(pageSequenceName);

            if (sequenceMaster != null)
            {
                pageMaster = GetNextSimplePageMaster(sequenceMaster,
                                                     currentPageNumber,
                                                     thisIsFirstPage,
                                                     isEmptyPage).getPageMaster();
            }
            else
            {
                SimplePageMaster simpleMaster =
                    this.layoutMasterSet.getSimplePageMaster(pageSequenceName);
                if (simpleMaster == null)
                {
                    throw new FonetException("'master-reference' for 'fo:page-sequence'"
                                             + "matches no 'simple-page-master' or 'page-sequence-master'");
                }
                currentPageMasterName = pageSequenceName;

                pageMaster = simpleMaster.GetNextPageMaster();
            }
            return(pageMaster);
        }
        public RepeatablePageMasterAlternatives(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            conditionalPageMasterRefs = new ArrayList();

            if (parent.ElementName.Equals("fo:page-sequence-master"))
            {
                this.pageSequenceMaster = (PageSequenceMaster)parent;
                this.pageSequenceMaster.AddSubsequenceSpecifier(this);
            }
            else
            {
                throw new FonetException("fo:repeatable-page-master-alternatives"
                                         + "must be child of fo:page-sequence-master, not "
                                         + parent.ElementName);
            }

            string mr = GetProperty("maximum-repeats").GetString();

            if (mr.Equals("no-limit"))
            {
                setMaximumRepeats(INFINITE);
            }
            else
            {
                try
                {
                    setMaximumRepeats(Int32.Parse(mr));
                }
                catch (FormatException)
                {
                    throw new FonetException("Invalid number for 'maximum-repeats' property");
                }
            }
        }
Exemplo n.º 3
0
 protected internal void addPageSequenceMaster(string masterName, PageSequenceMaster pageSequenceMaster)
 {
     if (existsName(masterName))
     {
         throw new FonetException("'master-name' (" + masterName
             + ") must be unique "
             + "across page-masters and page-sequence-masters");
     }
     this.pageSequenceMasters.Add(masterName, pageSequenceMaster);
 }
Exemplo n.º 4
0
 protected internal void addPageSequenceMaster(string masterName, PageSequenceMaster pageSequenceMaster)
 {
     if (existsName(masterName))
     {
         throw new FonetException("'master-name' (" + masterName
                                  + ") must be unique "
                                  + "across page-masters and page-sequence-masters");
     }
     this.pageSequenceMasters.Add(masterName, pageSequenceMaster);
 }
Exemplo n.º 5
0
        private SimplePageMaster GetNextSimplePageMaster(PageSequenceMaster sequenceMaster,
                                                         int currentPageNumber, bool thisIsFirstPage,
                                                         bool isEmptyPage)
        {
            if (isForcing)
            {
                return(this.layoutMasterSet.getSimplePageMaster(
                           GetNextPageMasterName(sequenceMaster, currentPageNumber, false, true)));
            }
            string nextPageMaster =
                GetNextPageMasterName(sequenceMaster, currentPageNumber, thisIsFirstPage, isEmptyPage);

            return(this.layoutMasterSet.getSimplePageMaster(nextPageMaster));
        }
Exemplo n.º 6
0
 private SubSequenceSpecifier GetNextSubsequence(PageSequenceMaster master)
 {
     if (master.GetSubSequenceSpecifierCount()
         > currentSubsequenceNumber + 1)
     {
         currentSubsequence =
             master.getSubSequenceSpecifier(currentSubsequenceNumber + 1);
         currentSubsequenceNumber++;
         return(currentSubsequence);
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 7
0
        private string GetNextPageMasterName(PageSequenceMaster sequenceMaster,
                                             int currentPageNumber,
                                             bool thisIsFirstPage,
                                             bool isEmptyPage)
        {
            if (null == currentSubsequence)
            {
                currentSubsequence = GetNextSubsequence(sequenceMaster);
            }

            string nextPageMaster =
                currentSubsequence.GetNextPageMaster(currentPageNumber,
                                                     thisIsFirstPage,
                                                     isEmptyPage);


            if (null == nextPageMaster ||
                IsFlowForMasterNameDone(currentPageMasterName))
            {
                SubSequenceSpecifier nextSubsequence =
                    GetNextSubsequence(sequenceMaster);
                if (nextSubsequence == null)
                {
                    FonetDriver.ActiveDriver.FireFonetError(
                        "Page subsequences exhausted. Using previous subsequence.");
                    thisIsFirstPage =
                        true;
                    currentSubsequence.Reset();
                }
                else
                {
                    currentSubsequence = nextSubsequence;
                }

                nextPageMaster =
                    currentSubsequence.GetNextPageMaster(currentPageNumber,
                                                         thisIsFirstPage,
                                                         isEmptyPage);
            }
            currentPageMasterName = nextPageMaster;

            return(nextPageMaster);
        }
        public RepeatablePageMasterAlternatives(FObj parent, PropertyList propertyList)
            : base(parent, propertyList)
        {
            this.name = "fo:repeatable-page-master-alternatives";

            conditionalPageMasterRefs = new ArrayList();

            if (parent.GetName().Equals("fo:page-sequence-master"))
            {
                this.pageSequenceMaster = (PageSequenceMaster)parent;
                this.pageSequenceMaster.AddSubsequenceSpecifier(this);
            }
            else
            {
                throw new FonetException("fo:repeatable-page-master-alternatives"
                    + "must be child of fo:page-sequence-master, not "
                    + parent.GetName());
            }

            string mr = GetProperty("maximum-repeats").GetString();
            if (mr.Equals("no-limit"))
            {
                setMaximumRepeats(INFINITE);
            }
            else
            {
                try
                {
                    setMaximumRepeats(Int32.Parse(mr));
                }
                catch (FormatException)
                {
                    throw new FonetException("Invalid number for 'maximum-repeats' property");
                }
            }

        }
Exemplo n.º 9
0
        private string GetNextPageMasterName(PageSequenceMaster sequenceMaster,
                                             int currentPageNumber,
                                             bool thisIsFirstPage,
                                             bool isEmptyPage)
        {
            if (null == currentSubsequence)
            {
                currentSubsequence = GetNextSubsequence(sequenceMaster);
            }

            string nextPageMaster =
                currentSubsequence.GetNextPageMaster(currentPageNumber,
                                                     thisIsFirstPage,
                                                     isEmptyPage);


            if (null == nextPageMaster
                || IsFlowForMasterNameDone(currentPageMasterName))
            {
                SubSequenceSpecifier nextSubsequence =
                    GetNextSubsequence(sequenceMaster);
                if (nextSubsequence == null)
                {
                    FonetDriver.ActiveDriver.FireFonetError(
                        "Page subsequences exhausted. Using previous subsequence.");
                    thisIsFirstPage =
                        true;
                    currentSubsequence.Reset();
                }
                else
                {
                    currentSubsequence = nextSubsequence;
                }

                nextPageMaster =
                    currentSubsequence.GetNextPageMaster(currentPageNumber,
                                                         thisIsFirstPage,
                                                         isEmptyPage);
            }
            currentPageMasterName = nextPageMaster;

            return nextPageMaster;

        }
Exemplo n.º 10
0
        private SimplePageMaster GetNextSimplePageMaster(PageSequenceMaster sequenceMaster,
                                                         int currentPageNumber, bool thisIsFirstPage,
                                                         bool isEmptyPage)
        {
            if (isForcing)
            {
                return this.layoutMasterSet.getSimplePageMaster(
                    GetNextPageMasterName(sequenceMaster, currentPageNumber, false, true));
            }
            string nextPageMaster =
                GetNextPageMasterName(sequenceMaster, currentPageNumber, thisIsFirstPage, isEmptyPage);
            return this.layoutMasterSet.getSimplePageMaster(nextPageMaster);

        }
Exemplo n.º 11
0
 private SubSequenceSpecifier GetNextSubsequence(PageSequenceMaster master)
 {
     if (master.GetSubSequenceSpecifierCount()
         > currentSubsequenceNumber + 1)
     {
         currentSubsequence =
             master.getSubSequenceSpecifier(currentSubsequenceNumber + 1);
         currentSubsequenceNumber++;
         return currentSubsequence;
     }
     else
     {
         return null;
     }
 }