com.levigo.jadice.swing.pageview
Class PageView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.levigo.jadice.swing.ViewComponent
                  extended by com.levigo.jadice.swing.pageview.PageView
All Implemented Interfaces:
MenuContributor, Autoscroll, ImageObserver, MenuContainer, Serializable, Scrollable

public class PageView
extends ViewComponent
implements Autoscroll, Scrollable

Displays a Document's Pages using instances of PageLayout to arrange them.

See Also:
Serialized Form

Nested Class Summary
static class PageView.Layout
          These layout style constants define a set of well-known page layout styles.
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String CURRENT_PAGE_CONTROLS_PROPERTY
          Property key prefix for the getCurrentPageControls().
static String CURRENT_PAGE_INDEX_PROPERTY
          Property key for the getCurrentPageIndex().
static String DOCUMENT_PROPERTY
          Property key for the currently displayed document.
static String DOCUMENT_STATE_PROPERTY
          Property key for the pseudo-property getDocumentState().
static String PAGE_COUNT_PROPERTY
          Property key for the pseudo-property getPageCount().
static String PAGE_LAYOUT_STYLE_PROPERTY
           
static String RENDER_CONTROLS_INVENTORY_PROPERTY
           
static Insets scrollInsets
           
static String UI_CLASS_ID
           
static String VISIBLE_RECT_PROPERTY
           
 
Fields inherited from class com.levigo.jadice.swing.ViewComponent
toolManager
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PageView()
           
 
Method Summary
 void addNotify()
           
 void autoscroll(Point location)
           
 void cleanup()
          Releases references to the Document currently referenced by this ViewComponent, if any.
protected  void finalize()
          Finalization-cleanup.
 int getAdjacentNavigationIndex(Position.Bias bias)
          Return the index of the next (following) or previous page for navigation purposes.
 Insets getAutoscrollInsets()
           
 Page getCurrentPage()
          Return the current page.
 Border getCurrentPageBorder()
           
 RenderControls getCurrentPageControls()
          Returns the render controls of the current page.
 int getCurrentPageIndex()
          Return the current page index.
 Rectangle getCurrentPageVisibleBounds()
          Get the bounds of the viewport with respect to the currently focused page.
 UIDocument<Component> getDocument()
           
 RenderControls getDocumentControls()
          Returns the render controls for the current document.
 Document.State getDocumentState()
          Convenience getter for the document state.
 com.levigo.jadice.swing.pageview.RenderedPage getPageAt(Point p)
          Get the RenderedPage at the given position or null if there is no such page.
 Border getPageBorder()
           
 RenderControls getPageControls(Page page)
          Returns the render controls of the given page.
 RenderControls getPageControls(Page page, boolean create)
          Returns the render controls of the given page.
 int getPageCount()
          Convenience getter for the total number of pages.
 PageView.Layout getPageLayoutStyle()
          Returns the currently applied page layout.
 Point getPanPoint()
          Return the coordinate of the top left point of the current page's visible area in document units.
 Dimension getPreferredScrollableViewportSize()
           
 Prefetcher getPrefetcher()
           
 int getPrefetchRange()
           
 PresentationRuleManager getPresentationRuleManager()
           
 RenderControlInventory getRenderControlsInventory()
          Returns the currently used RenderControlInventory by this PageView.
 int getRepaintDelay()
           
 int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
           
 boolean getScrollableTracksViewportHeight()
           
 boolean getScrollableTracksViewportWidth()
           
 int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
           
 PageViewUI getUI()
          Returns the PageViewUI (!)
 String getUIClassID()
          Returns "ListUI", the UIDefaults key used to look up the name of the javax.swing.plaf.ListUI class that defines the look and feel for this component.
 boolean isFocusTraversable()
          Deprecated. Yes, I know.
 boolean isPrefetchEnabled()
           
 boolean isPreserveRenderSettingsOnDocumentChange()
          Return whether the render settings are shared.
 void paint(Graphics g)
           
