锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲av色香蕉一区二区三区 ,亚洲精品人成网线在线播放va,国产亚洲女在线线精品http://m.tkk7.com/wuxufeng8080/category/39055.htmlzh-cnWed, 15 Apr 2009 08:23:37 GMTWed, 15 Apr 2009 08:23:37 GMT60瀹炵幇SWT鎵撳嵃琛ㄦ牸涓庡浘鐗囧姛鑳?ZT)http://m.tkk7.com/wuxufeng8080/articles/265765.html椋庝漢鍥?/dc:creator>椋庝漢鍥?/author>Wed, 15 Apr 2009 07:04:00 GMThttp://m.tkk7.com/wuxufeng8080/articles/265765.htmlhttp://m.tkk7.com/wuxufeng8080/comments/265765.htmlhttp://m.tkk7.com/wuxufeng8080/articles/265765.html#Feedback0http://m.tkk7.com/wuxufeng8080/comments/commentRss/265765.htmlhttp://m.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://m.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日韩AV天堂久久| 东北美女野外bbwbbw免费| 亚洲中文字幕无码爆乳AV| AAA日本高清在线播放免费观看| 亚洲成人激情在线| 亚洲成年人免费网站| 456亚洲人成影院在线观| 成年丰满熟妇午夜免费视频| 国产精品亚洲小说专区| 亚洲免费无码在线| 免费观看91视频| 亚洲精品国产专区91在线| 毛片免费在线播放| 青娱乐在线视频免费观看| 亚洲精品无码AV中文字幕电影网站| 国产区在线免费观看| 亚洲视频中文字幕| 在线观看的免费网站| 精品亚洲成A人在线观看青青| 国产性爱在线观看亚洲黄色一级片 | 亚洲视频一区在线| 国产一卡二卡四卡免费| 亚洲国产精品嫩草影院| 三上悠亚亚洲一区高清| 无码国产精品一区二区免费| 久久亚洲精品无码av| 亚洲国产精品无码专区| 国产成人无码免费看视频软件| 国产精品亚洲精品日韩电影| 国产亚洲人成网站观看| 岛国av无码免费无禁网站| 一级特黄a免费大片| 亚洲欧洲高清有无| 亚洲色偷偷综合亚洲AV伊人| 91香蕉国产线在线观看免费| 羞羞网站免费观看| 亚洲成人福利在线观看| 亚洲一区日韩高清中文字幕亚洲| 久久免费看黄a级毛片|