Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarolyn MacLeod2008-06-04 20:45:22 +0000
committerCarolyn MacLeod2008-06-04 20:45:22 +0000
commit45b394fe10eb1852268eed201cf431c4774b5428 (patch)
tree00ccb791c8930d127177c0034c8ee92863d9cedc /bundles/org.eclipse.swt/Eclipse SWT Printing/emulated
parent5ccbc836d63be99bd6e1cf9e6c2cc8027488f31c (diff)
downloadeclipse.platform.swt-45b394fe10eb1852268eed201cf431c4774b5428.tar.gz
eclipse.platform.swt-45b394fe10eb1852268eed201cf431c4774b5428.tar.xz
eclipse.platform.swt-45b394fe10eb1852268eed201cf431c4774b5428.zip
After Javadoc Bash for 3.4RC4
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Printing/emulated')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/emulated/org/eclipse/swt/printing/PrintDialog.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/emulated/org/eclipse/swt/printing/Printer.java52
2 files changed, 45 insertions, 31 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/emulated/org/eclipse/swt/printing/PrintDialog.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/emulated/org/eclipse/swt/printing/PrintDialog.java
index 6421544e6a..9cc12f73a1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/emulated/org/eclipse/swt/printing/PrintDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/emulated/org/eclipse/swt/printing/PrintDialog.java
@@ -23,6 +23,10 @@ import org.eclipse.swt.widgets.*;
* IMPORTANT: This class is intended to be subclassed <em>only</em>
* within the SWT implementation.
* </p>
+ *
+ * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: ControlExample, Dialog tab</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*/
public class PrintDialog extends Dialog {
PrinterData printerData;
@@ -113,11 +117,11 @@ public PrinterData getPrinterData() {
* before pressing OK in the dialog. This will be one
* of the following values:
* <dl>
- * <dt><code>ALL_PAGES</code></dt>
+ * <dt><code>PrinterData.ALL_PAGES</code></dt>
* <dd>Print all pages in the current document</dd>
- * <dt><code>PAGE_RANGE</code></dt>
+ * <dt><code>PrinterData.PAGE_RANGE</code></dt>
* <dd>Print the range of pages specified by startPage and endPage</dd>
- * <dt><code>SELECTION</code></dt>
+ * <dt><code>PrinterData.SELECTION</code></dt>
* <dd>Print the current selection</dd>
* </dl>
*
@@ -132,11 +136,11 @@ public int getScope() {
* setting when the dialog is opened. This can have one of
* the following values:
* <dl>
- * <dt><code>ALL_PAGES</code></dt>
+ * <dt><code>PrinterData.ALL_PAGES</code></dt>
* <dd>Print all pages in the current document</dd>
- * <dt><code>PAGE_RANGE</code></dt>
+ * <dt><code>PrinterData.PAGE_RANGE</code></dt>
* <dd>Print the range of pages specified by startPage and endPage</dd>
- * <dt><code>SELECTION</code></dt>
+ * <dt><code>PrinterData.SELECTION</code></dt>
* <dd>Print the current selection</dd>
* </dl>
*
@@ -151,7 +155,7 @@ public void setScope(int scope) {
* before pressing OK in the dialog.
* <p>
* This value can be from 1 to the maximum number of pages for the platform.
- * Note that it is only valid if the scope is <code>PAGE_RANGE</code>.
+ * Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>.
* </p>
*
* @return the start page setting that the user selected
@@ -165,7 +169,7 @@ public int getStartPage() {
* is opened.
* <p>
* This value can be from 1 to the maximum number of pages for the platform.
- * Note that it is only valid if the scope is <code>PAGE_RANGE</code>.
+ * Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>.
* </p>
*
* @param startPage the startPage setting when the dialog is opened
@@ -179,7 +183,7 @@ public void setStartPage(int startPage) {
* before pressing OK in the dialog.
* <p>
* This value can be from 1 to the maximum number of pages for the platform.
- * Note that it is only valid if the scope is <code>PAGE_RANGE</code>.
+ * Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>.
* </p>
*
* @return the end page setting that the user selected
@@ -193,7 +197,7 @@ public int getEndPage() {
* is opened.
* <p>
* This value can be from 1 to the maximum number of pages for the platform.
- * Note that it is only valid if the scope is <code>PAGE_RANGE</code>.
+ * Note that it is only valid if the scope is <code>PrinterData.PAGE_RANGE</code>.
* </p>
*
* @param endPage the end page setting when the dialog is opened
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/emulated/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/emulated/org/eclipse/swt/printing/Printer.java
index d66daead29..bff64fd295 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/emulated/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/emulated/org/eclipse/swt/printing/Printer.java
@@ -33,6 +33,8 @@ import org.eclipse.swt.graphics.*;
*
* @see PrinterData
* @see PrintDialog
+ * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a>
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
*/
public final class Printer extends Device {
PrinterData data;
@@ -253,7 +255,9 @@ public Point getDPI() {
/**
* Returns a rectangle describing the receiver's size and location.
- * For a printer, this is the size of a physical page, in pixels.
+ * <p>
+ * For a printer, this is the size of the physical page, in pixels.
+ * </p>
*
* @return the bounding rectangle
*
@@ -272,8 +276,10 @@ public Rectangle getBounds() {
/**
* Returns a rectangle which describes the area of the
* receiver which is capable of displaying data.
+ * <p>
* For a printer, this is the size of the printable area
- * of a page, in pixels.
+ * of the page, in pixels.
+ * </p>
*
* @return the client area
*
@@ -290,28 +296,32 @@ public Rectangle getClientArea() {
}
/**
- * Given a desired <em>client area</em> for the receiver
- * (as described by the arguments), returns the bounding
- * rectangle which would be required to produce that client
- * area.
+ * Given a <em>client area</em> (as described by the arguments),
+ * returns a rectangle, relative to the client area's coordinates,
+ * that is the client area expanded by the printer's trim (or minimum margins).
* <p>
- * In other words, it returns a rectangle such that, if the
- * receiver's bounds were set to that rectangle, the area
- * of the receiver which is capable of displaying data
- * (that is, not covered by the "trimmings") would be the
- * rectangle described by the arguments (relative to the
- * receiver's parent).
- * </p><p>
- * Note that there is no setBounds for a printer. This method
- * is usually used by passing in the client area (the 'printable
- * area') of the printer. It can also be useful to pass in 0, 0, 0, 0.
+ * Most printers have a minimum margin on each edge of the paper where the
+ * printer device is unable to print. This margin is known as the "trim."
+ * This method can be used to calculate the printer's minimum margins
+ * by passing in a client area of 0, 0, 0, 0 and then using the resulting
+ * x and y coordinates (which will be <= 0) to determine the minimum margins
+ * for the top and left edges of the paper, and the resulting width and height
+ * (offset by the resulting x and y) to determine the minimum margins for the
+ * bottom and right edges of the paper, as follows:
+ * <ul>
+ * <li>The left trim width is -x pixels</li>
+ * <li>The top trim height is -y pixels</li>
+ * <li>The right trim width is (x + width) pixels</li>
+ * <li>The bottom trim height is (y + height) pixels</li>
+ * </ul>
* </p>
*
- * @param x the desired x coordinate of the client area
- * @param y the desired y coordinate of the client area
- * @param width the desired width of the client area
- * @param height the desired height of the client area
- * @return the required bounds to produce the given client area
+ * @param x the x coordinate of the client area
+ * @param y the y coordinate of the client area
+ * @param width the width of the client area
+ * @param height the height of the client area
+ * @return a rectangle, relative to the client area's coordinates, that is
+ * the client area expanded by the printer's trim (or minimum margins)
*
* @exception SWTException <ul>
* <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>

Back to the top