锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲av色香蕉一区二区三区 ,亚洲精品人成网线在线播放va,国产亚洲女在线线精品http://www.tkk7.com/wuxufeng8080/category/39055.htmlzh-cnWed, 15 Apr 2009 08:23:37 GMTWed, 15 Apr 2009 08:23:37 GMT60瀹炵幇SWT鎵撳嵃琛ㄦ牸涓庡浘鐗囧姛鑳?ZT)http://www.tkk7.com/wuxufeng8080/articles/265765.html椋庝漢鍥?/dc:creator>椋庝漢鍥?/author>Wed, 15 Apr 2009 07:04:00 GMThttp://www.tkk7.com/wuxufeng8080/articles/265765.htmlhttp://www.tkk7.com/wuxufeng8080/comments/265765.htmlhttp://www.tkk7.com/wuxufeng8080/articles/265765.html#Feedback0http://www.tkk7.com/wuxufeng8080/comments/commentRss/265765.htmlhttp://www.tkk7.com/wuxufeng8080/services/trackbacks/265765.html
婧愪唬鐮佷笅杞藉湴鍧錛?br /> 鍙傝冪綉鍧錛?br /> 錛?錛塰ttp://club.xasoft.org/?uid-167-action-viewspace-itemid-346#xspace-itemreply
錛?錛塰ttp://www.eclipseworld.org/bbs/read-cec-tid-5299-keyword-.html

綰疭WT鐨勬姤琛ㄥ簱: SWT Report錛屾敮鎸佹姤琛ㄦ墦鍗板姛鑳斤細
1. 璺ㄨ鍜岃法鍒楀姛鑳?br /> 2. 欏電爜鍜岄〉鏁扮粺璁?br /> 3. 杈硅窛鍜岄棿璺濊皟鏁?br /> 4. 鍚勮竟妗嗛鑹茶緗?br /> 5. 鍓嶆櫙鍜岃儗鏅鑹?br /> 6. 鑷傚簲欏甸潰澶у皬
鍏朵腑錛孋ustomReportTest 綾葷敓鎴愮殑鎶ヨ〃


SWT鎻愪緵鐨勬墦鍗板姛鑳藉緢綆鍗曪紝鐗瑰埆鏄湪鍋氳〃鏍兼墦鍗扮殑鏃跺欙紝闇瑕佸ぇ瀹朵嬌鐢℅C鑷繁緇樺嚭鏉ワ紝鎵嶈兘鎵撳嵃錛屽浜庡垵綰х殑寮鍙戜漢鍛樺拰浜哄姏涓嶈凍鐨勫叕鍙告潵璇存槸闈炲父楹葷儲鐨勪簨鎯呫?br />

import org.ceclipse.reporting.IReport;
import org.ceclipse.reporting.IReportPage;
import org.ceclipse.reporting.Report;
import org.ceclipse.reporting.ReportData;
import org.ceclipse.reporting.ReportUtil;
import org.eclipse.nebula.widgets.grid.Grid;
import org.eclipse.swt.printing.PrintDialog;
import org.eclipse.swt.printing.Printer;
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.PlatformUI;

/**
* 閫氱敤琛ㄦ牸鎵撳嵃緇勪歡錛岀洰鍓嶆彁渚涗袱涓柟娉曞垎鍒敤浜庢墦鍗拌〃鏍鹼紙Gird,Table錛?
* 宸ヤ綔浠誨姟鍚?printContent
* @author lign
*
*/
public class PrintContent   {

/**
* 瀵笹ird榪涜鎵撳嵃鎿嶄綔
    * @param grid SWT 鐨刵ebula欏圭洰鐨凣rid
* @param title 琛ㄥご鏂囧瓧鎻忚堪
    */
   public static void printGird(Grid grid, String title) {
        IReportPage page = ReportUtil.convert(grid, title);
        Report report = new Report();
       report.addPage(page);
      printToPrinter(report);
      
    }
  
   /**
    * 瀵筎able榪涜鎵撳嵃鎿嶄綔
    * @param table SWT 鐨凾able
    * @param title 琛ㄥご鏂囧瓧鎻忚堪
    */
   public static void printTable(Table table, String title) {
       IReportPage page = ReportUtil.convert(table, title);
       Report report = new Report();
      report.addPage(page);
       printToPrinter(report);
    
}

/**
    * 澶勭悊鎵撳嵃浠ュ強璋冪敤Printer
    * @param report
    */
    private static void printToPrinter(IReport report)   {
          ReportData reportData = report.getReportData();
        reportData.setJobName("printContent");
        reportData.setPrinter(new Printer(new PrintDialog(PlatformUI.getWorkbench

().getActiveWorkbenchWindow().getShell()).open()));
         report.print();
    }
}

