當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。