ice.storm.print
Class StormPageFormat

java.lang.Object
  extended byice.storm.print.StormPageFormat
All Implemented Interfaces:
Cloneable, Serializable

public class StormPageFormat
extends Object
implements Cloneable, Serializable

The StormPageFormat class describes the size and orientation of a page to be printed. The default constructor creates an object of Letter paper Size of 612 x 792 points with all page margins, left, top, right, bottom set to 32 points. The page gutter width is set to 0 points and the page orientation is portrait.

Since:
6.0
Version:
%I%, %G%
Author:
Patrick Corless
See Also:
Serialized Form

Field Summary
static int BOTTOM
          Component orientation, bottom align property.
static int EXECUTIVE
          The page dimensions are set to 7.25 x 10.5 inches.
static int ISO_2A
          The page dimensions are set to 1189 mm x 1682 mm.
static int ISO_2B
          The page dimensions are set to 1414 x 2000 mm.
static int ISO_4A
          The page dimensions are set to 1682 mm x 2378 mm.
static int ISO_4B
          The page dimensions are set to 2000 x 2828 mm.
static int ISO_A0
          The page dimensions are set to 841 mm x 1189 mm.
static int ISO_A1
          The page dimensions are set to 594 mm x 1189 mm.
static int ISO_A10
          The page dimensions are set to 26 x 37 mm.
static int ISO_A2
          The page dimensions are set to 420 x 594 mm.
static int ISO_A3
          The page dimensions are set to 297 x 420 mm.
static int ISO_A4
          The page dimensions are set to 210 x 297 mm.
static int ISO_A5
          The page dimensions are set to 148 x 210 mm.
static int ISO_A6
          The page dimensions are set to 105 x 148 mm.
static int ISO_A7
          The page dimensions are set to 74 x 105 mm.
static int ISO_A8
          The page dimensions are set to 52 x 74 mm.
static int ISO_A9
          The page dimensions are set to 37 x 52 mm.
static int ISO_B0
          The page dimensions are set to 1000 x 1414 mm.
static int ISO_B1
          The page dimensions are set to 707 x 1000 mm.
static int ISO_B10
          The page dimensions are set to 31 x 44 mm.
static int ISO_B2
          The page dimensions are set to 500 x 707 mm.
static int ISO_B3
          The page dimensions are set to 353 x 500 mm.
static int ISO_B4
          The page dimensions are set to 250 x 353 mm.
static int ISO_B5
          The page dimensions are set to 176 x 250 mm.
static int ISO_B6
          The page dimensions are set to 125 x 176 mm.
static int ISO_B7
          The page dimensions are set to 88 x 125 mm.
static int ISO_B8
          The page dimensions are set to 62 x 88 mm.
static int ISO_B9
          The page dimensions are set to 44 x 62 mm.
static int ISO_C0
          The page dimensions are set to 917 x 1297 mm.
static int ISO_C1
          The page dimensions are set to 648 x 917 mm.
static int ISO_C10
          The page dimensions are set to 28 x 4 mm.
static int ISO_C2
          The page dimensions are set to 458 x 648 mm.
static int ISO_C3
          The page dimensions are set to 324 x 458 mm.
static int ISO_C4
          The page dimensions are set to 229 x 324 mm.
static int ISO_C5
          The page dimensions are set to 162 x 229 mm.
static int ISO_C6
          The page dimensions are set to 114 x 162 mm.
static int ISO_C7
          The page dimensions are set to 81 x 114 mm.
static int ISO_C8
          The page dimensions are set to 57 x 81 mm.
static int ISO_C9
          The page dimensions are set to 40 x 57 mm.
static int JIS_B0
          The page dimensions are set to 1030 x 1456 mm.
static int JIS_B1
          The page dimensions are set to 728 x 1030 mm.
static int JIS_B10
          The page dimensions are set to 32 x 45 mm.
static int JIS_B2
          The page dimensions are set to 515 x 728 mm.
static int JIS_B3
          The page dimensions are set to 364 x 515 mm.
static int JIS_B4
          The page dimensions are set to 257 x 364 mm.
static int JIS_B5
          The page dimensions are set to 182 x 257 mm.
static int JIS_B6
          TThe page dimensions are set to 128 x 182 mm.
