org.apache.fop.render.awt.viewer

Class ImageProxyPanel


public class ImageProxyPanel
extends JPanel

Panel used to display a single page of a document. This is basically a lazy-load display panel which gets the size of the image for layout purposes but doesn't get the actual image data until needed. The image data is then accessed via a soft reference, so it will be garbage collected when moving through large documents.

Constructor Summary

ImageProxyPanel(AWTRenderer renderer, int page)
Panel constructor.

Method Summary

Dimension
getMinimumSize()
Dimension
getPreferredSize()
void
paintComponent(Graphics graphics)
Gets the image data and paints it on screen.
void
setPage(int pg)
Sets the number of the page to be displayed and refreshes the display.

Constructor Details

ImageProxyPanel

public ImageProxyPanel(AWTRenderer renderer,
                       int page)
Panel constructor. Doesn't allocate anything until needed.
Parameters:
renderer - the AWTRenderer instance to use for painting
page - initial page number to show

Method Details

getMinimumSize

public Dimension getMinimumSize()
Returns:
the size of the page plus the border.

getPreferredSize

public Dimension getPreferredSize()
Returns:
the size of the page plus the border.

paintComponent

public void paintComponent(Graphics graphics)
Gets the image data and paints it on screen. Will make calls to getPageImage as required.
Parameters:
graphics -

setPage

public void setPage(int pg)
Sets the number of the page to be displayed and refreshes the display.
Parameters:
pg - the page number

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.