|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfable.framework.imageprint.PrintSettings
public class PrintSettings
PrintSettings is a class to hold typical printer settings.
The settings for margins can be given with units, e.g. "1.234 cm". The
numerical values are stored in inches since devices, such as Printers and
Displays, have a DPI (dots per inch) setting, which is important for
displaying images, and this is the easiest way to use the DPI.
Note that at the time this was written SWT has no means of setting the
orientation in the Printer. Thus PrintSettings cannot be used to do that for
the user. The orientation can be used for previews and the like, however.
Nested Class Summary | |
---|---|
static class |
PrintSettings.Orientation
Orientation is a complex enum that represents possible printer orientations and that also includes String names for the items. |
static class |
PrintSettings.Units
Units is a complex enum that represents possible units and that also includes scaling and String names for the items. |
class |
PrintSettings.ValueWithUnits
ValueWithUnits is a simple class that handles a double value and an associates unit. |
Constructor Summary | |
---|---|
PrintSettings()
|
Method Summary | |
---|---|
PrintSettings |
clone()
|
double |
getBottom()
|
java.lang.String |
getBottomString()
|
int |
getHorizontalAlign()
|
double |
getLeft()
|
java.lang.String |
getLeftString()
|
PrintSettings.Orientation |
getOrientation()
|
org.eclipse.swt.printing.PrinterData |
getPrinterData()
|
double |
getRight()
|
java.lang.String |
getRightString()
|
double |
getTop()
|
java.lang.String |
getTopString()
|
PrintSettings.Units |
getUnits()
|
java.lang.String |
getUnitsFormat()
|
java.lang.String |
getUnitsName()
|
int |
getVerticalAlign()
|
PrintSettings.ValueWithUnits |
parseUnitsString(java.lang.String string)
Parses the input String and determines the value and units. |
void |
resetUnitsFormat()
Resets the units format to the default. |
PrintSettings.ValueWithUnits |
scaleFromInches(PrintSettings.ValueWithUnits vwu)
Converts the value from inches given its units. |
PrintSettings.ValueWithUnits |
scaleToInches(PrintSettings.ValueWithUnits vwu)
Converts the value to inches given its units. |
void |
setBottom(double bottom)
|
void |
setBottomString(java.lang.String string)
|
void |
setHorizontalAlign(int horizontalAlign)
|
void |
setLeft(double left)
|
void |
setLeftString(java.lang.String string)
|
void |
setOrientation(PrintSettings.Orientation orientation)
|
void |
setOrientation(java.lang.String name)
|
void |
setPrinterData(org.eclipse.swt.printing.PrinterData printerData)
|
void |
setRight(double right)
|
void |
setRightString(java.lang.String string)
|
void |
setTop(double top)
|
void |
setTopString(java.lang.String string)
|
void |
setUnits(PrintSettings.Units units)
|
void |
setUnits(java.lang.String name)
|
void |
setUnitsFormat(java.lang.String unitsFormat)
|
void |
setVerticalAlign(int verticalAlign)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrintSettings()
Method Detail |
---|
public PrintSettings clone()
clone
in class java.lang.Object
public PrintSettings.ValueWithUnits scaleToInches(PrintSettings.ValueWithUnits vwu)
vwu
-
public PrintSettings.ValueWithUnits scaleFromInches(PrintSettings.ValueWithUnits vwu)
vwu
-
public PrintSettings.ValueWithUnits parseUnitsString(java.lang.String string)
string
-
public java.lang.String getUnitsName()
public PrintSettings.Units getUnits()
public void setUnits(PrintSettings.Units units)
units
- The new value for units.public void setUnits(java.lang.String name)
name
- The new name of the units. Defaults to INCH is there is no
match.public double getLeft()
public void setLeft(double left)
left
- The new value for left in inches.public java.lang.String getLeftString()
public void setLeftString(java.lang.String string)
left
- The new value for left with units, for example "1.23 in".public double getRight()
public void setRight(double right)
right
- The new value for right in inches.public java.lang.String getRightString()
public void setRightString(java.lang.String string)
right
- The new value for right with units, for example "1.23 in".public double getTop()
public void setTop(double top)
top
- The new value for top in inches.public java.lang.String getTopString()
public void setTopString(java.lang.String string)
top
- The new value for top with units, for example "1.23 in".public double getBottom()
public void setBottom(double bottom)
bottom
- The new value for bottom in inches.public java.lang.String getBottomString()
public void setBottomString(java.lang.String string)
bottom
- The new value for bottom with units, for example "1.23 in".public int getVerticalAlign()
public void setVerticalAlign(int verticalAlign)
verticalAlign
- The new value for verticalAlign.public int getHorizontalAlign()
public void setHorizontalAlign(int horizontalAlign)
horizontalAlign
- The new value for horizontalAlign.public java.lang.String getUnitsFormat()
public void setUnitsFormat(java.lang.String unitsFormat)
unitsFormat
- The new value for unitsFormat, something like "%.3f".public void resetUnitsFormat()
public PrintSettings.Orientation getOrientation()
public void setOrientation(PrintSettings.Orientation orientation)
orientation
- The new value for orientation.public void setOrientation(java.lang.String name)
name
- The new name of the units. Defaults to DEFAULT is there is no
match.public org.eclipse.swt.printing.PrinterData getPrinterData()
public void setPrinterData(org.eclipse.swt.printing.PrinterData printerData)
printerData
- the printerData to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |