exportswf.java
来自「用Java开发的、实现类似Visio功能的应用程序源码」· Java 代码 · 共 74 行
JAVA
74 行
/**
* $Id: ExportSWF.java $
*
* Copyright 2004 ~ 2005 JingFei International Cooperation LTD. All rights reserved.
*
*/
package com.jfimagine.jfgraph.transfer;
import java.awt.Dimension;
import java.io.File;
import java.io.IOException;
import org.freehep.graphics2d.VectorGraphics;
import org.freehep.graphicsio.swf.SWFGraphics2D;
import com.jfimagine.utils.log.*;
/**
* ExportSWF class is used to output SWF images.
*
* @author CookieMaker
*
* @version $Revision: 1.3.0 $
*/
public class ExportSWF extends ExportBase{
/**an internal log utility*/
private JFLogger m_logger=JFLogManager.getLogger(this.getClass());
/**
* Export current page or list to a specified file.
* @param fileName A specified file name to be exported.
*/
public boolean export(String fileName){
try{
prepareExport();
int width =getExportWidth();
int height =getExportHeight();
VectorGraphics g = new SWFGraphics2D(new File(fileName), new Dimension(width,height));
g.startExport();
draw(g);
g.endExport();
return true;
}catch(IOException e){
m_logger.error("export:"+e);
return false;
}
}
/**
* get export file extension.
* @return the export file extension.
*/
public String getExportFileExt(){
return JFFileFilter.FILEEXT_SWF;
}
/**
* get export file description
* @return the export file description
*/
public String getExportFileDesc(){
return JFFileFilter.FILEDESC_SWF;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?