|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmf.runtime.common.ui.printing.PrintHelper
public class PrintHelper
The PrintHelper implements the IPrintHelper interface for the platform specfic print code. This is for Win32.
Field Summary |
---|
Fields inherited from interface org.eclipse.gmf.runtime.common.ui.printing.IPrintHelper |
---|
PRINT_HELPER_CLASS_NAME |
Constructor Summary | |
---|---|
PrintHelper()
Make an instance of PrintHelper |
Method Summary | |
---|---|
static void |
addDiagramString(java.lang.String string)
Add a string to the diagrams list of the dialog box. |
static boolean |
getCollate()
Returns if collate was selected |
static boolean |
getDiagramPrintRangeAll()
Returns if diagram print range all was selected |
static boolean |
getDiagramPrintRangeCurrent()
Returns if diagram print range current was selected |
static boolean |
getDiagramPrintRangeSelection()
Returns if diagram print range selection was selected |
boolean |
getDlgCollate()
Returns if collate was selected |
boolean |
getDlgDiagramPrintRangeAll()
Returns if diagram print range all was selected |
boolean |
getDlgDiagramPrintRangeCurrent()
Returns if diagram print range current was selected |
boolean |
getDlgDiagramPrintRangeSelection()
Returns if diagram print range selection was selected |
int |
getDlgNumberOfCopies()
Returns the number of copies the user wants to print. |
int |
getDlgPagesFrom()
Returns the pages from int value, check if (getDlgPrintRangesPages()) first. |
int |
getDlgPagesTo()
Returns the pages from int value, check if (getDlgPrintRangesPages()) first. |
boolean |
getDlgPrintRangeAll()
Returns if print range all was selected |
boolean |
getDlgPrintRangePages()
Returns if print range pages was selected |
int |
getDlgScaleFitToM()
If not > 0 then user has clicked percent scaling |
int |
getDlgScaleFitToN()
If not > 0 then user has clicked percent scaling |
int |
getDlgScalePercent()
If not > 0 then user has clicked fit to m x n scaling |
static int |
getNumberOfCopies()
Returns the number of copies the user wants to print. |
static int |
getPagesFrom()
Returns the pages from int value, check if (getPrintRangesPages()) first. |
static int |
getPagesTo()
Returns the pages from int value, check if (getPrintRangesPages()) first. |
static boolean |
getPrintRangeAll()
Returns if print range all was selected |
static boolean |
getPrintRangePages()
Returns if print range pages was selected |
static int |
getScaleFitToM()
If not > 0 then user has clicked percent scaling |
static int |
getScaleFitToN()
If not > 0 then user has clicked percent scaling |
static int |
getScalePercent()
If not > 0 then user has clicked fit to m x n scaling |
static void |
initScaleFitTo(int m,
int n)
Init print dialog box's scale fit to. |
static void |
initScalePercent(int percent)
Init print dialog box's scale percent. |
static boolean |
isDiagramSelected(int index)
Returns true if the diagram at the index was selected |
boolean |
isDlgDiagramSelected(int index)
Returns true if the diagram at the index was selected |
static boolean |
open(PrinterData pd)
Opens the dialog box. |
PrinterData |
openPrintDlg(java.util.List diagramList)
Open the print dialog box with the diagram list. |
static void |
resetDialog()
Resets the dialog. |
void |
setDlgOrientation(boolean bLandscape)
Allows to set the orientation (portrait/landscape) in the print dialog. |
void |
setDlgPaperSize(int index,
double width,
double height)
Allows to set the paper size in the print dialog. |
static void |
setHwndOwner(java.lang.String windowClass,
java.lang.String title)
Set the owner hwnd so that the displyed print dialog is modal. |
static void |
setOrientation(boolean isLandscape)
Allows to set the orientation (portrait/landscape) in the print dialog. |
static void |
setPaperSize(int index,
double width,
double height)
Allows to set the paper size in the print dialog. |
void |
setScaleFactor(int scaleFactor)
Initialize the scaling factor in the print dialog. |
void |
setScaleToWidthHeight(int width,
int height)
Initialize the scale width and height in the print dialog. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrintHelper()
Method Detail |
---|
public static void initScaleFitTo(int m, int n)
m
- n
- public static void initScalePercent(int percent)
percent
- public static void resetDialog()
public static void addDiagramString(java.lang.String string)
string
- public static void setHwndOwner(java.lang.String windowClass, java.lang.String title)
windowClass
- String with classtitle
- String with shell titlepublic static void setOrientation(boolean isLandscape)
isLandscape
- true if orientation should be landscape, false otherwise.public static void setPaperSize(int index, double width, double height)
index
- index of type of paper size,width
- specifies the custom width of the paper. Leave as 0 if paper
size index is user-defined.height
- specifies the custom width of the paper. Leave as 0 if paper
size index is user-defined.for the type of paper sizes available and their indices.
public static int getScaleFitToM()
public static int getScaleFitToN()
public static int getScalePercent()
public static boolean isDiagramSelected(int index)
index
- the index of the diagrams you passed in
public static boolean getDiagramPrintRangeAll()
public static boolean getDiagramPrintRangeCurrent()
public static boolean getDiagramPrintRangeSelection()
public static boolean getPrintRangeAll()
public static boolean getPrintRangePages()
public static boolean getCollate()
public static int getPagesFrom()
public static int getPagesTo()
public static int getNumberOfCopies()
public static boolean open(PrinterData pd)
pd
-
true
if dialog box opened succesfully,
false
otherwisepublic PrinterData openPrintDlg(java.util.List diagramList)
openPrintDlg
in interface IPrintHelper
diagramList
-
PrinterData
public int getDlgScaleFitToM()
getDlgScaleFitToM
in interface IPrintHelper
public int getDlgScaleFitToN()
getDlgScaleFitToN
in interface IPrintHelper
public int getDlgScalePercent()
getDlgScalePercent
in interface IPrintHelper
public boolean isDlgDiagramSelected(int index)
isDlgDiagramSelected
in interface IPrintHelper
index
- the index of the diagrams you passed in
public boolean getDlgDiagramPrintRangeAll()
getDlgDiagramPrintRangeAll
in interface IPrintHelper
public boolean getDlgDiagramPrintRangeCurrent()
getDlgDiagramPrintRangeCurrent
in interface IPrintHelper
public boolean getDlgDiagramPrintRangeSelection()
getDlgDiagramPrintRangeSelection
in interface IPrintHelper
public boolean getDlgPrintRangeAll()
getDlgPrintRangeAll
in interface IPrintHelper
public boolean getDlgPrintRangePages()
getDlgPrintRangePages
in interface IPrintHelper
public boolean getDlgCollate()
getDlgCollate
in interface IPrintHelper
public int getDlgPagesFrom()
getDlgPagesFrom
in interface IPrintHelper
public int getDlgPagesTo()
getDlgPagesTo
in interface IPrintHelper
public int getDlgNumberOfCopies()
getDlgNumberOfCopies
in interface IPrintHelper
public void setDlgOrientation(boolean bLandscape)
setDlgOrientation
in interface IPrintHelper
isLandscape
- true if orientation should be landscape, false otherwise.public void setDlgPaperSize(int index, double width, double height)
setDlgPaperSize
in interface IPrintHelper
index
- index of type of paper size,width
- specifies the custom width of the paper. Leave as 0 if paper
size index is user-defined.height
- specifies the custom width of the paper. Leave as 0 if paper
size index is user-defined.for the type of paper sizes available and their indices.
public void setScaleFactor(int scaleFactor)
setScaleFactor
in interface IPrintHelper
scaleFactor
- a zoom factor integer value greater than 0.public void setScaleToWidthHeight(int width, int height)
setScaleToWidthHeight
in interface IPrintHelper
width
- scale to number of pages wideheight
- scale to number of pages high
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.