static int JIS_B7
          The page dimensions are set to 91 x 128 mm.
static int JIS_B8
          The page dimensions are set to 64 x 91 mm.
static int JIS_B9
          The page dimensions are set to 45 x 64 mm.
static int LANDSCAPE
          The origin is at the bottom left of the paper with x running bottom to top and y running left to right.
static int LEDGER
          The page dimensions are set to 11 x 17 inches.
static int LEFT
          Component orientation, left align property.
static int NA_LEGAL
          The page dimensions are set to 8.5 x 14 inches.
static int NA_LETTER
          The page dimensions are set to 8.5 x 11 inches.
protected  Vector pageDecorations
           
static String[] PAPER_DISPLAY_NAMES
          Paper names for display purposes.
static String[][] PAPER_NAMES
          Paper names and their alias names.
static int[][] PAPER_SIZES
          Paper sizes represented by points
static int PORTRAIT
          The origin is at the top left of the paper with x running to the right and y running down the paper.
static int PRINT_ACTIVE_FRAMES
          Frame printing property, print only the active frame in the frameset.
static int PRINT_ALL_FRAMES
          Frame printing property, print all frames in frameset.
static int PRINT_FRAMES_PAGE
          Frame printing property, print the page representing the the frameset.
static int RIGHT
          Component orientation, right align property.
static int TABLOID
          The page dimensions are set to 11 x 17 inches.
static int TOP
          Component orientation, top align property.
static int UNIT_INCHES
           
static int UNIT_MILLIMETERS
           
static int UNIT_POINTS
           
 
Constructor Summary
StormPageFormat()
          Class constructor, creates new instance of StormPageFormat
 
Method Summary
 void addDecoration(PageDecoration pageDecoration)
          Add an object that implements PageDecoration to the printer layout.
 Object clone()
          Makes a copy of this StormPageFormat with the same contents as this StormPageFormat.
static int findPageOrientation(Dimension page)
          Find the page orientation of a given page dimensions.
static int findPageSize(Dimension pageDimension)
          Utility method which tries to find a matching PAPER_SIZES index given the page dimension.
 Vector getDecoration()
          Return a vector that holds all the page decorations.
 int getFramePrintFormat()
          Return the prefered format for printing frames.
 Font getHeaderFooterFont()
          Return the default header and footer font.
 double getImageableHeight()
          Return the imageable height of the page.
 double getImageableWidth()
          Return the imageable width of the page.
 double getMargin(int location)
          Returns the height in points of the top margin.
 int getOrientation()
          Returns the page orientation.
 double getPageGutter()
          Returns the width in points of the page gutter.
 double getPageHeight()
          Returns the page height.
 int getPageSetupDialogUnit()
          Returns the page setup dialog default unit.
 double getPageWidth()
          Returns the page width.
 String getPaperDisplayNames(int paper)
          Returns the display paper name for the given page constant.
 Dimension getPaperSize(int paper)
          Returns the paper dimensions for the given page constant.
 double getScale()
          Return the scale value in percent.
 int getSelectedViewportIndex()
          Gets the viewport index that will be printed.
 boolean hasImageableAreaChanged()
          Return true if the imageable area has changed in anyway.
 boolean isBackgroundVisible()
          Return the state of background visibility.
 boolean isHtmlSmartPagingEnabled()
          Return the status of smart html paging feature.
 boolean isPrintSelected()
          Return the print selected flag indicating that ThePrinter should only print the selected regions of the document.
 boolean isPrintSelectionChanged()
           
 boolean isScaleToFitEnabled()
          Returns the status of the scale to fit flag.
 boolean isTextWrappingEnabled()
          Return the status of text wrapping feature.
 void removeAllDecorations()
          Remove all page decoration.
 void setBackgroundVisible(boolean isVisible)
          Sets the state of background visibility.
 void setFramePrintFormat(int format)
          Sets the frame print format.
 void setHeaderFooterFont(Font font)
          Set a new header footer font.
 void setHtmlSmartPaging(boolean isEnabled)
          Sets the state of html paging.
 void setImageableAreaChangedFlag(boolean flag)
          Sets the imageable area changed flag.
 void setMargin(Unit size, int location)
          Set the margin at location with a value of size.
 void setOrientation(Dimension pageSize)
          Sets the page orientation given the pageSize from a Java 1.1.x PrintJob.
 void setOrientation(int orientation)
          Set the page orientation.
 void setPageGutterWidth(Unit width)
          Set the page gutter width.
 void setPageSetupDialogUnit(int unit)
          Sets the default unit of the dialog.
 void setPageSize(int pageSize)
          Set the dimension of the paper.
 void setPageSize(Unit pageWidth, Unit pageHeight)
          Set the dimension of the paper.
 void setPrintSelected(boolean isSelected)
          Set a flag indicating that ThePrinter should only print the selected regions of the document.
 void setPrintSelectionModeChange(boolean modeChange)
           
 void setScale(double scale)
          Sets the scale value in percent.
 void setScaleToFitEnabled(boolean value)
          Sets the scale to fit flag.
 void setSelectedViewportIndex(int viewPortIndex)
          Sets the viewport index that will be printed.
 void setTextWrapping(boolean isEnabled)
          Sets the state of text wrapping.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NA_LETTER

