示例#1
0
        /** Creates new Page from the parentInput's input stream.
         * The next object in the input stream must be of this type.
         *
         * @param parentInput    the parent RIFF object being used to read the input stream
         */
        public static Page newInstance(Riff parentInput)
        {
            Riff riffInput = new Riff(parentInput, "LIST");
              riffInput.requireFOURCC(RIFF_ID);

              Page page = new Page(RiffPageHeader.newInstance(riffInput));

              while (riffInput.getBytesRemaining() > 0) {
            StaffSystem staffSystem;
            if ((staffSystem = RiffStaffSystem.maybeNew(riffInput)) != null)
              page.addSystem(staffSystem);
            // debug: must check for NIFFFontSymbol, etc.
            else
              // Did not recognize the chunk type, so skip
              riffInput.skipChunk();
              }

              return page;
        }
示例#2
0
 /** Add the given Page to the page list.  After adding, this also calls
  * invalidate().
  *
  * @param page  the Page to add.  It is an error if
  *        this is already the child of an object.
  * @throws HeirarchyException if the page has already
  *      been added as a child to another object.
  * @see #invalidate
  */
 public void addPage(Page page)
 {
     addChild(page);
       invalidate();
 }