protected  void processComponentKeyEvent(KeyEvent e)
           
 void removeNotify()
           
 void repaint(Page p)
          Repaint all of the given page.
 void repaint(Page p, Rectangle2D boundsDU)
          Repaint part of the given page, as specified by the given bounds.
 void reshape(int x, int y, int w, int h)
           
 void scrollRectToVisible(Page targetPage, Rectangle2D rectDU)
          Instructs the PageView to scroll to the given targetPage and ensures that the target rectangle is visible.
 void setCurrentPageBorder(Border currentPageBorder)
           
 void setCurrentPageIndex(int i)
          Navigate to the given page number.
 void setDocument(Document doc)
          Changes the Document to be displayed within this PageView instance.
 void setPageBorder(Border pageBorder)
          Set the page decoration border.
 void setPageLayoutStyle(PageView.Layout layout)
          Changes the layout style responsible for laying out pages to be displayed in page view.
 void setPrefetchEnabled(boolean prefetchEnabled)
           
 void setPrefetcher(Prefetcher prefetcher)
           
 void setPrefetchRange(int prefetchRange)
           
 void setPreserveRenderSettingsOnDocumentChange(boolean preserveRenderSettings)
          Set whether to use shared render settings (true) or private ones ( false).
 void setRepaintDelay(int repaintDelay)
           
 void setUI(PageViewUI ui)
          Sets the PageViewUI, the look and feel object that renders this component.
 void updateUI()
          Resets the UI property with the value from the current look and feel.
 
Methods inherited from class com.levigo.jadice.swing.ViewComponent
contribute, findViewport, getToolManager
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PAGE_LAYOUT_STYLE_PROPERTY

public static final String PAGE_LAYOUT_STYLE_PROPERTY
See Also:
Constant Field Values

RENDER_CONTROLS_INVENTORY_PROPERTY

public static final String RENDER_CONTROLS_INVENTORY_PROPERTY
See Also:
Constant Field Values

VISIBLE_RECT_PROPERTY

public static final String VISIBLE_RECT_PROPERTY
See Also:
Constant Field Values

scrollInsets

public static final Insets scrollInsets

UI_CLASS_ID

public static final String UI_CLASS_ID
See Also:
Constant Field Values

CURRENT_PAGE_CONTROLS_PROPERTY

public static final String CURRENT_PAGE_CONTROLS_PROPERTY
Property key prefix for the getCurrentPageControls(). For convenience reasons, a change for this property is fired, whenever some aspect of the RenderControls changes. However, this very key is never used, instead a hierarchical property key is formed in the following way: currentPageControls.[RenderControlsClassName].[propertyName]. So, for instance, a change of the zoom property is propagated as currentPageControls.BaseRenderSettings.zoom.

See Also:
getCurrentPageControls(), Constant Field Values

CURRENT_PAGE_INDEX_PROPERTY

public static final String CURRENT_PAGE_INDEX_PROPERTY
Property key for the getCurrentPageIndex().

See Also:
getCurrentPageIndex(), Constant Field Values

PAGE_COUNT_PROPERTY

public static final String PAGE_COUNT_PROPERTY
Property key for the pseudo-property getPageCount().

See Also:
getPageCount(), Constant Field Values

DOCUMENT_STATE_PROPERTY

public static final String DOCUMENT_STATE_PROPERTY
Property key for the pseudo-property getDocumentState().

See Also:
getDocumentState(), Constant Field Values

DOCUMENT_PROPERTY

public static final String DOCUMENT_PROPERTY
Property key for the currently displayed document.

See Also:
getDocument(), setDocument(Document), Constant Field Values
Constructor Detail

PageView

@CallOnEDT
public PageView()
Throws:
IllegalStateException - if the calling thread is not the Event Dispatch Thread
Method Detail

getDocument

@CallableOffEDT
public UIDocument<Component> getDocument()
Specified by:
getDocument in class ViewComponent
Returns:
the Document instance currently displayed by this ViewComponent.

setDocument

@CallOnEDT
public void setDocument(Document doc)
Changes the Document to be displayed within this PageView instance. If no Document shall be displayed, use null as parameter.

NOTE: This method must not be called on a thread other than the Event Dispatch Thread. For details please see: TGASwingUtil.ensureEventDispatchThread().

Parameters:
doc - the Document to be displayed, or null in order to clear the PageView.
Throws:
IllegalStateException - if the calling thread is not the Event Dispatch Thread

cleanup

@CallableOffEDT
public void cleanup()
Releases references to the Document currently referenced by this ViewComponent, if any. This method is intended for final clean-up purposes exclusively and may be called off-EDT. It can be used in situations where it is not possible to call setDocument(Document) (with null parameter). Typically this would be the case where it is not possible to wait for the next EDT cycle.

Note that this method is not an off-EDT replacement for setDocument(Document) (with parameter null). It mainly releases references; it doesn't necessarily perform all the steps which would be taken in setDocument(Document) (with parameter null). The usage of setDocument(Document) should therefore be preferred whenever possible.