public static final int NA_LETTER
The page dimensions are set to 8.5 x 11 inches.

See Also:
Constant Field Values

TABLOID

public static final int TABLOID
The page dimensions are set to 11 x 17 inches.

See Also:
Constant Field Values

EXECUTIVE

public static final int EXECUTIVE
The page dimensions are set to 7.25 x 10.5 inches.

See Also:
Constant Field Values

NA_LEGAL

public static final int NA_LEGAL
The page dimensions are set to 8.5 x 14 inches.

See Also:
Constant Field Values

LEDGER

public static final int LEDGER
The page dimensions are set to 11 x 17 inches.

See Also:
Constant Field Values

ISO_4A

public static final int ISO_4A
The page dimensions are set to 1682 mm x 2378 mm.

See Also:
Constant Field Values

ISO_2A

public static final int ISO_2A
The page dimensions are set to 1189 mm x 1682 mm.

See Also:
Constant Field Values

ISO_A0

public static final int ISO_A0
The page dimensions are set to 841 mm x 1189 mm.

See Also:
Constant Field Values

ISO_A1

public static final int ISO_A1
The page dimensions are set to 594 mm x 1189 mm.

See Also:
Constant Field Values

ISO_A2

public static final int ISO_A2
The page dimensions are set to 420 x 594 mm.

See Also:
Constant Field Values

ISO_A3

public static final int ISO_A3
The page dimensions are set to 297 x 420 mm.

See Also:
Constant Field Values

ISO_A4

public static final int ISO_A4
The page dimensions are set to 210 x 297 mm.

See Also:
Constant Field Values

ISO_A5

public static final int ISO_A5
The page dimensions are set to 148 x 210 mm.

See Also:
Constant Field Values

ISO_A6

public static final int ISO_A6
The page dimensions are set to 105 x 148 mm.

See Also:
Constant Field Values

ISO_A7

public static final int ISO_A7
The page dimensions are set to 74 x 105 mm.

See Also:
Constant Field Values

ISO_A8

public static final int ISO_A8
The page dimensions are set to 52 x 74 mm.

See Also:
Constant Field Values

ISO_A9

public static final int ISO_A9
The page dimensions are set to 37 x 52 mm.

See Also:
Constant Field Values

ISO_A10

public static final int ISO_A10
The page dimensions are set to 26 x 37 mm.

See Also:
Constant Field Values

ISO_4B

public static final int ISO_4B
The page dimensions are set to 2000 x 2828 mm.

See Also:
Constant Field Values

ISO_2B

public static final int ISO_2B
The page dimensions are set to 1414 x 2000 mm.

See Also:
Constant Field Values

ISO_B0

public static final int ISO_B0
The page dimensions are set to 1000 x 1414 mm.

See Also:
Constant Field Values

ISO_B1

public static final int ISO_B1
The page dimensions are set to 707 x 1000 mm.

See Also:
Constant Field Values

ISO_B2

public static final int ISO_B2
The page dimensions are set to 500 x 707 mm.

See Also:
Constant Field Values

ISO_B3

public static final int ISO_B3
The page dimensions are set to 353 x 500 mm.

See Also:
Constant Field Values

ISO_B4