鍙傝冪綉鍧錛?br /> 錛?錛塰ttp://club.xasoft.org/?uid-167-action-viewspace-itemid-346#xspace-itemreply
錛?錛塰ttp://www.eclipseworld.org/bbs/read-cec-tid-5299-keyword-.html
錛?錛塰ttp://www.tkk7.com/Javawind/articles/129899.html

鍜屾墦鍗版枃瀛椾笉鍚屻傚洜涓虹郴緇熶腑鐨刣pi(dot per inch)鍜屾墦鍗版満鐨刣pi涓嶅悓錛屾墍浠ヨ榪涜杞崲銆?br />
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.printing.*;
import org.eclipse.swt.widgets.*;

/** *//**
* This class demonstrates printing images
*/
public class ImagePrinterExample {
/** *//**
   * The application entry point
   * @param args the command line arguments
   */
public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display, SWT.NONE);

    try {
      // Prompt the user for an image file
      FileDialog fileChooser = new FileDialog(shell, SWT.OPEN);
      String fileName = fileChooser.open();

      if (fileName == null) { return; }

      // Load the image
      ImageLoader loader = new ImageLoader();
      ImageData[] imageData = loader.load(fileName);

      if (imageData.length > 0) {
        // Show the Choose Printer dialog
        PrintDialog dialog = new PrintDialog(shell, SWT.NULL);
        PrinterData printerData = dialog.open();

        if (printerData != null) {
          // Create the printer object
          Printer printer = new Printer(printerData);

          // Calculate the scale factor between the screen resolution and printer
          // resolution in order to correctly size the image for the printer
          Point screenDPI = display.getDPI();
          Point printerDPI = printer.getDPI();
          int scaleFactor = printerDPI.x / screenDPI.x;

          // Determine the bounds of the entire area of the printer
          Rectangle trim = printer.computeTrim(0, 0, 0, 0);

          // Start the print job
          if (printer.startJob(fileName)) {
            if (printer.startPage()) {
              GC gc = new GC(printer);
              Image printerImage = new Image(printer, imageData[0]);
             
              // Draw the image
              gc.drawImage(printerImage, 0, 0, imageData[0].width,
                imageData[0].height, -trim.x, -trim.y,
                scaleFactor * imageData[0].width,
                scaleFactor * imageData[0].height);

              // Clean up
              printerImage.dispose();
              gc.dispose();
              printer.endPage();
            }
          }
          // End the job and dispose the printer
          printer.endJob();
          printer.dispose();
        }
      }
    } catch (Exception e) {
      MessageBox messageBox = new MessageBox(shell, SWT.ICON_ERROR);
      messageBox.setMessage("Error printing test image");
      messageBox.open();
    }
}
}


]]>
主站蜘蛛池模板: 亚洲国产一成久久精品国产成人综合| 中文字幕无码不卡免费视频| 午夜亚洲av永久无码精品| 亚洲AV无码精品蜜桃| 亚洲成人免费网站| 亚洲美女精品视频| 国产精品久久永久免费| 性xxxx黑人与亚洲| 女人被男人桶得好爽免费视频| 日韩亚洲人成在线| 免费观看理论片毛片| 亚洲精华液一二三产区| www亚洲精品少妇裸乳一区二区| fc2成年免费共享视频网站| 在线A亚洲老鸭窝天堂| 日本免费电影一区二区| 久久精品亚洲中文字幕无码麻豆| 免费视频爱爱太爽了| 亚洲中文字幕久久精品蜜桃| 青草草在线视频永久免费| 羞羞视频免费网站入口| 久久亚洲中文字幕精品一区四| 国产一级片免费看| 亚洲精品福利网站| 日本免费人成黄页在线观看视频| 免费无码国产在线观国内自拍中文字幕 | 在线观着免费观看国产黄| 曰批全过程免费视频观看免费软件 | 久久精品国产免费一区| 亚洲综合亚洲国产尤物| 免费看片A级毛片免费看| jizz免费一区二区三区| 99人中文字幕亚洲区| 日本免费福利视频| 国产免费无码一区二区| 亚洲 欧洲 日韩 综合在线| 亚洲伊人久久成综合人影院| 亚洲视频免费在线观看| 亚洲中文精品久久久久久不卡| 亚洲综合精品香蕉久久网| 91在线视频免费91|