Specified by:
cleanup in class ViewComponent
See Also:
setDocument(Document)

getRenderControlsInventory

@CallOnEDT
public RenderControlInventory getRenderControlsInventory()
Returns the currently used RenderControlInventory by this PageView.

To support multi viewer usage of one single document instance, viewers always works on snapshots of document render control inventories. As a consequence the returned inventory instance must not be the same instance returned by a call of RenderControlInventory.get(Document) or RenderControlInventory.get(Document, boolean).
For the same reason, changes done to this snapshot inventory are not recognized by any other PageView instance and the lifetime of this snapshot ends when the document will be exchanged with a call of setDocument(Document).

If developers want to change render settings in a render control inventory, it is strongly recommended to use only one of the two following recommended ways:

Recommendation
Document is used in a PageView instance? Recommended way to do changes
Yes Use getRenderControlsInventory() method of the target PageView instance and do the changes.
It is not a guaranteed feature that the concluded changes are recognized by the target PageView instance. It is up to the developer to decide based on the type of changes whether to force a PageView update or not.
No Use RenderControlInventory.get(Document) or RenderControlInventory.get(Document, boolean) to get an inventory reference and do the desired modifications.

Returns:
the currently used RenderControlInventory instance

getCurrentPage

@CallOnEDT
public Page getCurrentPage()
Return the current page.

Returns:
the current page or null if there is none.

getPageAt

@CallOnEDT
public com.levigo.jadice.swing.pageview.RenderedPage getPageAt(Point p)
Get the RenderedPage at the given position or null if there is no such page.

Parameters:
p -
Returns:
an ArrangedPage

addNotify

public void addNotify()
Overrides:
addNotify in class JComponent
See Also:
JComponent.addNotify()

autoscroll

@CallOnEDT
public void autoscroll(Point location)
Specified by:
autoscroll in interface Autoscroll
See Also:
Autoscroll.autoscroll(java.awt.Point)

finalize

protected void finalize()
                 throws Throwable
Finalization-cleanup.

Overrides:
finalize in class Object
Throws:
Throwable
See Also:
Object.finalize()

getAutoscrollInsets

@CallOnEDT
public Insets getAutoscrollInsets()
Specified by:
getAutoscrollInsets in interface Autoscroll
See Also:
Autoscroll.getAutoscrollInsets()

getUIClassID

@CallableOffEDT
public String getUIClassID()
Returns "ListUI", the UIDefaults key used to look up the name of the javax.swing.plaf.ListUI class that defines the look and feel for this component.

Overrides:
getUIClassID in class JComponent
Returns:
the value of UI_CLASS_ID
See Also:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

processComponentKeyEvent

protected void processComponentKeyEvent(KeyEvent e)
Overrides:
processComponentKeyEvent in class JComponent

isFocusTraversable

@Deprecated
@CallOnEDT
public boolean isFocusTraversable()
Deprecated. Yes, I know.

Overrides:
isFocusTraversable in class Component
See Also:
Component.isFocusTraversable()

paint

@CallOnEDT
public void paint(Graphics g)
Overrides:
paint in class JComponent
See Also:
JComponent.paint(java.awt.Graphics)

getDocumentControls

@CallOnEDT
public RenderControls getDocumentControls()
Returns the render controls for the current document. If no current document is available, a default render controls object will be returned.

Modifications of the render controls are allowed, but should be done carefully. The recommended way to change render controls should be done via a reference of a RenderControlInventory. See the getRenderControlsInventory() comment for the recommended ways.

Returns:
the document controls

getCurrentPageControls

@CallOnEDT
public RenderControls getCurrentPageControls()
Returns the render controls of the current page. Modifications of the render controls are allowed, but should be done carefully. The recommended way to change render controls should be done via the RenderControlInventory.

If no render control is available for the current page, the document render control will be returned.

Returns:
the render controls reference of the current page, either based on a per-page controls instance or the document controls.

getPageControls

@CallOnEDT
public RenderControls getPageControls(Page page)
Returns the render controls of the given page. Modifications of the render controls are allowed, but should be done carefully. The recommended way to change render controls should be done via the RenderControlInventory.

If no render control is available for the given page, the document render control will be returned.

Parameters:
page - the page the lookup should be done for
Returns:
the render controls reference of the given page, either based on a per-page controls instance or the document controls.

getPageControls

@CallOnEDT
public RenderControls getPageControls(Page page,
                                                boolean create)