public static final int ISO_B4
The page dimensions are set to 250 x 353 mm.

See Also:
Constant Field Values

ISO_B5

public static final int ISO_B5
The page dimensions are set to 176 x 250 mm.

See Also:
Constant Field Values

ISO_B6

public static final int ISO_B6
The page dimensions are set to 125 x 176 mm.

See Also:
Constant Field Values

ISO_B7

public static final int ISO_B7
The page dimensions are set to 88 x 125 mm.

See Also:
Constant Field Values

ISO_B8

public static final int ISO_B8
The page dimensions are set to 62 x 88 mm.

See Also:
Constant Field Values

ISO_B9

public static final int ISO_B9
The page dimensions are set to 44 x 62 mm.

See Also:
Constant Field Values

ISO_B10

public static final int ISO_B10
The page dimensions are set to 31 x 44 mm.

See Also:
Constant Field Values

ISO_C0

public static final int ISO_C0
The page dimensions are set to 917 x 1297 mm.

See Also:
Constant Field Values

ISO_C1

public static final int ISO_C1
The page dimensions are set to 648 x 917 mm.

See Also:
Constant Field Values

ISO_C2

public static final int ISO_C2
The page dimensions are set to 458 x 648 mm.

See Also:
Constant Field Values

ISO_C3

public static final int ISO_C3
The page dimensions are set to 324 x 458 mm.

See Also:
Constant Field Values

ISO_C4

public static final int ISO_C4
The page dimensions are set to 229 x 324 mm.

See Also:
Constant Field Values

ISO_C5

public static final int ISO_C5
The page dimensions are set to 162 x 229 mm.

See Also:
Constant Field Values

ISO_C6

public static final int ISO_C6
The page dimensions are set to 114 x 162 mm.

See Also:
Constant Field Values

ISO_C7

public static final int ISO_C7
The page dimensions are set to 81 x 114 mm.

See Also:
Constant Field Values

ISO_C8

public static final int ISO_C8
The page dimensions are set to 57 x 81 mm.

See Also:
Constant Field Values

ISO_C9

public static final int ISO_C9
The page dimensions are set to 40 x 57 mm.

See Also:
Constant Field Values

ISO_C10

public static final int ISO_C10
The page dimensions are set to 28 x 4 mm.

See Also:
Constant Field Values

JIS_B0

public static final int JIS_B0
The page dimensions are set to 1030 x 1456 mm.

See Also:
Constant Field Values

JIS_B1

public static final int JIS_B1
The page dimensions are set to 728 x 1030 mm.

See Also:
Constant Field Values

JIS_B2

public static final int JIS_B2
The page dimensions are set to 515 x 728 mm.

See Also:
Constant Field Values

JIS_B3

public static final int JIS_B3
The page dimensions are set to 364 x 515 mm.

See Also:
Constant Field Values

JIS_B4

public static final int JIS_B4
The page dimensions are set to 257 x 364 mm.

See Also:
Constant Field Values

JIS_B5

public static final int JIS_B5
The page dimensions are set to 182 x 257 mm.

See Also:
Constant Field Values

JIS_B6

public static final int JIS_B6
TThe page dimensions are set to 128 x 182 mm.

See Also:
Constant Field Values

JIS_B7

public static final int JIS_B7
The page dimensions are set to 91 x 128 mm.

See Also:
Constant Field Values

JIS_B8

public static final int JIS_B8
The page dimensions are set to 64 x 91 mm.

See Also:
Constant Field Values

JIS_B9

public static final int JIS_B9
The page dimensions are set to 45 x 64 mm.

See Also:
Constant Field Values

JIS_B10

public static final int JIS_B10
The page dimensions are set to 32 x 45 mm.

See Also:
Constant Field Values

PAPER_SIZES

public static final int[][] PAPER_SIZES
Paper sizes represented by points


PAPER_NAMES

public static final String[][] PAPER_NAMES
Paper names and their alias names.


PAPER_DISPLAY_NAMES

public static final String[] PAPER_DISPLAY_NAMES
Paper names for display purposes.


LANDSCAPE

public static final int LANDSCAPE
The origin is at the bottom left of the paper with x running bottom to top and y running left to right. Note that this is not the Macintosh landscape but is the Window's and PostScript landscape.

