当前位置: 首页>>代码示例>>Java>>正文


Java TGLocalFileExporter类代码示例

本文整理汇总了Java中org.herac.tuxguitar.io.base.TGLocalFileExporter的典型用法代码示例。如果您正苦于以下问题:Java TGLocalFileExporter类的具体用法?Java TGLocalFileExporter怎么用?Java TGLocalFileExporter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TGLocalFileExporter类属于org.herac.tuxguitar.io.base包,在下文中一共展示了TGLocalFileExporter类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addFileFormats

import org.herac.tuxguitar.io.base.TGLocalFileExporter; //导入依赖的package包/类
private void addFileFormats(Combo combo){
	this.outputFormats.clear();
	
	TGFileFormatManager fileFormatManager = TGFileFormatManager.getInstance(this.context);
	
	Iterator<TGOutputStreamBase> outputStreams = fileFormatManager.getOutputStreams();
	while(outputStreams.hasNext()){
		TGOutputStreamBase stream = (TGOutputStreamBase)outputStreams.next();
		addFileFormats(combo, stream.getFileFormat() , stream );
	}
	
	Iterator<TGRawExporter> exporters = fileFormatManager.getExporters();
	while (exporters.hasNext()) {
		TGRawExporter exporter = (TGRawExporter)exporters.next();
		if( exporter instanceof TGLocalFileExporter ){
			addFileFormats(combo, ((TGLocalFileExporter)exporter).getFileFormat() , exporter );
		}
	}
	if(this.outputFormats.size() > 0 ){
		combo.select( 0 );
	}
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:23,代码来源:TGConverterDialog.java

示例2: processAction

import org.herac.tuxguitar.io.base.TGLocalFileExporter; //导入依赖的package包/类
protected void processAction(final TGActionContext context) {
	final TGSongStreamContext streamContext = this.findSongStreamContext(context);
	final TGLocalFileExporter exporter = context.getAttribute(ATTRIBUTE_PROVIDER);
	
	TGDocumentFileManager tgDocumentFileManager = TGDocumentFileManager.getInstance(getContext());
	tgDocumentFileManager.chooseFileNameForSave(new TGFileChooserHandler() {
		public void updateFileName(final String fileName) {
			final OutputStream stream = createOutputStream(fileName);
			if( stream != null ) {
				streamContext.setAttribute(OutputStream.class.getName(), stream);

				new Thread(new Runnable() {
					public void run() {
						TGActionManager tgActionManager = TGActionManager.getInstance(getContext());
						tgActionManager.execute(TGExportSongAction.NAME, context);
					}
				}).start();
			}
		}
	}, exporter.getFileFormat());
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:22,代码来源:TGExportFileAction.java

示例3: addFileFormats

import org.herac.tuxguitar.io.base.TGLocalFileExporter; //导入依赖的package包/类
private void addFileFormats(Combo combo){
	this.outputFormats.clear();
	
	Iterator outputStreams = TGFileFormatManager.instance().getOutputStreams();
	while(outputStreams.hasNext()){
		TGOutputStreamBase stream = (TGOutputStreamBase)outputStreams.next();
		addFileFormats(combo, stream.getFileFormat() , stream );
	}
	
	Iterator exporters = TGFileFormatManager.instance().getExporters();
	while (exporters.hasNext()) {
		TGRawExporter exporter = (TGRawExporter)exporters.next();
		if( exporter instanceof TGLocalFileExporter ){
			addFileFormats(combo, ((TGLocalFileExporter)exporter).getFileFormat() , exporter );
		}
	}
	if(this.outputFormats.size() > 0 ){
		combo.select( 0 );
	}
}
 
开发者ID:Totallicks,项目名称:totallicks-tuxguitar,代码行数:21,代码来源:TGConverterDialog.java

示例4: processLocalFileExporter

import org.herac.tuxguitar.io.base.TGLocalFileExporter; //导入依赖的package包/类
private int processLocalFileExporter( final TGLocalFileExporter exporter ){
	if(!exporter.configure(false)){
		return AUTO_UNLOCK;
	}
	
	final String fileName = FileActionUtils.chooseFileName(exporter.getFileFormat());
	if(fileName == null){
		return AUTO_UNLOCK;
	}
	
	TuxGuitar.instance().loadCursor(SWT.CURSOR_WAIT);
	new Thread(new Runnable() {
		public void run() {
			if(!TuxGuitar.isDisposed()){
				FileActionUtils.exportSong(exporter, fileName);
				TuxGuitar.instance().loadCursor(SWT.CURSOR_ARROW);
				ActionLock.unlock();
			}
		}
	}).start();
	
	return 0;
}
 
开发者ID:Totallicks,项目名称:totallicks-tuxguitar,代码行数:24,代码来源:ExportSongAction.java

示例5: exportSong

import org.herac.tuxguitar.io.base.TGLocalFileExporter; //导入依赖的package包/类
public static void exportSong(TGLocalFileExporter exporter, String path){
	try {
		OutputStream stream = new BufferedOutputStream(new FileOutputStream(new File(path)));
		TGSongManager manager = TuxGuitar.instance().getSongManager();
		exporter.init( manager.getFactory() , stream );
		exporter.exportSong(manager.getSong());
	} catch (Throwable throwable) {
		MessageDialog.errorMessage(new TGFileFormatException(TuxGuitar.getProperty("file.export.error", new String[]{path}),throwable));
	}
}
 
开发者ID:Totallicks,项目名称:totallicks-tuxguitar,代码行数:11,代码来源:FileActionUtils.java

示例6: execute

import org.herac.tuxguitar.io.base.TGLocalFileExporter; //导入依赖的package包/类
protected int execute(TypedEvent e){
	Object data = e.widget.getData(); 
	if(! (data instanceof TGRawExporter) ){
		return AUTO_UNLOCK;
	}
	
	final TGRawExporter exporter = (TGRawExporter)data;
	if( exporter instanceof TGLocalFileExporter ){
		return this.processLocalFileExporter( (TGLocalFileExporter)exporter );
	}
	return this.processRawExporter( exporter );
	/*
	if(!exporter.configure(false)){
		return AUTO_UNLOCK;
	}
	
	final String fileName = FileActionUtils.chooseFileName(exporter.getFileFormat());
	if(fileName == null){
		return AUTO_UNLOCK;
	}
	
	TuxGuitar.instance().loadCursor(SWT.CURSOR_WAIT);
	new Thread(new Runnable() {
		public void run() {
			if(!TuxGuitar.isDisposed()){
				FileActionUtils.exportSong(exporter, fileName);
				TuxGuitar.instance().loadCursor(SWT.CURSOR_ARROW);
				ActionLock.unlock();
			}
		}
	}).start();
	
	return 0;
	*/
}
 
开发者ID:Totallicks,项目名称:totallicks-tuxguitar,代码行数:36,代码来源:ExportSongAction.java

示例7: createExportFileActionProcessor

import org.herac.tuxguitar.io.base.TGLocalFileExporter; //导入依赖的package包/类
public TGActionProcessorListener createExportFileActionProcessor(TGLocalFileExporter exporter) {
	TGActionProcessorListener tgActionProcessorListener = this.createActionProcessor(TGExportFileAction.NAME);
	tgActionProcessorListener.setAttribute(TGExportFileAction.ATTRIBUTE_PROVIDER, exporter);
	return tgActionProcessorListener;
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:6,代码来源:FileMenuItem.java


注:本文中的org.herac.tuxguitar.io.base.TGLocalFileExporter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。