Returns the render controls of the given page.

If no render controls is available for given page, the create parameter decides whether it should be created and returned. If the create parameter is false and no page render controls is available, the document render controls will be returned.

Modifications of the render controls are allowed, but should be done carefully. The recommended way to change render controls should be done via a reference of a RenderControlInventory. See getRenderControlsInventory() comment for the recommended ways.

Parameters:
page - the page the lookup should be done for
create - whether a render controls instance should be created if not available
Returns:
the render controls reference of the given page. If no render controls instance is available for the given page, the parameter create decides, whether a new one should be created or not. If not available and it should not be created, the document render controls will be returned.
Throws:
IllegalArgumentException - if the given page is null

removeNotify

public void removeNotify()
Overrides:
removeNotify in class JComponent
See Also:
JComponent.removeNotify()

reshape

@CallOnEDT
public void reshape(int x,
                              int y,
                              int w,
                              int h)
Overrides:
reshape in class JComponent

setUI

@CallOnEDT
public void setUI(PageViewUI ui)
Sets the PageViewUI, the look and feel object that renders this component.

Parameters:
ui - the PageViewUI object
Throws:
IllegalStateException - if the calling thread is not the Event Dispatch Thread
See Also:
UIDefaults.getUI(javax.swing.JComponent)

updateUI

@CallOnEDT
public void updateUI()
Resets the UI property with the value from the current look and feel.

Overrides:
updateUI in class JComponent
Throws:
IllegalStateException - if the calling thread is not the Event Dispatch Thread
See Also:
UIManager.getUI(javax.swing.JComponent)

getUI

@CallOnEDT
public PageViewUI getUI()
Returns the PageViewUI (!) used to render this component.

Returns:
the PageViewUI object that renders this component

setCurrentPageIndex

@CallOnEDT
public void setCurrentPageIndex(int i)
Navigate to the given page number. This is a zero-based index.

NOTE: This method must not be called on a thread other than the Event Dispatch Thread. For details please see: TGASwingUtil.ensureEventDispatchThread()

Parameters:
i - the page index to be navigated to
Throws:
NullPointerException - if there is no document to be displayed
IllegalStateException - if the calling thread is not the Event Dispatch Thread

getCurrentPageIndex

@CallOnEDT
public int getCurrentPageIndex()
Return the current page index. This is a zero-based value.
It is up to the page layout to determine the current page index. Please note that, depending on the page layout, the current page number may or may not be the one you most recently navigated to.
In other words:
pageView.setCurrentPageIndex(x); assert pageView.getCurrentPageIndex() == x; Does not necessarily hold.

Returns:
the current page number as determined by the current page layout.

getAdjacentNavigationIndex

@CallOnEDT
public int getAdjacentNavigationIndex(Position.Bias bias)
Return the index of the next (following) or previous page for navigation purposes. This is a zero-based value.
It is up to the page layout to determine what is considered to be the next page. Please note that, the next page is not necessarily the next-higher/lower integer to the value returned from getCurrentPageIndex().
In other words:
assert pageView.getCurrentPageIndex() + 1 == pageView.getAdjacentNavigationIndex(Bias.Forward); Does not necessarily hold.

Parameters:
bias - the direction for which to return the next index. See Position.Bias.Forward, Position.Bias.Backward.
Returns:
the adjacent page index

getPageCount

public int getPageCount()
Convenience getter for the total number of pages. If there is a document, it is equivalent to getDocument().getPageCount(). Otherwise it returns 0.

Returns:
the document's page count or 0

getDocumentState

public Document.State getDocumentState()
Convenience getter for the document state. If there is a document, it is equivalent to getDocument().getState(). Otherwise it returns Document.BasicState.UNKNOWN.

Returns:
the document's state or Document.BasicState.UNKNOWN

getPanPoint

@CallOnEDT
public Point getPanPoint()
Return the coordinate of the top left point of the current page's visible area in document units. This is equivalent to getCurrentPageVisibleBounds() .getLocation() .

Returns:
the pan point

getCurrentPageVisibleBounds

@CallOnEDT
public Rectangle getCurrentPageVisibleBounds()
Get the bounds of the viewport with respect to the currently focused page. The bounds are normalized to document space.

Returns:
Rectangle the intersection of the viewport bounds and visible page part

getPageLayoutStyle

@CallOnEDT
public PageView.Layout getPageLayoutStyle()
Returns the currently applied page layout.

Returns:
current page layout
See Also:
PageView.Layout

