ice.storm
Interface StormPrinter

All Known Implementing Classes:
AbstractStormPrinter

public interface StormPrinter

Printing interface in Storm. A Pilot that has print capabilities returns an object that implements this interface via Pilot.createPrinter(). If there is no object that implements this interface, null is returned to the caller.


Method Summary
 void dispose()
          Dispose of this printer
 Dimension getDimension()
          Gets the dimension of the pilots layout in points.
 int getPageCount()
          Gets the total number of pages for the given StormPageFormat.
 int getPageIndex()
          Return the current page index.
 StormPageFormat getStormPageFormat()
          Gets the StormPageFormat representing the page format properties.
 int getZoom()
          Deprecated. As of 6.0, replaced by StormPageFormat.getScale()
 boolean layoutNextPage()
          Deprecated. As of 6.0, replaced by #printPage(Graphics g,int pageIndex
 void print(Graphics g)
          Print the full Graphics rendering of the pilot view with out pagination.
 void printPage(Graphics g)
          Deprecated.  
 void printPage(Graphics g, int pageIndex)
          Print the page specified by pageNumber to g.
 void setPageIndex(int pageIndex)
          Set the current page index to pageIndex.
 void setPageSize(int width, int height)
          Deprecated. As of 6.0, replaced by StormPageFormat.setPageSize(ice.util.unit.Unit, ice.util.unit.Unit)
 void setStormPageFormat(StormPageFormat stormPageFormat)
          Sets a new StormPageFormat object with the printer.
 void setZoom(int zoom)
          Deprecated. As of 6.0, replaced by StormPageFormat.setScale(double)
 

Method Detail

setStormPageFormat

public void setStormPageFormat(StormPageFormat stormPageFormat)
                        throws IllegalArgumentException
Sets a new StormPageFormat object with the printer. Once the StormPageFormat object has been assigned, the StormPrinter will recalculate the page layouts and set the current page index to the first page.

Parameters:
stormPageFormat - the StormPageFormat object to be assigned to the printer
Throws:
IllegalArgumentException - a null stormPageFormat instance was passed as a parameter
Since:
6.0

getStormPageFormat

public StormPageFormat getStormPageFormat()
Gets the StormPageFormat representing the page format properties.

Returns:
StormPageFormat object
Since:
6.0

getPageCount

public int getPageCount()
Gets the total number of pages for the given StormPageFormat.

Returns:
total number of pages for print layout
Since:
6.0

printPage

public void printPage(Graphics g,
                      int pageIndex)
Print the page specified by pageNumber to g. A zero based index of the requested page is specified by pageIndex. If

Parameters:
g - the context into which the page is drawn
pageIndex - the zero based index of the page to be drawn
Since:
6.0

print

public void print(Graphics g)
Print the full Graphics rendering of the pilot view with out pagination.

Parameters:
g - Graphics object to print pageIndex to

getDimension

public Dimension getDimension()
Gets the dimension of the pilots layout in points. The dimension is independent of the paper width and height set in the StormPageFormat.

Returns:
Dimension an Dimension object represents the actual width and height of the content laid out by the pilot.
Since:
6.0

dispose

public void dispose()
Dispose of this printer


printPage

public void printPage(Graphics g)
Deprecated.  

Print the currently laid out page to the Graphics context g.

Parameters:
g - the current page will be printed to the g.

setPageIndex

public void setPageIndex(int pageIndex)
Set the current page index to pageIndex. If the pageIndex is less than zero, the index is set to the first page index. If the pageIndex is greater than getPageCount() then the last page index is set as the currentPage.

Parameters:
pageIndex - the zero based index of the current index page
Since:
6.0
See Also:
getPageIndex()

getPageIndex

public int getPageIndex()
Return the current page index.

Returns:
pageIndex the zero based index of the current index page
Since:
6.0
See Also:
setPageIndex(int)

setPageSize

public void setPageSize(int width,
                        int height)
Deprecated. As of 6.0, replaced by StormPageFormat.setPageSize(ice.util.unit.Unit, ice.util.unit.Unit)

Sets the paper size.

Parameters:
width - width of page measured in points
height - height of page measured in points

layoutNextPage

public boolean layoutNextPage()
Deprecated. As of 6.0, replaced by #printPage(Graphics g,int pageIndex

Layout the next page. Returns true if this page exists, false otherwise. The page Index is not incremented past the total number of pages.


setZoom

public void setZoom(int zoom)
Deprecated. As of 6.0, replaced by StormPageFormat.setScale(double)

Set the zoom factor of the pilots viewport. The total number of pages is recalculate after the zoom has been set. Negative zoom values are converted to positive values.

Parameters:
zoom - value of new zoom factor
See Also:
getZoom()

getZoom

public int getZoom()
Deprecated. As of 6.0, replaced by StormPageFormat.getScale()

Gets the zoom factor of the pilots viewport.

Returns:
value of the current zoom factor
See Also:
setZoom(int)