Changeset 246:fd9c62a2998e for dwt/printing
- Timestamp:
- 07/01/08 04:15:59 (5 months ago)
- Files:
-
- dwt/printing/PrintDialog.d (modified) (2 diffs)
- dwt/printing/Printer.d (modified) (5 diffs)
- dwt/printing/PrinterData.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/printing/PrintDialog.d
r213 r246 1 1 /******************************************************************************* 2 * Copyright (c) 2000, 200 6IBM Corporation and others.2 * Copyright (c) 2000, 2008 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 36 36 * within the DWT implementation. 37 37 * </p> 38 * 39 * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a> 40 * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample, Dialog tab</a> 41 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> 38 42 */ 39 43 dwt/printing/Printer.d
r213 r246 1 1 /******************************************************************************* 2 * Copyright (c) 2000, 200 6IBM Corporation and others.2 * Copyright (c) 2000, 2008 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 48 48 * @see PrinterData 49 49 * @see PrintDialog 50 * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a> 51 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> 50 52 */ 51 53 public final class Printer : Device { … … 418 420 /** 419 421 * Returns a rectangle describing the receiver's size and location. 420 * For a printer, this is the size of a physical page, in pixels. 422 * <p> 423 * For a printer, this is the size of the physical page, in pixels. 424 * </p> 421 425 * 422 426 * @return the bounding rectangle … … 439 443 * Returns a rectangle which describes the area of the 440 444 * receiver which is capable of displaying data. 445 * <p> 441 446 * For a printer, this is the size of the printable area 442 * of a page, in pixels. 447 * of the page, in pixels. 448 * </p> 443 449 * 444 450 * @return the client area … … 459 465 460 466 /** 461 * Given a desired <em>client area</em> for the receiver 462 * (as described by the arguments), returns the bounding 463 * rectangle which would be required to produce that client 464 * area. 465 * <p> 466 * In other words, it returns a rectangle such that, if the 467 * receiver's bounds were set to that rectangle, the area 468 * of the receiver which is capable of displaying data 469 * (that is, not covered by the "trimmings") would be the 470 * rectangle described by the arguments (relative to the 471 * receiver's parent). 472 * </p><p> 473 * Note that there is no setBounds for a printer. This method 474 * is usually used by passing in the client area (the 'printable 475 * area') of the printer. It can also be useful to pass in 0, 0, 0, 0. 476 * </p> 477 * 478 * @param x the desired x coordinate of the client area 479 * @param y the desired y coordinate of the client area 480 * @param width the desired width of the client area 481 * @param height the desired height of the client area 482 * @return the required bounds to produce the given client area 467 * Given a <em>client area</em> (as described by the arguments), 468 * returns a rectangle, relative to the client area's coordinates, 469 * that is the client area expanded by the printer's trim (or minimum margins). 470 * <p> 471 * Most printers have a minimum margin on each edge of the paper where the 472 * printer device is unable to print. This margin is known as the "trim." 473 * This method can be used to calculate the printer's minimum margins 474 * by passing in a client area of 0, 0, 0, 0 and then using the resulting 475 * x and y coordinates (which will be <= 0) to determine the minimum margins 476 * for the top and left edges of the paper, and the resulting width and height 477 * (offset by the resulting x and y) to determine the minimum margins for the 478 * bottom and right edges of the paper, as follows: 479 * <ul> 480 * <li>The left trim width is -x pixels</li> 481 * <li>The top trim height is -y pixels</li> 482 * <li>The right trim width is (x + width) pixels</li> 483 * <li>The bottom trim height is (y + height) pixels</li> 484 * </ul> 485 * </p> 486 * 487 * @param x the x coordinate of the client area 488 * @param y the y coordinate of the client area 489 * @param width the width of the client area 490 * @param height the height of the client area 491 * @return a rectangle, relative to the client area's coordinates, that is 492 * the client area expanded by the printer's trim (or minimum margins) 483 493 * 484 494 * @exception DWTException <ul> dwt/printing/PrinterData.d
r213 r246 1 1 /******************************************************************************* 2 * Copyright (c) 2000, 200 6IBM Corporation and others.2 * Copyright (c) 2000, 2008 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials 4 4 * are made available under the terms of the Eclipse Public License v1.0 … … 34 34 * @see Printer#getPrinterList 35 35 * @see PrintDialog#open 36 * @see <a href="http://www.eclipse.org/swt/snippets/#printing">Printing snippets</a> 37 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> 36 38 */ 37 39