See Also:
Constant Field Values

PORTRAIT

public static final int PORTRAIT
The origin is at the top left of the paper with x running to the right and y running down the paper.

See Also:
Constant Field Values

LEFT

public static final int LEFT
Component orientation, left align property.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Component orientation, right align property.

See Also:
Constant Field Values

TOP

public static final int TOP
Component orientation, top align property.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Component orientation, bottom align property.

See Also:
Constant Field Values

PRINT_ALL_FRAMES

public static final int PRINT_ALL_FRAMES
Frame printing property, print all frames in frameset.

See Also:
Constant Field Values

PRINT_ACTIVE_FRAMES

public static final int PRINT_ACTIVE_FRAMES
Frame printing property, print only the active frame in the frameset.

See Also:
Constant Field Values

PRINT_FRAMES_PAGE

public static final int PRINT_FRAMES_PAGE
Frame printing property, print the page representing the the frameset.

See Also:
Constant Field Values

UNIT_POINTS

public static final int UNIT_POINTS
See Also:
Constant Field Values

UNIT_MILLIMETERS

public static final int UNIT_MILLIMETERS
See Also:
Constant Field Values

UNIT_INCHES

public static final int UNIT_INCHES
See Also:
Constant Field Values

pageDecorations

protected Vector pageDecorations
Constructor Detail

StormPageFormat

public StormPageFormat()
Class constructor, creates new instance of StormPageFormat

Method Detail

setMargin

public void setMargin(Unit size,
                      int location)
               throws IllegalArgumentException
Set the margin at location with a value of size. If a margin size is less than zero it is corrected and resigned a value of 0 units. The following corrections are made for large margin values to insure a viewable imageable area: Horizontal adjustments if leftMargin >= pageWidth - rightMargin leftMargin = pageWidth - rightMargin - 1 if rightMargin >= pageWidth - leftMargin rightMargin = pageWidth - leftMargin - 1 Vertical Adjustments if topMargin >= pageHeight - bottomMargin topmargin = pageHeight - bottom Margin -1 if bottomMargin >= pageHeight - topMargin bottomMargin = pageHeight - topMargin - 1 Location values must be equal to one of the constants LEFT, RIGHT, TOP, or Bottom or an IllegalArgumentException will be thrown

Parameters:
size - margin size
location - margin location on page
Throws:
IllegalArgumentException - if an invalid location is specified
See Also:
getMargin(int), Unit

setOrientation

public void setOrientation(int orientation)
                    throws IllegalArgumentException
Set the page orientation. orientation must be one of the constants: PORTRAIT, or LANDSCAPE.

Parameters:
orientation - the new orientation for the page
Throws:
IllegalArgumentException - if an unknown orientation was requested
See Also:
getOrientation()

setOrientation

public void setOrientation(Dimension pageSize)
Sets the page orientation given the pageSize from a Java 1.1.x PrintJob. This method compares pageSize against known page sizes to try and decide if the Print job is returning a dimension that is considered landscape or portrait. If a match can not be made the orientation is not set.

Parameters:
pageSize - page size dimension

setPageSize

public void setPageSize(Unit pageWidth,
                        Unit pageHeight)
                 throws IllegalArgumentException
Set the dimension of the paper. Imageable area is automatically recalculated using current paper, page margins and gutter sizes.

Parameters:
pageWidth - width value
pageHeight - height value
Throws:
IllegalArgumentException - if page dimension values are less than zero
See Also:
getPageWidth(), getPageHeight()

setPageSize

public void setPageSize(int pageSize)
                 throws IllegalArgumentException
Set the dimension of the paper. pageSize should be one of the page size constants.

Parameters:
pageSize - int representing a predefined pages size constant
Throws:
NullPointerException - if pageSize is null
IllegalArgumentException
See Also:
getPageWidth(), getPageHeight()

setPageGutterWidth

public void setPageGutterWidth(Unit width)
Set the page gutter width. The page gutter is often used for documents which will be bound. The gutter width is set to the width of the relative amount of paper that would be lost to the binding, which insures proper margin dimension for the bound document.

Parameters:
width - gutter width value. If less than zero the gutter is set 0, if greater than or equal to imageableWidth the gutter is set to imageableWidth - 1. This will insure that the visible area is greater than 0.
See Also:
getPageGutter()

