com.teamdev.jxdocument
Class SinglePagePresentation

java.lang.Object
  extended by com.teamdev.jxdocument.DocumentPresentation
      extended by com.teamdev.jxdocument.SinglePagePresentation

public class SinglePagePresentation
extends DocumentPresentation

An implementation of the DocumentPresentation that displays a specified Page of PDF Document that fits Swing component size. Page size will be changed dynamically when you resize component.


Constructor Summary
SinglePagePresentation(Document document)
          Constructs a new SinglePagePresentation instance for specified document.
 
Method Summary
 void displayPage(int pageIndex)
          Displays a Page of the document at specified pageIndex.
 void displayPage(Page page)
          Displays a specified page of the document.
 javax.swing.JComponent getComponent()
          Returns Java Swing component that can display PDF Document.
 
Methods inherited from class com.teamdev.jxdocument.DocumentPresentation
getDocument
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SinglePagePresentation

public SinglePagePresentation(Document document)
Constructs a new SinglePagePresentation instance for specified document.

Method Detail

getComponent

public javax.swing.JComponent getComponent()
Description copied from class: DocumentPresentation
Returns Java Swing component that can display PDF Document. Each implementation of the current abstract class decides itself how exactly PDF Document will be displayed: only single page is displayed, the whole document with scrolling, two page at one screen etc.

Specified by:
getComponent in class DocumentPresentation
Returns:
Swing component that displays PDF Document.

displayPage

public void displayPage(int pageIndex)
Displays a Page of the document at specified pageIndex.

Parameters:
pageIndex - an index of the Page that must be displayed.
Throws:
java.lang.IllegalArgumentException - when pageIndex < 0 or > total pages count.

displayPage

public void displayPage(Page page)
Displays a specified page of the document.

Parameters:
page - an instance of the Page that must be displayed. Cannot be null.
Throws:
java.lang.IllegalArgumentException - when page is null.