本文整理匯總了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;
}