setBackgroundVisible

public void setBackgroundVisible(boolean isVisible)
Sets the state of background visibility. This property is only used by certain pilots.

Parameters:
isVisible - If true, background images and colors should be shown, otherwise, background images and colors should be hidden.

setTextWrapping

public void setTextWrapping(boolean isEnabled)
Sets the state of text wrapping. This property is only used by certain pilots.

Parameters:
isEnabled - If true, text wrapping will be enable for implemented pilots
See Also:
isTextWrappingEnabled()

setHtmlSmartPaging

public void setHtmlSmartPaging(boolean isEnabled)
Sets the state of html paging. This property is available in the HTML4 pilot.

Parameters:
isEnabled - If true, html paging will be enable for implemented pilots
See Also:
isHtmlSmartPagingEnabled()

setPageSetupDialogUnit

public void setPageSetupDialogUnit(int unit)
Sets the default unit of the dialog. There are currently three unit choices available, UNIT_INCHES, UNIT_MILLIMETERS and UNIT_POINTS. If the value of unit is not equal to one of the unit constants the value of unit is left unchanged.

Parameters:
unit -

setFramePrintFormat

public void setFramePrintFormat(int format)
Sets the frame print format. The format can be one of the constants PRINT_ALL_FRAMES, PRINT_ACTIVE_FRAMES OR PRINT_FRAMES_PAGE.

Parameters:
format -
See Also:
getFramePrintFormat()

setSelectedViewportIndex

public void setSelectedViewportIndex(int viewPortIndex)
Sets the viewport index that will be printed. This is used when storing frame print information for PRINT_ACTIVE_FRAMES

Parameters:
viewPortIndex -
See Also:
getSelectedViewportIndex(), setFramePrintFormat(int), getFramePrintFormat()

setHeaderFooterFont

public void setHeaderFooterFont(Font font)
Set a new header footer font. This font can be used by custom pilots and PageDecoration classes.

Parameters:
font - new font
See Also:
getHeaderFooterFont(), PageDecoration

setScale

public void setScale(double scale)
Sets the scale value in percent. 100% should be represented as 1.0, 50% as 0.5, 200% as 2.0 and etc. Negative scale values are ignored, the minimum scale factor is 0.01 and the maximum is 10. Scale values outside this range will automatically be adjusted.

Parameters:
scale - scale value in percent, the constant SCALE_TO_FIT is also a valid scale value.
See Also:
getScale()

getScale

public double getScale()
Return the scale value in percent. 100% should be represented as 1.0, 50% as 0.5, 200% as 2.0 and etc.

Returns:
the scale value in percent

getSelectedViewportIndex

public int getSelectedViewportIndex()
Gets the viewport index that will be printed. This is used when storing frame print information for PRINT_ACTIVE_FRAMES

See Also:
setSelectedViewportIndex(int), setFramePrintFormat(int), getFramePrintFormat()

getMargin

public double getMargin(int location)
Returns the height in points of the top margin. location should be one of the constants LEFT, TOP, RIGHT or BOTTOM.

Returns:
the top margin height of the page.

getPageGutter

public double getPageGutter()
Returns the width in points of the page gutter.

Returns:
the right page gutter.

getPageSetupDialogUnit

public final int getPageSetupDialogUnit()
Returns the page setup dialog default unit.

Returns:
page setup dialog default unit.

getPaperDisplayNames

public String getPaperDisplayNames(int paper)
Returns the display paper name for the given page constant.

Parameters:
paper - page constant that represents a page size
Returns:
paper name with the corresponding dimension

getPaperSize

public Dimension getPaperSize(int paper)
Returns the paper dimensions for the given page constant.

Parameters:
paper - page constant that represents a page size.
Returns:
paper page size as width and height, , null if the paper constant is not valid.

getOrientation

public int getOrientation()
Returns the page orientation.

Returns:
the StormPageFormat objects orientation.
See Also:
setOrientation(int)

getPageWidth

public double getPageWidth()
Returns the page width.

Returns:
the page width in points
See Also:
setPageSize(ice.util.unit.Unit, ice.util.unit.Unit)

getPageHeight

public double getPageHeight()
Returns the page height.

