锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲三级电影网站,亚洲av无一区二区三区,精品亚洲视频在线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();
    }
}
}


]]>
主站蜘蛛池模板: 亚洲视频在线视频| 在线A亚洲老鸭窝天堂| 老司机午夜精品视频在线观看免费 | 国产精品亚洲专一区二区三区| 日韩在线播放全免费| 亚洲精品中文字幕无码AV| 最近中文字幕无免费| 亚洲免费闲人蜜桃| 国产大片线上免费观看| 亚洲国产中文在线视频| 在线观看成人免费视频| 亚洲大尺度无码无码专线一区| 日韩一级在线播放免费观看| 亚洲伊人成无码综合网| 精品免费久久久久国产一区 | 国产亚洲精品2021自在线| va亚洲va日韩不卡在线观看| 亚洲丁香色婷婷综合欲色啪| 亚在线观看免费视频入口| 亚洲人成在久久综合网站| 我要看WWW免费看插插视频| 国产亚洲精品91| 亚洲成A人片在线观看无码不卡 | 国产成人亚洲精品电影| 久久亚洲2019中文字幕| 免费女人高潮流视频在线观看| 亚洲人成在线中文字幕| 免费在线观看你懂的| 国产一精品一AV一免费| 亚洲一本大道无码av天堂| 国产自国产自愉自愉免费24区 | 四虎国产精品免费视| 亚洲人色大成年网站在线观看| 成人毛片视频免费网站观看| 最好2018中文免费视频| 亚洲国产精品一区二区成人片国内| 欧洲一级毛片免费| 免费无码婬片aaa直播表情| 久久丫精品国产亚洲av不卡| 日本免费人成黄页在线观看视频| 国产99视频精品免费视频76|