本文整理汇总了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 );
}
}
示例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());
}
示例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 );
}
}
示例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;
}
示例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));
}
}
示例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;
*/
}
示例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;
}