|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectice.storm.print.StormPageFormat
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.
| 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 |
public static final int NA_LETTER
public static final int TABLOID
public static final int EXECUTIVE
public static final int NA_LEGAL
public static final int LEDGER
public static final int ISO_4A
public static final int ISO_2A
public static final int ISO_A0
public static final int ISO_A1
public static final int ISO_A2
public static final int ISO_A3
public static final int ISO_A4
public static final int ISO_A5
public static final int ISO_A6
public static final int ISO_A7
public static final int ISO_A8
public static final int ISO_A9
public static final int ISO_A10
public static final int ISO_4B
public static final int ISO_2B
public static final int ISO_B0
public static final int ISO_B1
public static final int ISO_B2
public static final int ISO_B3
public static final int ISO_B4
public static final int ISO_B5
public static final int ISO_B6
public static final int ISO_B7
public static final int ISO_B8
public static final int ISO_B9
public static final int ISO_B10
public static final int ISO_C0
public static final int ISO_C1
public static final int ISO_C2
public static final int ISO_C3
public static final int ISO_C4
public static final int ISO_C5
public static final int ISO_C6
public static final int ISO_C7
public static final int ISO_C8
public static final int ISO_C9
public static final int ISO_C10
public static final int JIS_B0
public static final int JIS_B1
public static final int JIS_B2
public static final int JIS_B3
public static final int JIS_B4
public static final int JIS_B5
public static final int JIS_B6
public static final int JIS_B7
public static final int JIS_B8
public static final int JIS_B9
public static final int JIS_B10
public static final int[][] PAPER_SIZES
public static final String[][] PAPER_NAMES
public static final String[] PAPER_DISPLAY_NAMES
public static final int LANDSCAPE
public static final int PORTRAIT
public static final int LEFT
public static final int RIGHT
public static final int TOP
public static final int BOTTOM
public static final int PRINT_ALL_FRAMES
public static final int PRINT_ACTIVE_FRAMES
public static final int PRINT_FRAMES_PAGE
public static final int UNIT_POINTS
public static final int UNIT_MILLIMETERS
public static final int UNIT_INCHES
protected Vector pageDecorations
| Constructor Detail |
public StormPageFormat()
| Method Detail |
public void setMargin(Unit size,
int location)
throws IllegalArgumentException
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
size - margin sizelocation - margin location on page
IllegalArgumentException - if an invalid location is specifiedgetMargin(int),
Unit
public void setOrientation(int orientation)
throws IllegalArgumentException
orientation must be one of the
constants: PORTRAIT, or LANDSCAPE.
orientation - the new orientation for the page
IllegalArgumentException - if an unknown orientation was requestedgetOrientation()public void setOrientation(Dimension pageSize)
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.
pageSize - page size dimension
public void setPageSize(Unit pageWidth,
Unit pageHeight)
throws IllegalArgumentException
pageWidth - width valuepageHeight - height value
IllegalArgumentException - if page dimension values are
less than zerogetPageWidth(),
getPageHeight()
public void setPageSize(int pageSize)
throws IllegalArgumentException
pageSize should be
one of the page size constants.
pageSize - int representing a predefined pages size constant
NullPointerException - if pageSize is null
IllegalArgumentExceptiongetPageWidth(),
getPageHeight()public void setPageGutterWidth(Unit width)
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.getPageGutter()public void setBackgroundVisible(boolean isVisible)
isVisible - If true, background images
and colors should be shown, otherwise, background images and colors
should be hidden.public void setTextWrapping(boolean isEnabled)
isEnabled - If true, text wrapping will be enable for implemented
pilotsisTextWrappingEnabled()public void setHtmlSmartPaging(boolean isEnabled)
isEnabled - If true, html paging will be enable for implemented
pilotsisHtmlSmartPagingEnabled()public void setPageSetupDialogUnit(int unit)
unit is not equal to one of the unit constants
the value of unit is left unchanged.
unit - public void setFramePrintFormat(int format)
format - getFramePrintFormat()public void setSelectedViewportIndex(int viewPortIndex)
viewPortIndex - getSelectedViewportIndex(),
setFramePrintFormat(int),
getFramePrintFormat()public void setHeaderFooterFont(Font font)
font - new fontgetHeaderFooterFont(),
PageDecorationpublic void setScale(double scale)
scale - scale value in percent, the constant SCALE_TO_FIT is also
a valid scale value.getScale()public double getScale()
public int getSelectedViewportIndex()
setSelectedViewportIndex(int),
setFramePrintFormat(int),
getFramePrintFormat()public double getMargin(int location)
location
should be one of the constants LEFT, TOP, RIGHT or BOTTOM.
public double getPageGutter()
public final int getPageSetupDialogUnit()
public String getPaperDisplayNames(int paper)
paper - page constant that represents a page size
public Dimension getPaperSize(int paper)
paper - page constant that represents a page size.
public int getOrientation()
StormPageFormat objects orientation.setOrientation(int)public double getPageWidth()
setPageSize(ice.util.unit.Unit, ice.util.unit.Unit)public double getPageHeight()
setPageSize(ice.util.unit.Unit, ice.util.unit.Unit)public double getImageableWidth()
public double getImageableHeight()
public int getFramePrintFormat()
setFramePrintFormat(int)public Font getHeaderFooterFont()
setHeaderFooterFont(java.awt.Font)public boolean isBackgroundVisible()
public boolean isTextWrappingEnabled()
public boolean isScaleToFitEnabled()
public boolean isHtmlSmartPagingEnabled()
public void setPrintSelected(boolean isSelected)
isSelected - True if the user wants to print only the selected document regionspublic boolean isPrintSelected()
public boolean isPrintSelectionChanged()
public void setPrintSelectionModeChange(boolean modeChange)
public Object clone()
StormPageFormat with the same
contents as this StormPageFormat.
StormPageFormat.public boolean hasImageableAreaChanged()
public void setImageableAreaChangedFlag(boolean flag)
flag - If true, imageable area has changed, otherwise, imageable
area has not changed.public static final int findPageOrientation(Dimension page)
page - dimension to check for orientation
public static final int findPageSize(Dimension pageDimension)
pageDimension - page dimension to check for page size index
pageDimension in the PAPER_SIZES
array. If not found then -1 is returned.public void addDecoration(PageDecoration pageDecoration)
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.
pageDecoration - the PageDecoration to be added to the
StormPrinterpublic Vector getDecoration()
public void removeAllDecorations()
public void setScaleToFitEnabled(boolean value)
value - isScaleToFitEnabled()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||