Runtime rt = Runtime.getRuntime();
try
{
- if (Desktop.getInstance() != null)
+ if (Desktop.instance != null)
{
- Desktop.getInstance().startLoading(file);
+ Desktop.instance.startLoading(file);
}
if (format == null)
{
if (format == null)
{
- Desktop.getInstance().stopLoading();
+ Desktop.instance.stopLoading();
System.err.println("The input file \"" + file
+ "\" has null or unidentifiable data content!");
if (!Jalview.isHeadlessMode())
{
- JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+ JvOptionPane.showInternalMessageDialog(Desktop.desktop,
MessageManager.getString("label.couldnt_read_data")
+ " in " + file + "\n"
+ AppletFormatAdapter.getSupportedFormats(),
}
// TODO: cache any stream datasources as a temporary file (eg. PDBs
// retrieved via URL)
- if (Desktop.getDesktopPane() != null && Desktop.getDesktopPane().isShowMemoryUsage())
+ if (Desktop.desktop != null && Desktop.desktop.isShowMemoryUsage())
{
System.gc();
memused = (rt.maxMemory() - rt.totalMemory() + rt.freeMemory()); // free
if (downloadStructureFile)
{
String structExt = format.getExtensions().split(",")[0];
- int pt = file.lastIndexOf(file.indexOf('/') >= 0 ? "/"
- : System.getProperty("file.separator"));
- String urlLeafName = file.substring(pt,
+ String urlLeafName = file.substring(
+ file.lastIndexOf(
+ System.getProperty("file.separator")),
file.lastIndexOf("."));
String tempStructureFileStr = createNamedJvTempFile(
urlLeafName, structExt);
// register PDB entries with desktop's structure selection
// manager
StructureSelectionManager
- .getStructureSelectionManager(Desktop.getInstance())
+ .getStructureSelectionManager(Desktop.instance)
.registerPDBEntry(pdbe);
}
}
}
else
{
- if (Desktop.getInstance() != null)
+ if (Desktop.instance != null)
{
- Desktop.getInstance().stopLoading();
+ Desktop.instance.stopLoading();
}
final String errorMessage = MessageManager.getString(
"label.couldnt_load_file") + " " + title + "\n" + error;
// TODO: refactor FileLoader to be independent of Desktop / Applet GUI
// bits ?
- if (raiseGUI && Desktop.getDesktopPane() != null)
+ if (raiseGUI && Desktop.desktop != null)
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
- JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+ JvOptionPane.showInternalMessageDialog(Desktop.desktop,
errorMessage,
MessageManager
.getString("label.error_loading_file"),
@Override
public void run()
{
- JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+ JvOptionPane.showInternalMessageDialog(Desktop.desktop,
MessageManager.formatMessage(
"label.problems_opening_file", new String[]
{ file }),
@Override
public void run()
{
- JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+ JvOptionPane.showInternalMessageDialog(Desktop.desktop,
MessageManager.formatMessage(
"warn.out_of_memory_loading_file", new String[]
{ file }),
// memory
// after
// load
- if (Desktop.getDesktopPane() != null && Desktop.getDesktopPane().isShowMemoryUsage())
+ if (Desktop.desktop != null && Desktop.desktop.isShowMemoryUsage())
{
if (alignFrame != null)
{
}
}
// remove the visual delay indicator
- if (Desktop.getInstance() != null)
+ if (Desktop.instance != null)
{
- Desktop.getInstance().stopLoading();
+ Desktop.instance.stopLoading();
}
}