Class PreloadingPageRange

java.lang.Object
com.levigo.jadice.web.client.viewer.PreloadingPageRange

public class PreloadingPageRange extends Object
This class is used to configure how many pages should be preloaded. Preloaded means that the tiles of not visible pages will be already rendered with the current RenderControls.
  • Constructor Details

    • PreloadingPageRange

      public PreloadingPageRange()
      Use this constructor if the whole document should be loaded.
    • PreloadingPageRange

      public PreloadingPageRange(boolean startOfDocument, boolean endOfDocument)
      Use this constructor if everything should be preloaded before or after the page and nothing in the other direction.
      Parameters:
      startOfDocument - whether everything before the currently visible pages should be preloaded
      endOfDocument - whether everything after the currently visible pages should be preloaded
    • PreloadingPageRange

      public PreloadingPageRange(int prelodedPages)
      Use this constructor if the number of pages which should be preloaded before and after the visible pages are the same.
      Parameters:
      prelodedPages - the number of pages that should be preloaded
    • PreloadingPageRange

      public PreloadingPageRange(int previousPages, int followingPages)
      Use this constructor if the number of pages which should be preloaded before and after the visible pages are different.
      Parameters:
      previousPages - the number of pages that should be preloaded before the visible pages
      followingPages - the number of pages that should be preloaded after the visible pages
    • PreloadingPageRange

      public PreloadingPageRange(boolean startOfDocument, boolean endOfDocument, int previousPages, int followingPages)
      Use this constructor if everything should be preloaded before or after the page and a specific number of pages in the other direction.
      Parameters:
      startOfDocument - whether everything before the currently visible pages should be preloaded
      endOfDocument - whether everything before the currently visible pages should be preloaded
      previousPages - the number of pages that should be preloaded before the visible pages if startOfDocument is false
      followingPages - the number of pages that should be preloaded after the visible pages if endOfDocument is false
  • Method Details

    • isLoadWholeDocument

      public boolean isLoadWholeDocument()
      Returns:
      true if the whole document should be loaded. This means all pages should be preloaded. Otherwise false.
    • isStartOfDocument

      public boolean isStartOfDocument()
      Returns:
      true if all pages from the beginning until the currently visible pages should be preloaded. Otherwise false.
    • isEndOfDocument

      public boolean isEndOfDocument()
      Returns:
      true if all pages from the currently visible pages until the end of the document should be preloaded. Otherwise false.
    • getFollowingPages

      public int getFollowingPages()
      Returns:
      the exact number of pages after the currently visible page which should be preloaded. Returns 0 if either isEndOfDocument() or isLoadWholeDocument() is true.
    • getPreviousPages

      public int getPreviousPages()
      Returns:
      the exact number of pages before the currently visible pages which should be preloaded. Returns 0 if either isStartOfDocument() or isLoadWholeDocument() is true.
    • toString

      public String toString()
      Overrides:
      toString in class Object