Class PageLoader


  • public class PageLoader
    extends BackgroundTask
    Loads all the PDFPage objects for SUN's PDF Renderer in Background.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean[] busy
      True for pages with page number equal to index + 1 that are being loaded.
      protected boolean[] done
      True for pages with page number equal to index + 1 that have already been loaded.
      protected com.sun.pdfview.PDFFile file
      The PDFFile (SUN's PDF Renderer class)
      protected int numberOfPages
      The total number of pages.
    • Constructor Summary

      Constructors 
      Constructor Description
      PageLoader​(com.sun.pdfview.PDFFile file)
      Creates a new page loader.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doTask()
      Implement this class; the time-consuming task will go here.
      int getNumberOfPages()
      Getter for the number of pages.
      com.sun.pdfview.PDFPage loadPage​(int pageNumber)
      Loads a page.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • file

        protected com.sun.pdfview.PDFFile file
        The PDFFile (SUN's PDF Renderer class)
      • numberOfPages

        protected int numberOfPages
        The total number of pages.
      • busy

        protected boolean[] busy
        True for pages with page number equal to index + 1 that are being loaded.
      • done

        protected boolean[] done
        True for pages with page number equal to index + 1 that have already been loaded.
    • Constructor Detail

      • PageLoader

        public PageLoader​(com.sun.pdfview.PDFFile file)
        Creates a new page loader.
        Parameters:
        file - the PDFFile (SUN's PDF Renderer)
    • Method Detail

      • getNumberOfPages

        public int getNumberOfPages()
        Getter for the number of pages.
        Returns:
        the number of pages in the PDF file.
      • loadPage

        public com.sun.pdfview.PDFPage loadPage​(int pageNumber)
        Loads a page.
        Parameters:
        pageNumber - the number of the page that has to be loaded.
        Returns:
        the PDFPage that has been loaded.