Returns:
the page height in points
See Also:
setPageSize(ice.util.unit.Unit, ice.util.unit.Unit)

getImageableWidth

public double getImageableWidth()
Return the imageable width of the page.

Returns:
the imageable width of the page in points

getImageableHeight

public double getImageableHeight()
Return the imageable height of the page.

Returns:
the imageable height of the page in points

getFramePrintFormat

public int getFramePrintFormat()
Return the prefered format for printing frames.

Returns:
prefered format for printing frames
See Also:
setFramePrintFormat(int)

getHeaderFooterFont

public Font getHeaderFooterFont()
Return the default header and footer font.

Returns:
font header and footer font
See Also:
setHeaderFooterFont(java.awt.Font)

isBackgroundVisible

public boolean isBackgroundVisible()
Return the state of background visibility. If true, background images and colors should be shown, otherwise, background images and colors should not be shown.

Returns:
true if background images and colors are to be shown, otherwise, false, background images and colors will not be shown.

isTextWrappingEnabled

public boolean isTextWrappingEnabled()
Return the status of text wrapping feature. Text wrapping is only available in some pilots.

Returns:
state of text Wrapping flag.

isScaleToFitEnabled

public boolean isScaleToFitEnabled()
Returns the status of the scale to fit flag. If true scale to fit is enabled, otherwise false and scale to fit is disabled.

Returns:

isHtmlSmartPagingEnabled

public boolean isHtmlSmartPagingEnabled()
Return the status of smart html paging feature. HTML paging is available in the HTML4 pilot.

Returns:
state of text Wrapping flag.

setPrintSelected

public void setPrintSelected(boolean isSelected)
Set a flag indicating that ThePrinter should only print the selected regions of the document. Bug #4323

Parameters:
isSelected - True if the user wants to print only the selected document regions
Since:
6.1

isPrintSelected

public boolean isPrintSelected()
Return the print selected flag indicating that ThePrinter should only print the selected regions of the document. #4323

Returns:
True if the user wants to print only the selected document regions
Since:
6.1

isPrintSelectionChanged

public boolean isPrintSelectionChanged()

setPrintSelectionModeChange

public void setPrintSelectionModeChange(boolean modeChange)

clone

public Object clone()
Makes a copy of this StormPageFormat with the same contents as this StormPageFormat.

Returns:
a copy of this StormPageFormat.

hasImageableAreaChanged

public boolean hasImageableAreaChanged()
Return true if the imageable area has changed in anyway.

Returns:
true if the page layout properties have changed.

setImageableAreaChangedFlag

public void setImageableAreaChangedFlag(boolean flag)
Sets the imageable area changed flag.

Parameters:
flag - If true, imageable area has changed, otherwise, imageable area has not changed.

findPageOrientation

public static final int findPageOrientation(Dimension page)
Find the page orientation of a given page dimensions. If given page orientation match one of the StormPageFormat predefined page size then the PORTRAIT constant is returned. If the page format matches the StormPageFormat predefined page size in reverse then LANDSCAPE is returned. Lastly if no matches are found -1 is returned.

Parameters:
page - dimension to check for orientation
Returns:
page orientation constant for the given page size.

findPageSize

public static final int findPageSize(Dimension pageDimension)
Utility method which tries to find a matching PAPER_SIZES index given the page dimension. The indexes of PAPERS_SIZES also matches the indexes of PAPER_DISPLAY_NAME and PAPER_NAMES.

Parameters:
pageDimension - page dimension to check for page size index
Returns:
the index of the pageDimension in the PAPER_SIZES array. If not found then -1 is returned.

addDecoration

public void addDecoration(PageDecoration pageDecoration)
Add an object that implements PageDecoration to the printer layout. PageDecoration objects are drawn on top of the pilot content. The PageDecoration object are painted in the order in which they are added.

Parameters:
pageDecoration - the PageDecoration to be added to the StormPrinter

getDecoration

public Vector getDecoration()
Return a vector that holds all the page decorations.

Returns:

removeAllDecorations

public void removeAllDecorations()
Remove all page decoration.


setScaleToFitEnabled

public void setScaleToFitEnabled(boolean value)
Sets the scale to fit flag.

Parameters:
value -
See Also:
isScaleToFitEnabled()