import java.util.List;
import java.util.Locale;
import java.util.Vector;
-import java.util.concurrent.Callable;
import javax.swing.ButtonGroup;
import javax.swing.JCheckBoxMenuItem;
import jalview.util.ImageMaker.TYPE;
import jalview.util.MessageManager;
import jalview.util.Platform;
+import jalview.util.imagemaker.BitmapImageSizing;
import jalview.viewmodel.AlignmentViewport;
import jalview.viewmodel.ViewportRanges;
import jalview.ws.DBRefFetcher;
@Override
public void setProgressBar(String message, long id)
{
- if (!Platform.isHeadless())
+ if (!Platform.isHeadless() && progressBar != null)
progressBar.setProgressBar(message, id);
}
public void registerHandler(final long id,
final IProgressIndicatorHandler handler)
{
- progressBar.registerHandler(id, handler);
+ if (progressBar != null)
+ progressBar.registerHandler(id, handler);
}
/**
@Override
public boolean operationInProgress()
{
- return progressBar.operationInProgress();
+ return progressBar == null ? false : progressBar.operationInProgress();
}
/**
}
AlignExportSettingsI options = new AlignExportSettingsAdapter(false);
- Callable<Void> cancelAction = () -> {
+ Runnable cancelAction = () -> {
lastSaveSuccessful = false;
- return null;
};
- Callable<Void> outputAction = () -> {
+ Runnable outputAction = () -> {
// todo defer this to inside formatSequences (or later)
AlignmentExportData exportData = viewport.getAlignExportData(options);
String output = new FormatAdapter(alignPanel, options)
AlignFrame.this.getViewport().setSavedUpToDate(true);
}
}
- return null;
};
/*
{
try
{
- outputAction.call();
+ outputAction.run();
} catch (Exception e)
{
// TODO Auto-generated catch block
FileFormatI fileFormat = FileFormats.getInstance()
.forName(fileFormatName);
AlignExportSettingsI options = new AlignExportSettingsAdapter(false);
- Callable<Void> outputAction = () -> {
+ Runnable outputAction = () -> {
// todo defer this to inside formatSequences (or later)
AlignmentExportData exportData = viewport.getAlignExportData(options);
CutAndPasteTransfer cap = new CutAndPasteTransfer();
oom);
cap.dispose();
}
- return null;
};
/*
{
try
{
- outputAction.call();
+ outputAction.run();
} catch (Exception e)
{
e.printStackTrace();
@Override
public void createPNG(File f)
{
- createPNG(f, null, 0.0f, 0, 0);
+ createPNG(f, null, BitmapImageSizing.nullBitmapImageSizing());
}
- public void createPNG(File f, String renderer, float bitmapscale,
- int bitmapwidth, int bitmapheight)
+ public void createPNG(File f, String renderer, BitmapImageSizing userBis)
{
- alignPanel.makeAlignmentImage(TYPE.PNG, f, renderer, bitmapscale,
- bitmapwidth, bitmapheight);
+ alignPanel.makeAlignmentImage(TYPE.PNG, f, renderer, userBis);
}
/**
String choice = chooser.getSelectedFile().getPath();
Cache.setProperty("LAST_DIRECTORY", choice);
loadJalviewDataFile(chooser.getSelectedFile(), null, null, null);
- return null;
});
chooser.showOpenDialog(this);
return;
}
- Callable okAction = () -> {
+ Runnable okAction = () -> {
SequenceI[] cut = sg.getSequences()
.toArray(new SequenceI[sg.getSize()]);
{
}
}
- return null;
};
/*
{
try
{
- okAction.call();
+ okAction.run();
} catch (Exception e)
{
e.printStackTrace();
.getString("label.possible_problem_with_tree_file"),
JvOptionPane.WARNING_MESSAGE);
}
- return null;
});
chooser.showOpenDialog(this);
}
Cache.setProperty("LAST_DIRECTORY", choice);
SequenceI[] seqs = viewport.getAlignment().getSequencesArray();
new VCFLoader(choice).loadVCF(seqs, us);
- return null;
});
chooser.showOpenDialog(null);