setPageLayoutStyle

@CallOnEDT
public void setPageLayoutStyle(PageView.Layout layout)
Changes the layout style responsible for laying out pages to be displayed in page view.

NOTE: This method must not be called on a thread other than the Event Dispatch Thread. For details please see: TGASwingUtil.ensureEventDispatchThread()

Parameters:
layout - the new layout style to display the pages. For the available layout styles see PageView.Layout
Throws:
IllegalStateException - if the calling thread is not the Event Dispatch Thread
NullPointerException - if given layout style parameter is null
See Also:
PageView.Layout.PAGE, PageView.Layout.CONTINUOUS_PAGE, PageView.Layout.SPREAD, PageView.Layout.CONTINUOUS_SPREAD, PageView.Layout.GRID

setPageBorder

@CallOnEDT
public void setPageBorder(Border pageBorder)
Set the page decoration border.

Parameters:
pageBorder -
Throws:
IllegalStateException - if the calling thread is not the Event Dispatch Thread

getPageBorder

@CallOnEDT
public Border getPageBorder()

scrollRectToVisible

@CallOnEDT
public void scrollRectToVisible(Page targetPage,
                                          Rectangle2D rectDU)
Instructs the PageView to scroll to the given targetPage and ensures that the target rectangle is visible. The target rectangle is expressed in document base coordinates .

Parameters:
targetPage - the page to scroll to visibility
rectDU - the bounds to scroll to visibility in document units.

repaint

public void repaint(Page p)
Description copied from class: ViewComponent
Repaint all of the given page.

Specified by:
repaint in class ViewComponent
Parameters:
p - the page to repaint

repaint

public void repaint(Page p,
                    Rectangle2D boundsDU)
Description copied from class: ViewComponent
Repaint part of the given page, as specified by the given bounds.

Specified by:
repaint in class ViewComponent
Parameters:
p - the page to repaint
boundsDU - the bounds within the page to repaint.

getPreferredScrollableViewportSize

@CallOnEDT
public Dimension getPreferredScrollableViewportSize()
Specified by:
getPreferredScrollableViewportSize in interface Scrollable

getScrollableUnitIncrement

@CallOnEDT
public int getScrollableUnitIncrement(Rectangle visibleRect,
                                                int orientation,
                                                int direction)
Specified by:
getScrollableUnitIncrement in interface Scrollable

getScrollableBlockIncrement

@CallOnEDT
public int getScrollableBlockIncrement(Rectangle visibleRect,
                                                 int orientation,
                                                 int direction)
Specified by:
getScrollableBlockIncrement in interface Scrollable

getScrollableTracksViewportWidth

@CallOnEDT
public boolean getScrollableTracksViewportWidth()
Specified by:
getScrollableTracksViewportWidth in interface Scrollable

getScrollableTracksViewportHeight

@CallOnEDT
public boolean getScrollableTracksViewportHeight()
Specified by:
getScrollableTracksViewportHeight in interface Scrollable

getPresentationRuleManager

public PresentationRuleManager getPresentationRuleManager()

getCurrentPageBorder

@CallOnEDT
public Border getCurrentPageBorder()

setCurrentPageBorder

@CallOnEDT
public void setCurrentPageBorder(Border currentPageBorder)
Throws:
IllegalStateException - if the calling thread is not the Event Dispatch Thread

setPrefetcher

public void setPrefetcher(Prefetcher prefetcher)

getPrefetcher

public Prefetcher getPrefetcher()

setPreserveRenderSettingsOnDocumentChange

public void setPreserveRenderSettingsOnDocumentChange(boolean preserveRenderSettings)
Set whether to use shared render settings (true) or private ones ( false). When using shared render settings the settings are stored with the document, and shared with other PageViews in which this document is displayed.

Parameters:
preserveRenderSettings -

isPreserveRenderSettingsOnDocumentChange

public boolean isPreserveRenderSettingsOnDocumentChange()
Return whether the render settings are shared.

Returns:
true if the render settings are shared

setPrefetchEnabled

public void setPrefetchEnabled(boolean prefetchEnabled)

isPrefetchEnabled

public boolean isPrefetchEnabled()

setPrefetchRange

public void setPrefetchRange(int prefetchRange)

getPrefetchRange

public int getPrefetchRange()

setRepaintDelay

public void setRepaintDelay(int repaintDelay)

getRepaintDelay

public int getRepaintDelay()


Copyright © 2017 levigo holding gmbh. All rights reserved.